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

# Create a task

> Create a manual task on an existing ticket. Tasks cannot be added to onboarding tickets (whose tasks are managed automatically).

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /tasks
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /tasks:
    post:
      tags:
        - Tasks
      summary: Create a task
      description: >-
        Create a manual task on an existing ticket. Tasks cannot be added to
        onboarding tickets (whose tasks are managed automatically).
      operationId: createTask
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskOutput_Output'
components:
  schemas:
    CreateTaskBody:
      type: object
      properties:
        ticketId:
          type: string
          minLength: 1
        title:
          type: string
          minLength: 1
        assigneeEmployeeId:
          type: string
        priority:
          anyOf:
            - type: string
              enum:
                - LOW
                - MEDIUM
                - HIGH
            - type: 'null'
        dueDate:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        tagIds:
          description: Ids of the tags to attach to the task
          type: array
          items:
            type: string
        requester:
          description: >-
            Open the task on behalf of an employee or email. Defaults to the API
            key / connected user.
          anyOf:
            - type: object
              properties:
                type:
                  type: string
                  const: EMPLOYEE
                employeeId:
                  type: string
                  minLength: 1
              required:
                - type
                - employeeId
            - type: object
              properties:
                type:
                  type: string
                  const: EMAIL
                email:
                  type: string
                  minLength: 1
              required:
                - type
                - email
      required:
        - ticketId
        - title
    TaskOutput_Output:
      type: object
      properties:
        id:
          type: string
        ticketId:
          type: string
        title:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETED
            - CANCELLED
        isManuallyCompletable:
          type: boolean
          description: Whether a human (not only the system) may complete this task
        isAdminManaged:
          type: boolean
          description: Whether only an admin may assign this task or change its status
        assignee:
          anyOf:
            - anyOf:
                - type: object
                  properties:
                    type:
                      type: string
                      const: EMAIL
                    email:
                      type: string
                  required:
                    - type
                    - email
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: EMPLOYEE
                    employeeId:
                      type: string
                  required:
                    - type
                    - employeeId
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: EXTERNAL_ADMIN
                    userId:
                      type: string
                  required:
                    - type
                    - userId
                  additionalProperties: false
            - type: 'null'
        tagIds:
          type: array
          description: Ids of the tags attached to this task
          items:
            type: string
      required:
        - id
        - ticketId
        - title
        - status
        - isManuallyCompletable
        - isAdminManaged
        - assignee
        - tagIds
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````