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

# Create Task

> Create a new task for a case.



## OpenAPI

````yaml https://platform.tracecat.com/api/openapi.json post /workspaces/{workspace_id}/cases/{case_id}/tasks
openapi: 3.1.0
info:
  title: Tracecat API
  summary: Tracecat API
  description: The open source AI automation platform for security teams and agents.
  termsOfService: >-
    https://docs.google.com/document/d/e/2PACX-1vQvDe3SoVAPoQc51MgfGCP71IqFYX_rMVEde8zC4qmBCec5f8PLKQRdxa6tsUABT8gWAR9J-EVs2CrQ/pub
  contact:
    name: Tracecat Founders
    email: founders@tracecat.com
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1'
servers:
  - url: /api
security: []
tags:
  - name: public
    description: Public facing endpoints
  - name: workflows
    description: Workflow management
  - name: actions
    description: Action management
  - name: triggers
    description: Workflow triggers
  - name: secrets
    description: Secret management
  - name: variables
    description: Workspace variable management
paths:
  /workspaces/{workspace_id}/cases/{case_id}/tasks:
    post:
      tags:
        - cases
      summary: Create Task
      description: Create a new task for a case.
      operationId: cases-create_task
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Case Id
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseTaskCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaseTaskRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyCookie: []
        - ServiceAccountApiKeyBearer: []
components:
  schemas:
    CaseTaskCreate:
      properties:
        title:
          type: string
          maxLength: 255
          minLength: 1
          title: Title
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        priority:
          $ref: '#/components/schemas/CasePriority'
          default: unknown
        status:
          $ref: '#/components/schemas/CaseTaskStatus'
          default: todo
        assignee_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Assignee Id
        workflow_id:
          anyOf:
            - type: string
              pattern: wf_[0-9a-zA-Z]+
            - type: string
              pattern: wf-[0-9a-f]{32}
            - type: 'null'
          title: Workflow Id
        default_trigger_values:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Default Trigger Values
      type: object
      required:
        - title
      title: CaseTaskCreate
    CaseTaskRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        case_id:
          type: string
          format: uuid
          title: Case Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        priority:
          $ref: '#/components/schemas/CasePriority'
        status:
          $ref: '#/components/schemas/CaseTaskStatus'
        assignee:
          anyOf:
            - $ref: '#/components/schemas/UserRead'
            - type: 'null'
        workflow_id:
          anyOf:
            - type: string
              pattern: wf_[0-9a-zA-Z]+
            - type: 'null'
          title: Workflow Id
        default_trigger_values:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Default Trigger Values
      type: object
      required:
        - id
        - created_at
        - updated_at
        - case_id
        - title
        - description
        - priority
        - status
        - workflow_id
      title: CaseTaskRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CasePriority:
      type: string
      enum:
        - unknown
        - low
        - medium
        - high
        - critical
        - other
      title: CasePriority
      description: |-
        Case priority values aligned with urgency levels.

        Values:
            UNKNOWN (0): No priority is assigned
            LOW (1): Application or personal procedure is unusable, where a workaround is available or a repair is possible
            MEDIUM (2): Non-critical function or procedure is unusable or hard to use causing operational disruptions with no direct impact on a service's availability. A workaround is available
            HIGH (3): Critical functionality or network access is interrupted, degraded or unusable, having a severe impact on services availability. No acceptable alternative is possible
            CRITICAL (4): Interruption making a critical functionality inaccessible or a complete network interruption causing a severe impact on services availability. There is no possible alternative
            OTHER (99): The priority is not normalized
    CaseTaskStatus:
      type: string
      enum:
        - todo
        - in_progress
        - completed
        - blocked
      title: CaseTaskStatus
      description: Case task status values.
    UserRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        email:
          type: string
          format: email
          title: Email
        is_active:
          type: boolean
          title: Is Active
          default: true
        is_superuser:
          type: boolean
          title: Is Superuser
          default: false
        is_verified:
          type: boolean
          title: Is Verified
          default: false
        role:
          $ref: '#/components/schemas/UserRole'
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        settings:
          additionalProperties: true
          type: object
          title: Settings
      type: object
      required:
        - id
        - email
        - role
        - settings
      title: UserRead
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserRole:
      type: string
      enum:
        - basic
        - admin
      title: UserRole
  securitySchemes:
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: fastapiusersauth
    ServiceAccountApiKeyBearer:
      type: http
      description: Tracecat service account API key.
      scheme: bearer

````