Add a file or link attachment to a task
curl --request POST \ --url https://example.com/api/v1/tasks/example/attachments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "commentId": "example", "kind": "link", "title": "example", "url": "https://example.com" }'Registers an already-uploaded file (kind omitted or "file": the url from POST /uploads/file or POST /uploads/url (after the PUT), an s3: key, a /uploads/ path or an absolute http(s) URL) or an external link (kind: "link" with url and an optional title) on the task. A storage key (of either kind) must belong to this workspace, or the request is a 400. An optional commentId places it on a comment of the same task; a comment of another task is a 404. Requires the tasks.manage permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Resource identifier (CUID2).
Resource identifier (CUID2).
Request Body
Section titled “Request Body”object
Comment of the same task the attachment arrived on. A comment of another task is a 404.
Display title. Omitted, the page title from the link’s embed metadata is used, else its host and path.
Absolute http(s) URL of the linked resource.
object
Comment of the same task the attachment arrived on. A comment of another task is a 404.
File size in bytes.
The url returned by POST /uploads/file or POST /uploads/url (/api/v1/files/...), an s3: key, a /uploads/ path, or an absolute http(s) URL. A storage key must belong to this workspace.
Defaults to “file” when omitted.
Responses
Section titled “Responses”The created attachment.
object
A file or link attached to a task.
object
The comment of this task the attachment arrived on, when it did.
File name, or the title of a link.
File size in bytes; 0 for a link.
Stored file reference (/api/v1/files/..., s3:, /uploads/), or the linked URL.
“file” for an uploaded file, “link” for an external URL (Loom, Figma, Drive…).
“text/uri-list” for a link.
WorkspaceMember id of the uploader.
Example
{ "data": { "kind": "file" }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Not found.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC