> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oasm.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create workflow

> Creates a new workflow with the provided data.



## OpenAPI

````yaml /api-reference/openapi.json post /api/workflows
openapi: 3.0.0
info:
  title: Open Attack Surface Management
  description: Open-source platform for cybersecurity Attack Surface Management (ASM)
  version: '1.0'
  contact: {}
servers:
  - url: https://{baseUrl}/api/v1
    variables:
      baseUrl:
        default: localhost:3000
        description: API server hostname with port (e.g. localhost:3000, api.example.com)
security: []
tags: []
externalDocs:
  description: Authentication Docs
  url: auth/docs
paths:
  /api/workflows:
    post:
      tags:
        - Workflows
      summary: Create workflow
      description: Creates a new workflow with the provided data.
      operationId: WorkflowsController_createWorkflow
      parameters:
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkflowDto'
      responses:
        '200':
          description: Created workflow object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    CreateWorkflowDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the workflow
          example: Group Workflow
        content:
          description: Content of the workflow in JSON format
          allOf:
            - $ref: '#/components/schemas/WorkflowContent'
        filePath:
          type: string
          description: File path for the workflow
          example: workflows/vulnerability-scan.yaml
      required:
        - name
        - content
    Workflow:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        name:
          type: string
        content:
          $ref: '#/components/schemas/WorkflowContent'
        filePath:
          type: string
        isCanDelete:
          type: boolean
        isCanEdit:
          type: boolean
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - content
        - filePath
        - isCanDelete
        - isCanEdit
    AppResponseSerialization:
      type: object
      properties: {}
    WorkflowContent:
      type: object
      properties:
        'on':
          $ref: '#/components/schemas/On'
        jobs:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/WorkflowJob'
          description: Jobs keyed by a unique job id; `needs` references those same ids
        name:
          type: string
      required:
        - jobs
        - name
    'On':
      type: object
      properties:
        target:
          type: array
          items:
            type: string
        schedule:
          type: array
          items:
            $ref: '#/components/schemas/ScheduleOn'
        assetsAdded:
          $ref: '#/components/schemas/AssetsAddedTriggerConfig'
    WorkflowJob:
      type: object
      properties:
        name:
          type: string
        run:
          type: string
        category:
          allOf:
            - $ref: '#/components/schemas/ToolCategory'
        input:
          type: array
          items:
            $ref: '#/components/schemas/DataKind'
        needs:
          type: array
          items:
            type: string
        allowFailure:
          type: boolean
        config:
          type: object
        configProfileId:
          type: string
      required:
        - run
    ScheduleOn:
      type: object
      properties:
        cron:
          type: string
          example: 0 2 * * 1
      required:
        - cron
    AssetsAddedTriggerConfig:
      type: object
      properties:
        windowMinutes:
          type: number
          minimum: 0
          maximum: 1440
        maxAssets:
          type: number
          minimum: 1
          maximum: 5000
        targetTypes:
          type: array
          items:
            type: string
    ToolCategory:
      type: string
      enum:
        - subdomains
        - http_probe
        - ports_scanner
        - vulnerabilities
        - screenshot
        - url_discovery
    DataKind:
      type: string
      enum:
        - target
        - host
        - service
        - web
        - url
        - repository
        - vulnerability

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.