> ## 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 project

> Creates a project with its hand-picked assets, scope rules, pipeline and triggers in one request.



## OpenAPI

````yaml /api-reference/openapi.json post /api/projects
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/projects:
    post:
      tags:
        - Projects
      summary: Create project
      description: >-
        Creates a project with its hand-picked assets, scope rules, pipeline and
        triggers in one request.
      operationId: ProjectsController_create
      parameters:
        - name: X-Workspace-Id
          in: header
          description: Workspace ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProjectDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
                allOf:
                  - $ref: '#/components/schemas/AppResponseSerialization'
components:
  schemas:
    CreateProjectDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the project
          example: Web Servers
        hexColor:
          type: string
          description: Hex color of the project
          example: '#78716C'
        description:
          type: string
          description: What the project covers
        hostIds:
          description: Asset (host) IDs picked by hand
          type: array
          items:
            type: string
        scopeRules:
          description: Scope rules; matching assets join the project
          type: array
          items:
            $ref: '#/components/schemas/ScopeRuleInputDto'
        autoAddAssets:
          type: boolean
          default: true
          description: Add assets found later when they match a rule
        template:
          type: string
          description: >-
            Workflow template (file name of a default workflow) for the
            pipeline. Ignored when tools are given.
          example: vulnerability_scan_basic.yaml
        tools:
          description: Tools of the pipeline, with optional stages
          type: array
          items:
            $ref: '#/components/schemas/ProjectToolInput'
        workflowName:
          type: string
          description: Name of the pipeline
        'on':
          description: >-
            When the pipeline runs on its own: schedules and "assets added".
            Requires a pipeline. Replaces schedule and onAssetsAdded.
          allOf:
            - $ref: '#/components/schemas/ProjectWorkflowOnDto'
        schedule:
          type: string
          description: >-
            Deprecated, use on.schedule. Cron schedule (UTC) of the pipeline,
            e.g. "0 2 * * 1". Requires a pipeline.
          example: 0 0 */3 * *
        onAssetsAdded:
          description: >-
            Deprecated, use on.assetsAdded. Run the pipeline on assets as they
            join the project. Requires a pipeline.
          allOf:
            - $ref: '#/components/schemas/AssetsAddedTriggerConfigDto'
        runNow:
          type: boolean
          description: Start a run on the whole scope right after creation
      required:
        - name
    Project:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        name:
          type: string
        hexColor:
          type: string
          example: '#78716C'
        description:
          type: string
          nullable: true
        autoAddAssets:
          type: boolean
        archivedAt:
          type: string
          format: date-time
          nullable: true
        projectWorkflows:
          type: array
          items:
            $ref: '#/components/schemas/ProjectWorkflow'
        totalAssets:
          type: number
        lastRunAt:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - autoAddAssets
        - totalAssets
    AppResponseSerialization:
      type: object
      properties: {}
    ScopeRuleInputDto:
      type: object
      properties:
        mode:
          allOf:
            - $ref: '#/components/schemas/ProjectScopeRuleMode'
        type:
          allOf:
            - $ref: '#/components/schemas/ProjectScopeRuleType'
        value:
          type: string
          description: Target id, hostname pattern (`*` wildcards), CIDR, or asset id
          example: '*.example.com'
      required:
        - mode
        - type
        - value
    ProjectToolInput:
      type: object
      properties:
        toolId:
          type: string
          description: Tool ID
        config:
          type: object
          description: Inline config override for this tool
        configProfileId:
          type: string
          description: Reference to a saved config profile
        category:
          description: 'Category to run the tool in (default: its first)'
          allOf:
            - $ref: '#/components/schemas/ToolCategory'
        input:
          type: array
          description: >-
            Kinds of data the tool takes, best first (default: its own inputs).
            Must be among the ones its category accepts.
          items:
            $ref: '#/components/schemas/DataKind'
        stage:
          type: number
          minimum: 1
          description: >-
            Pipeline stage, from 1. Tools of a stage run in parallel; the next
            stage waits for them. Default 1.
      required:
        - toolId
    ProjectWorkflowOnDto:
      type: object
      properties:
        schedule:
          type: array
          items:
            $ref: '#/components/schemas/ScheduleInputDto'
        assetsAdded:
          nullable: true
          description: Run when assets join the project; absent or null = never
          type: object
          allOf:
            - $ref: '#/components/schemas/AssetsAddedInputDto'
    AssetsAddedTriggerConfigDto:
      type: object
      properties:
        windowMinutes:
          type: number
          default: 10
          description: Minutes to gather new assets into one run
        maxAssets:
          type: number
          default: 200
          description: Most assets one run takes; more start further runs
        targetTypes:
          type: array
          description: Only assets of these target types; empty = all
          items:
            $ref: '#/components/schemas/TargetType'
    ProjectWorkflow:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        projectId:
          type: string
        workflow:
          $ref: '#/components/schemas/Workflow'
        workflowId:
          type: string
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/ProjectWorkflowTrigger'
        lastRun:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/ProjectLastRunDto'
      required:
        - id
        - createdAt
        - updatedAt
        - projectId
        - workflow
        - workflowId
    ProjectScopeRuleMode:
      type: string
      enum:
        - include
        - exclude
    ProjectScopeRuleType:
      type: string
      enum:
        - target
        - hostname
        - cidr
        - asset
    ToolCategory:
      type: string
      enum:
        - subdomains
        - http_probe
        - ports_scanner
        - vulnerabilities
        - screenshot
        - url_discovery
    DataKind:
      type: string
      enum:
        - target
        - host
        - service
        - web
        - url
        - repository
        - vulnerability
    ScheduleInputDto:
      type: object
      properties:
        cron:
          type: string
          example: 0 2 * * 1
          description: 5-field cron expression, in UTC
        enabled:
          type: boolean
          default: true
          description: >-
            Off keeps the schedule in the workflow without running it. Omitted:
            a new schedule is on, an existing one keeps its state.
      required:
        - cron
    AssetsAddedInputDto:
      type: object
      properties:
        windowMinutes:
          type: number
          default: 10
          description: Minutes to gather new assets into one run
        maxAssets:
          type: number
          default: 200
          description: Most assets one run takes; more start further runs
        targetTypes:
          type: array
          description: Only assets of these target types; empty = all
          items:
            $ref: '#/components/schemas/TargetType'
        enabled:
          type: boolean
          default: true
          description: Off keeps the trigger in the workflow without running it
    TargetType:
      type: string
      enum:
        - DOMAIN
        - CIDR
        - IP
        - GIT_ORG
      description: The type of target (DOMAIN, CIDR, or IP)
    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
    ProjectWorkflowTrigger:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        projectWorkflowId:
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/ProjectTriggerType'
        cron:
          type: string
          nullable: true
        config:
          $ref: '#/components/schemas/AssetsAddedTriggerConfig'
        enabled:
          type: boolean
        lastFiredAt:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - createdAt
        - updatedAt
        - projectWorkflowId
        - type
        - config
        - enabled
    ProjectLastRunDto:
      type: object
      properties:
        id:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        totalJobs:
          type: number
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - failed
            - cancelled
            - skipped
        workflowName:
          type: string
        jobHistoryName:
          type: string
        jobRunType:
          type: string
          enum:
            - manual
            - scheduled
            - event
      required:
        - id
        - createdAt
        - updatedAt
        - totalJobs
        - status
        - workflowName
        - jobHistoryName
        - jobRunType
    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
    ProjectTriggerType:
      type: string
      enum:
        - cron
        - assets_added
    AssetsAddedTriggerConfig:
      type: object
      properties:
        windowMinutes:
          type: number
          minimum: 0
          maximum: 1440
        maxAssets:
          type: number
          minimum: 1
          maximum: 5000
        targetTypes:
          type: array
          items:
            type: string
    '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

````

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