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

# Create a candidate to-do

> Creates a new candidate to-do. Assigns a to-do to the candidate. A to-do of type `VISIT_URL` carries the link the candidate must open and requires `url`; a to-do of type `UPLOAD_ATTACHMENT` asks the candidate for a document and requires `attachmentType`. Documents themselves are not exchanged through this API.



## OpenAPI

````yaml /api-reference/openapi.json post /candidates/{id}/todos
openapi: 3.1.0
info:
  title: Spott API Reference
  version: '0.1'
servers:
  - url: https://api.gospott.com
security: []
tags: []
paths:
  /candidates/{id}/todos:
    post:
      tags:
        - Candidates
      summary: Create a candidate to-do
      description: >-
        Creates a new candidate to-do. Assigns a to-do to the candidate. A to-do
        of type `VISIT_URL` carries the link the candidate must open and
        requires `url`; a to-do of type `UPLOAD_ATTACHMENT` asks the candidate
        for a document and requires `attachmentType`. Documents themselves are
        not exchanged through this API.
      operationId: createCandidateTodo
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCandidateTodoDto'
      responses:
        '201':
          description: The to-do was created. Returns its id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRecordResponseDto'
        '400':
          description: >-
            Bad request - the payload does not match the to-do `type`: a to-do
            of type `VISIT_URL` requires `url` and does not accept
            `attachmentType`, a to-do of type `UPLOAD_ATTACHMENT` requires
            `attachmentType` and does not accept `url`. Also returned when the
            requested custom `attachmentType` does not exist or cannot be
            requested from a candidate.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '401':
          description: Unauthorized - invalid or missing authentication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '403':
          description: The feature is not enabled for your organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionBaseDto'
        '404':
          description: >-
            Candidate not found, or `applicationId` does not point to an
            application of this candidate
          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:
    CreateCandidateTodoDto:
      oneOf:
        - $ref: '#/components/schemas/CreateVisitUrlCandidateTodoDto'
        - $ref: '#/components/schemas/CreateUploadAttachmentCandidateTodoDto'
      id: PrivateCreateCandidateTodoDto
    CreateRecordResponseDto:
      type: object
      properties:
        id:
          type: string
          minLength: 1
      required:
        - id
      id: CreateRecordResponseDto
    ExceptionBaseDto:
      type: object
      properties:
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        message:
          type: string
        requestId:
          type: string
      required:
        - status
        - message
        - requestId
      id: ExceptionBaseDto
    CreateVisitUrlCandidateTodoDto:
      type: object
      properties:
        message:
          anyOf:
            - $ref: '#/components/schemas/CreateCandidateTodoMessageDto'
            - type: 'null'
          description: Subject and body describing the to-do.
        dueDate:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
          description: >-
            ISO 8601 timestamp by which the candidate should have completed the
            to-do.
        applicationId:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Id of the application this to-do relates to. Must be an application
            of the same candidate.
        type:
          type: string
          enum:
            - VISIT_URL
          description: Points the candidate to a link.
        url:
          type: string
          maxLength: 2048
          format: uri
          description: Link the candidate must open.
      required:
        - message
        - dueDate
        - applicationId
        - type
        - url
      additionalProperties: false
      id: PrivateCreateVisitUrlCandidateTodoDto
    CreateUploadAttachmentCandidateTodoDto:
      type: object
      properties:
        message:
          anyOf:
            - $ref: '#/components/schemas/CreateCandidateTodoMessageDto'
            - type: 'null'
          description: Subject and body describing the to-do.
        dueDate:
          anyOf:
            - $ref: '#/components/schemas/DateISO'
            - type: 'null'
          description: >-
            ISO 8601 timestamp by which the candidate should have completed the
            to-do.
        applicationId:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Id of the application this to-do relates to. Must be an application
            of the same candidate.
        type:
          type: string
          enum:
            - UPLOAD_ATTACHMENT
          description: Asks the candidate for a document.
        attachmentType:
          $ref: '#/components/schemas/CandidateTodoAttachmentTypeInputDto'
          description: >-
            Kind of document expected from the candidate, a predefined
            attachment type (`{ "variant": "system", "name": "CV" }`) or a
            custom, tenant-defined attachment type (`{ "variant": "custom",
            "id": "..." }`).
      required:
        - message
        - dueDate
        - applicationId
        - type
        - attachmentType
      additionalProperties: false
      id: PrivateCreateUploadAttachmentCandidateTodoDto
    CreateCandidateTodoMessageDto:
      type: object
      properties:
        subject:
          anyOf:
            - type: string
              minLength: 1
              maxLength: 255
            - type: 'null'
          description: Short title of the to-do, shown to the candidate.
        body:
          anyOf:
            - type: string
              minLength: 1
              maxLength: 20000
            - type: 'null'
          description: Longer explanation of what the candidate has to do.
      required:
        - subject
        - body
      id: PrivateCreateCandidateTodoMessageDto
    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])))$
    CandidateTodoAttachmentTypeInputDto:
      oneOf:
        - $ref: '#/components/schemas/CandidateTodoCustomAttachmentTypeInputDto'
        - $ref: '#/components/schemas/CandidateTodoSystemAttachmentTypeDto'
      description: >-
        The kind of document requested from the candidate, either a predefined
        attachment type (`{ variant: "system", name }`) or a custom,
        tenant-defined attachment type (`{ variant: "custom", id }`).
      id: PrivateCandidateTodoAttachmentTypeInputDto
    CandidateTodoCustomAttachmentTypeInputDto:
      type: object
      properties:
        variant:
          type: string
          enum:
            - custom
        id:
          type: string
          minLength: 1
          description: >-
            Id of a custom, tenant-defined attachment type. It must be available
            for the CANDIDATE record type; list the available types on `GET
            /attachments/types`.
      required:
        - variant
        - id
      id: PrivateCandidateTodoCustomAttachmentTypeInputDto
    CandidateTodoSystemAttachmentTypeDto:
      type: object
      properties:
        variant:
          type: string
          enum:
            - system
        name:
          type: string
          enum:
            - UNASSIGNED
            - CV
            - COVER_LETTER
            - PERSONALITY_TEST
            - QUESTIONNAIRE
            - TRANSCRIPT
          description: Predefined attachment type the candidate must supply.
      required:
        - variant
        - name
      id: PrivateCandidateTodoSystemAttachmentTypeDto
  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.

````