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

# Create task

> Create a new task with required content and type. Optionally associate with a person, deal, client, or job.



## OpenAPI

````yaml /api-reference/openapi-v1.json post /v1/tasks
openapi: 3.1.0
info:
  title: Stardex API (v1)
  version: 1.0.0
  description: >-
    Stardex ATS API — manage candidates, jobs, companies, and recruiting
    workflows.
servers:
  - url: https://api.stardex.ai
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Persons
    description: Manage person records — contacts, work history, and custom fields.
  - name: Jobs
    description: Manage job postings — pipeline stages, team members, and custom fields.
  - name: Candidates
    description: Manage candidate records and pipeline stage transitions.
  - name: Companies
    description: Browse and retrieve company records.
  - name: Lists
    description: Create, search, and retrieve saved person and company lists.
  - name: Person Activities
    description: Create and manage activity records (notes, emails, meetings) for persons.
  - name: Team Members
    description: List team members for use in search filters and assignments.
  - name: Custom Fields
    description: Retrieve custom field definitions and tag options for search filters.
paths:
  /v1/tasks:
    post:
      tags:
        - Tasks
      summary: Create task
      description: >-
        Create a new task with required content and type. Optionally associate
        with a person, deal, client, or job.
      operationId: createTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCreateRequest'
      responses:
        '201':
          description: Task created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreateResponse'
              example:
                success: true
                data:
                  id: aaa11111-bbbb-cccc-dddd-eeeeeeee1111
                  content_text: Follow up with candidate about interview availability
                  task_type: text
                  due_date: '2024-02-15T17:00:00Z'
                  is_completed: false
                  person_id: 123e4567-e89b-12d3-a456-426614174000
                  deal_id: 234e5678-e90a-12b3-c456-789012345678
                  client_id: 345e6789-e01b-23c4-d567-890123456789
                  job_id: 456e7890-e12b-34d5-a678-901234567890
                  created_at: '2024-02-01T10:00:00Z'
                  updated_at: '2024-02-01T10:00:00Z'
                  owners:
                    - id: 567e8901-e23c-45d6-e789-012345678901
                      first_name: Jane
                      last_name: Smith
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
components:
  schemas:
    TaskCreateRequest:
      type: object
      properties:
        content_text:
          type: string
          minLength: 1
          description: Plain text content of the task (required).
        task_type:
          type: string
          enum:
            - text
            - linkedin_message
            - linkedin_connection
            - call
            - other
          description: >-
            Task type (required): text, linkedin_message, linkedin_connection,
            call, other.
        due_date:
          type: string
          description: ISO 8601 due date.
        is_completed:
          type: boolean
          default: false
          description: Whether the task is completed. Defaults to false.
        person_id:
          type: string
          format: uuid
          description: Person UUID to associate with this task.
        deal_id:
          type: string
          format: uuid
          description: Deal UUID to associate with this task.
        client_id:
          type: string
          format: uuid
          description: Client (organization_companies) UUID to associate with this task.
        job_id:
          type: string
          format: uuid
          description: Job UUID to associate with this task.
        owner_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Team member UUIDs to assign as task owners. Get IDs from GET
            /v1/team-members.
      required:
        - content_text
        - task_type
    TaskCreateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/Task'
      required:
        - success
        - data
    Task:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Task UUID.
        content_text:
          type:
            - string
            - 'null'
          description: Plain text content of the task.
        task_type:
          type: string
          description: 'Task type: text, linkedin_message, linkedin_connection, call, other.'
        due_date:
          type:
            - string
            - 'null'
          description: ISO 8601 due date.
        is_completed:
          type: boolean
          description: Whether the task is completed.
        person_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related person UUID.
        deal_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related deal UUID.
        client_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related client (organization_companies) UUID.
        job_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related job UUID.
        created_at:
          type: string
          description: ISO 8601 creation timestamp.
        updated_at:
          type: string
          description: ISO 8601 last-updated timestamp.
        owners:
          type: array
          items:
            $ref: '#/components/schemas/TaskOwner'
          description: Team members assigned to this task.
      required:
        - id
        - content_text
        - task_type
        - due_date
        - is_completed
        - person_id
        - deal_id
        - client_id
        - job_id
        - created_at
        - updated_at
        - owners
    TaskOwner:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Team member UUID.
        first_name:
          type:
            - string
            - 'null'
          description: First name.
        last_name:
          type:
            - string
            - 'null'
          description: Last name.
      required:
        - id
        - first_name
        - last_name
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate with a Bearer token: API key, OAuth token, or session
        token.

````