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

# Create a task



## OpenAPI

````yaml openapi-core.json POST /v1/tasks
openapi: 3.1.0
info:
  title: Yorlet Core API
  description: Core platform APIs including buildings, customers, units, and tasks.
  version: 1.0.0
servers:
  - url: https://api.yorlet.com
    description: Production
  - url: https://api.yorlet.io
    description: Sandbox
security: []
paths:
  /v1/tasks:
    post:
      tags:
        - Tasks
      summary: Create a task
      operationId: tasks_create
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  description: The title of the task.
                description:
                  type: string
                  minLength: 1
                  description: The description of the task.
                due_date:
                  type: number
                  minimum: 1
                  description: The due date of the task as a unix timestamp.
                priority:
                  type: number
                  minimum: 0
                  maximum: 3
                  default: 0
                  description: The priority of the task, where 0 is low and 3 is urgent.
                important:
                  type: boolean
                  default: false
                  description: Whether the task is marked as important.
                status:
                  type: string
                  enum:
                    - to_do
                    - in_progress
                    - done
                  default: to_do
                  description: The status of the task.
                checklist_items:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      text:
                        type: string
                        description: The text of the checklist item.
                      completed:
                        type: boolean
                        default: false
                        description: Whether the checklist item is completed.
                    required:
                      - text
                  default: {}
                  description: Checklist items to attach to the task.
                assignee:
                  type: string
                  minLength: 1
                  description: The ID of the user to assign the task to.
              required:
                - title
                - description
                - due_date
                - assignee
      responses:
        '200':
          description: Returns the task object if the request succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object.
                  created:
                    type: number
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  account:
                    type: string
                    description: >-
                      The account that the object belongs to. Only returned if
                      the request is made with a valid Yorlet-Context header.
                  deleted:
                    type: boolean
                    default: false
                    description: Only returned if the object has been deleted.
                  object:
                    type: string
                    enum:
                      - task
                  title:
                    type: string
                    description: The title of the task.
                  description:
                    type: string
                    description: The description of the task.
                  due_date:
                    type: number
                    description: The due date of the task as a unix timestamp.
                  priority:
                    type: number
                    minimum: 0
                    maximum: 3
                    description: The priority of the task, where 0 is low and 3 is urgent.
                  important:
                    type: boolean
                    default: false
                    description: Whether the task is marked as important.
                  status:
                    type: string
                    enum:
                      - to_do
                      - in_progress
                      - done
                    description: The status of the task.
                  checklist_items:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        text:
                          type: string
                          description: The text of the checklist item.
                        completed:
                          type: boolean
                          description: Whether the checklist item is completed.
                      required:
                        - text
                        - completed
                    default: {}
                    description: Checklist items attached to the task, keyed by ID.
                  assignee:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            description: Unique identifier for the object.
                          created:
                            type: number
                            description: >-
                              Time at which the object was created. Measured in
                              seconds since the Unix epoch.
                          account:
                            type: string
                            description: >-
                              The account that the object belongs to. Only
                              returned if the request is made with a valid
                              Yorlet-Context header.
                          deleted:
                            type: boolean
                            default: false
                            description: Only returned if the object has been deleted.
                          object:
                            type: string
                            enum:
                              - user
                          email:
                            type: string
                          name:
                            type: string
                        required:
                          - id
                          - created
                          - object
                          - email
                          - name
                      - type: string
                    description: The assignee of this task.
                required:
                  - id
                  - created
                  - object
                  - title
                  - description
                  - due_date
                  - priority
                  - status
                  - assignee
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Key authentication. Use "Bearer YOUR_API_KEY".

````