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

# Create task

> Create a new task with optional due date, assignee, and links to entities (candidates, vacancies, clients, etc.).



## OpenAPI

````yaml /openapi-private.json post /tasks/_raw
openapi: 3.1.0
info:
  title: Spott API Reference
  version: '0.1'
servers:
  - url: https://api.gospott.com
security: []
tags: []
paths:
  /tasks/_raw:
    post:
      tags:
        - Tasks
      summary: Create task
      description: >-
        Create a new task with optional due date, assignee, and links to
        entities (candidates, vacancies, clients, etc.).
      operationId: createTaskRaw
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskRawDto'
      responses:
        '201':
          description: Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskDto'
        '400':
          description: Bad request - invalid input
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionBaseDto'
                  - type: object
                    properties:
                      statusCode:
                        type: number
                        example: 400
                      message:
                        type: string
                        example: Invalid task data provided
                      error:
                        type: string
                        example: Bad Request
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '500':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
      security:
        - x-api-key: []
components:
  schemas:
    CreateTaskRawDto:
      type: object
      properties:
        content:
          type: string
          minLength: 1
        dueDate:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
        assignedToUserId:
          anyOf:
            - type: string
            - type: 'null'
        links:
          type: array
          items:
            $ref: '#/components/schemas/CreateTaskRawLinkDto'
      required:
        - content
        - dueDate
        - assignedToUserId
        - links
      id: PrivateCreateTaskRawDto
    TaskDto:
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        dueDate:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
        isCompleted:
          type: boolean
        completedAt:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
        createdAt:
          $ref: '#/components/schemas/DateISO'
        createdBy:
          anyOf:
            - $ref: '#/components/schemas/UserBadgeDto'
            - type: 'null'
          description: >-
            The user who created the task, or null if the task was created by
            the system.
        assignedTo:
          anyOf:
            - $ref: '#/components/schemas/UserBadgeDto'
            - type: 'null'
          description: The user assigned to complete the task, or null if unassigned.
        source:
          type: string
          enum:
            - MANUAL
            - AI_SUGGESTION
            - OUTREACH_SEQUENCE_STEP
            - AUTOMATION
        metadata:
          anyOf:
            - $ref: '#/components/schemas/TaskMetadataDto'
            - type: 'null'
        links:
          $ref: '#/components/schemas/TaskLinksDto'
          description: >-
            All entities linked to this task, grouped by entity type. Links can
            be created explicitly or via @mentions in the task content.
        labels:
          type: array
          items:
            $ref: '#/components/schemas/TaskLabelDto'
      required:
        - id
        - content
        - dueDate
        - isCompleted
        - completedAt
        - createdAt
        - createdBy
        - assignedTo
        - source
        - metadata
        - links
        - labels
      id: PrivateTaskDto
    ExceptionBaseDto:
      type: object
      properties:
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        message:
          type: string
        requestId:
          type: string
      required:
        - status
        - message
        - requestId
      id: ExceptionBaseDto
    DateISO:
      id: DateISO
      format: date-time
      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: string
          format: date
          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])))$
    CreateTaskRawLinkDto:
      type: object
      properties:
        taskLinkId:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
        entityType:
          type: string
          enum:
            - candidate
            - client
            - vacancy
            - clientContact
            - user
            - team
            - opportunity
        entityId:
          type: string
          minLength: 1
      required:
        - taskLinkId
        - entityType
        - entityId
      id: PrivateCreateTaskRawLinkDto
    UserBadgeDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        avatarUrl:
          anyOf:
            - type: string
            - type: 'null'
        deactivatedAt:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
      required:
        - id
        - name
        - avatarUrl
        - deactivatedAt
      id: PrivateUserBadgeDto
    TaskMetadataDto:
      oneOf:
        - $ref: '#/components/schemas/GenericTaskMetadataDto'
        - $ref: '#/components/schemas/PhoneCallTaskMetadataDto'
        - $ref: '#/components/schemas/LinkedInConnectionRequestTaskMetadataDto'
        - $ref: '#/components/schemas/LinkedInMessageTaskMetadataDto'
        - $ref: '#/components/schemas/WhatsAppMessageTaskMetadataDto'
      id: PrivateTaskMetadataDto
    TaskLinksDto:
      type: object
      properties:
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/CandidateLinkDto'
        vacancies:
          type: array
          items:
            $ref: '#/components/schemas/VacancyLinkDto'
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ClientLinkDto'
        users:
          type: array
          items:
            $ref: '#/components/schemas/UserLinkDto'
        teams:
          type: array
          items:
            $ref: '#/components/schemas/TeamLinkDto'
        clientContacts:
          type: array
          items:
            $ref: '#/components/schemas/ClientContactLinkDto'
        opportunities:
          type: array
          items:
            $ref: '#/components/schemas/OpportunityLinkDto'
      required:
        - candidates
        - vacancies
        - clients
        - users
        - teams
        - clientContacts
        - opportunities
      id: PrivateTaskLinksDto
    TaskLabelDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        colorHex:
          type: string
      required:
        - id
        - name
        - colorHex
      id: PrivateTaskLabelDto
    GenericTaskMetadataDto:
      type: object
      properties:
        outreachSequenceId:
          type: string
        outreachSequenceName:
          type: string
        outreachSequenceRunId:
          type: string
        type:
          type: string
          enum:
            - GENERIC_TASK
      required:
        - outreachSequenceId
        - outreachSequenceName
        - outreachSequenceRunId
        - type
      id: PrivateGenericTaskMetadataDto
    PhoneCallTaskMetadataDto:
      type: object
      properties:
        outreachSequenceId:
          type: string
        outreachSequenceName:
          type: string
        outreachSequenceRunId:
          type: string
        type:
          type: string
          enum:
            - PHONE_CALL_TASK
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - outreachSequenceId
        - outreachSequenceName
        - outreachSequenceRunId
        - type
        - phoneNumber
      id: PrivatePhoneCallTaskMetadataDto
    LinkedInConnectionRequestTaskMetadataDto:
      type: object
      properties:
        outreachSequenceId:
          type: string
        outreachSequenceName:
          type: string
        outreachSequenceRunId:
          type: string
        type:
          type: string
          enum:
            - LINKEDIN_CONNECTION_REQUEST_TASK
        linkedInUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - outreachSequenceId
        - outreachSequenceName
        - outreachSequenceRunId
        - type
        - linkedInUrl
      id: PrivateLinkedInConnectionRequestTaskMetadataDto
    LinkedInMessageTaskMetadataDto:
      type: object
      properties:
        outreachSequenceId:
          type: string
        outreachSequenceName:
          type: string
        outreachSequenceRunId:
          type: string
        type:
          type: string
          enum:
            - LINKEDIN_MESSAGE_TASK
        linkedInUrl:
          anyOf:
            - type: string
            - type: 'null'
        messageBody:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - outreachSequenceId
        - outreachSequenceName
        - outreachSequenceRunId
        - type
        - linkedInUrl
        - messageBody
      id: PrivateLinkedInMessageTaskMetadataDto
    WhatsAppMessageTaskMetadataDto:
      type: object
      properties:
        outreachSequenceId:
          type: string
        outreachSequenceName:
          type: string
        outreachSequenceRunId:
          type: string
        type:
          type: string
          enum:
            - WHATSAPP_MESSAGE_TASK
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
        messageBody:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - outreachSequenceId
        - outreachSequenceName
        - outreachSequenceRunId
        - type
        - phoneNumber
        - messageBody
      id: PrivateWhatsAppMessageTaskMetadataDto
    CandidateLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        middleName:
          anyOf:
            - type: string
            - type: 'null'
        secondLastName:
          anyOf:
            - type: string
            - type: 'null'
        avatarUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - taskLinkId
        - isMention
        - id
        - firstName
        - lastName
        - middleName
        - secondLastName
        - avatarUrl
      id: PrivateCandidateLinkDto
    VacancyLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        name:
          type: string
        companyId:
          type: string
        companyName:
          type: string
        companyLogoUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - taskLinkId
        - isMention
        - id
        - name
        - companyId
        - companyName
        - companyLogoUrl
      id: PrivateVacancyLinkDto
    ClientLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        name:
          type: string
        logoUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - taskLinkId
        - isMention
        - id
        - name
        - logoUrl
      id: PrivateClientLinkDto
    UserLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        name:
          type: string
        avatarUrl:
          anyOf:
            - type: string
            - type: 'null'
        deactivatedAt:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
      required:
        - taskLinkId
        - isMention
        - id
        - name
        - avatarUrl
        - deactivatedAt
      id: PrivateUserLinkDto
    TeamLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        name:
          type: string
        avatarUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - taskLinkId
        - isMention
        - id
        - name
        - avatarUrl
      id: PrivateTeamLinkDto
    ClientContactLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        middleName:
          anyOf:
            - type: string
            - type: 'null'
        secondLastName:
          anyOf:
            - type: string
            - type: 'null'
        avatarUrl:
          anyOf:
            - type: string
            - type: 'null'
        candidateId:
          type: string
        companyId:
          type: string
        companyName:
          type: string
        companyLogoUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - taskLinkId
        - isMention
        - id
        - firstName
        - lastName
        - middleName
        - secondLastName
        - avatarUrl
        - candidateId
        - companyId
        - companyName
        - companyLogoUrl
      id: PrivateClientContactLinkDto
    OpportunityLinkDto:
      type: object
      properties:
        taskLinkId:
          type: string
        isMention:
          type: boolean
        id:
          type: string
        name:
          type: string
        company:
          $ref: '#/components/schemas/CompanyBadgeDto'
      required:
        - taskLinkId
        - isMention
        - id
        - name
        - company
      id: PrivateOpportunityLinkDto
    CompanyBadgeDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        logoUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - id
        - name
        - logoUrl
      id: PrivateCompanyBadgeDto
  securitySchemes:
    x-api-key:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for authentication. Get your API key from Settings → API Keys in
        your Spott dashboard.

````