---
title: "Create a task"
method: POST
path: "/api/tasks"
tags: ["Tasks"]
---

# Create a task

`POST /api/tasks`

## Request

- Base URL: `https://core-api.getaptly.com`
- URL: `https://core-api.getaptly.com/api/tasks`
- 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/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a task. When `aptletInstanceId` is set, the task is also mirrored as a
checklist entry on that card.

The task is attributed to an acting user who must belong to the company. With a
delegate token the user is taken from the token. With an API key (no associated
user), supply `userId` in the body — it must belong to the company or the
request is rejected.

## Request body

- object
  - `userId` string: Acting user the task is attributed to (createdBy/updatedBy). Required with API-key auth (must belong to the company); ignored with a delegate token, which supplies the user itself.
  - `title` string, required
  - `assigneeId` string, required: User id the task is assigned to.
  - `dueAt` string, date-time, required
  - `type` string, required: Follow-up type — one of email|comment|sms|voice|card|note|task|logActivity.
  - `note` string: Task description.
  - `status` string: One of backlog|notStarted|inProgress|onHold|completed.
  - `priority` string: One of asap|high|medium|low.
  - `logType` string: Required when type is "logActivity".
  - `aptletInstanceId` string: Card id — when set the task is mirrored onto the card checklist, and its `aptletUuid` is taken from the card (a supplied one is ignored). 404 if the card doesn't exist.
  - `aptletUuid` string: Board UUID. Taken from the card instead when `aptletInstanceId` is set.
  - `channelId` string
  - `streamId` string
  - `fieldId` string: Checklist array field on the card (defaults to "checklist").
  - `attachmentIds` string[]
  - `references` object[]

## Response `200`

Task created.

- object
  - `taskId` string

## Other responses

- `400`: Missing or invalid field.
- `401`: Invalid or missing credential.

---

[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)
