---
title: "Get a task by ID"
method: GET
path: "/api/tasks/{taskId}"
tags: ["Tasks"]
---

# Get a task by ID

`GET /api/tasks/{taskId}`

## Request

- Base URL: `https://core-api.getaptly.com`
- URL: `https://core-api.getaptly.com/api/tasks/{taskId}`
- Auth: one of:
  - API key in header `x-token`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/getaptly/apis/aptly-api/docs/api/tasks/:taskId/get.ts> (a function with typed inputs; its response is checked against the schema)

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`.

## Path parameters

- `taskId` string, required

## Query parameters

- `includeMetadata` boolean

## Response `200`

The task.

- Task
  - `_id` string
  - `companyId` string
  - `title` string
  - `mergedTitle` string: Title with `{{ }}` merge tags resolved against the task's representative contact, the company, and the acting user.
  - `description` string
  - `mergedDescription` string: Description with `{{ }}` merge tags resolved (HTML output).
  - `userId` string: Assigned user id.
  - `checked` boolean
  - `archived` boolean
  - `status` string
  - `priority` string
  - `dueAt` string, date-time
  - `aptletInstanceId` string
  - `aptletUuid` string
  - `attachments` object[]
    - `_id` string
    - `name` string
    - `type` string
  - `priorityLabel` string: Present only when includeMetadata=true.
  - `statusLabel` string: Present only when includeMetadata=true.
  - `assignee` object: Present only when includeMetadata=true.
    - `_id` string
    - `fullName` string

## Other responses

- `401`: Invalid or missing credential.
- `404`: Task not found.

---

[API](https://skmtc.dev/getaptly/apis/aptly-api.md) - [All operations](https://skmtc.dev/getaptly/apis/aptly-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getaptly/apis/aptly-api/revisions/75c367e0b8e5?raw)
