---
title: "Create a task document"
method: POST
path: "/tasks/{taskId}/documents"
tags: ["Tasks"]
---

# Create a task document

`POST /tasks/{taskId}/documents`

## Request

- Base URL: `https://api.smokeball.com`
- URL: `https://api.smokeball.com/tasks/{taskId}/documents`
- Auth: API key in header `x-api-key` and API key in header `Authorization`

Links the specified document to the specified task.

## Path parameters

- `taskId` string, uuid, required

## Request body

- TaskDocumentDto: Data transfer object for a task document.
  - `documentId` string, nullable: Unique identifier of the document (file or memo). If a file, the type must be 0 (File). If a memo, the type must be 2 (Memo). The FormTemplate (1) document type is not currently supported for task document creation.
  - `type` 0 | 1 | 2, required: Available document types: "File = 0", "FormTemplate = 1", "Memo = 2" The FormTemplate (1) document type is not currently supported for task document creation.

## Response `202`

When request is accepted. Returns a hypermedia 'Link' object of the link to be created.

- Link
  - `id` string, nullable
  - `href` string, nullable
  - `relation` string, nullable
  - `method` string, nullable

## Other responses

- `403`: When task with specified id is not associated with authenticated client.
- `404`: When task with specified task id and/or document id does not exist.

---

[API](https://skmtc.dev/smokeball/apis/smokeball-api.md) - [All operations](https://skmtc.dev/smokeball/apis/smokeball-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smokeball/apis/smokeball-api/revisions/6e350cf667d4?raw)
