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

# Create a task

> Creates a new task, optionally associated with records and assignees



## OpenAPI

````yaml /api-reference/openapi.json post /v1/tasks
openapi: 3.0.0
info:
  description: >-
    REST API for accessing and managing your Nex data. Generate API keys from
    the Nex web UI and use them to authenticate requests.
  title: Nex Developer API
  contact: {}
  version: '1.0'
servers:
  - url: https://app.nex.ai/api/developers
security: []
paths:
  /v1/tasks:
    post:
      tags:
        - Tasks
      summary: Create a task
      description: Creates a new task, optionally associated with records and assignees
      operationId: createTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/developer.CreateTaskRequest'
        description: Task to create
        required: true
      responses:
        '200':
          description: Created task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/developer.TaskResponse'
        '400':
          description: Bad request - Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    developer.CreateTaskRequest:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          description: Task title (non-empty)
        description:
          type: string
          description: Task description
        priority:
          type: string
          description: Task priority
          enum:
            - unspecified
            - low
            - medium
            - high
            - urgent
        due_date:
          type: string
          format: date-time
          description: Due date (RFC3339)
        entity_ids:
          type: array
          items:
            type: string
          description: Associated record IDs
        assignee_ids:
          type: array
          items:
            type: string
          description: Assigned user IDs
      example:
        title: Follow up with client
        description: Discuss contract renewal
        priority: high
        due_date: '2026-03-01T09:00:00Z'
        entity_ids:
          - '1001'
          - '1002'
        assignee_ids:
          - '50'
    developer.TaskResponse:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        priority:
          type: string
        due_date:
          type: string
          format: date-time
        is_completed:
          type: boolean
        completed_at:
          type: string
          format: date-time
        assignee_ids:
          type: array
          items:
            type: string
        entity_ids:
          type: array
          items:
            type: string
        created_by:
          type: string
        created_by_id:
          type: string
        created_at:
          type: string
          format: date-time
        archived_at:
          type: string
          format: date-time
      example:
        id: '800'
        title: Follow up with client
        description: Discuss contract renewal
        priority: high
        due_date: '2026-03-01T09:00:00Z'
        is_completed: false
        assignee_ids:
          - '50'
        entity_ids:
          - '1001'
          - '1002'
        created_by: developer_api
        created_by_id: '42'
        created_at: '2024-01-15T10:00:00Z'
    httpx.APIError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: 'API key for authentication (format: "Bearer YOUR_API_KEY")'
      type: apiKey
      name: Authorization
      in: header

````