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

# Get a task by ID

> Fetches a single task with related card/board context and resolved attachment
metadata. When `includeMetadata=true`, also returns display labels
(`priorityLabel`, `statusLabel`) and the resolved `assignee`.




## OpenAPI

````yaml /openapi.yaml get /api/tasks/{taskId}
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/tasks/{taskId}:
    get:
      tags:
        - Tasks
      summary: Get a task by ID
      description: >
        Fetches a single task with related card/board context and resolved
        attachment

        metadata. When `includeMetadata=true`, also returns display labels

        (`priorityLabel`, `statusLabel`) and the resolved `assignee`.
      operationId: getTask
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
        - name: includeMetadata
          in: query
          required: false
          schema:
            type: boolean
          description: Include display labels and the resolved assignee.
      responses:
        '200':
          description: The task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '401':
          description: Invalid or missing credential.
        '404':
          description: Task not found.
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
components:
  schemas:
    Task:
      type: object
      properties:
        _id:
          type: string
        companyId:
          type: string
        title:
          type: string
        mergedTitle:
          type: string
          description: >-
            Title with `{{ }}` merge tags resolved against the task's
            representative contact, the company, and the acting user.
        description:
          type: string
        mergedDescription:
          type: string
          description: Description with `{{ }}` merge tags resolved (HTML output).
        userId:
          type: string
          description: Assigned user id.
        checked:
          type: boolean
        archived:
          type: boolean
        status:
          type: string
        priority:
          type: string
        dueAt:
          type: string
          format: date-time
        aptletInstanceId:
          type: string
        aptletUuid:
          type: string
        attachments:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              type:
                type: string
        priorityLabel:
          type: string
          description: Present only when includeMetadata=true.
        statusLabel:
          type: string
          description: Present only when includeMetadata=true.
        assignee:
          type: object
          description: Present only when includeMetadata=true.
          properties:
            _id:
              type: string
            fullName:
              type: string
      additionalProperties: true
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'

````