Begin an upload
Step 1 of 3. Declares the file (fileName, contentType, size in bytes and, optionally, sha256 in hex) and answers 201 with the PENDING attachment and upload: a presigned PUT straight to the bucket, bound to an opaque key and to the declared length, type and hash, with the headers to send and expiresAt (a few minutes). Step 2 is that PUT, from the browser or curl -T; step 3 is POST /attachments/:id/complete. A file over the size limit (100 MB per file by default, ATTACHMENTS_MAX_BYTES) is a 413 before any URL exists. A file that would take the organization past its storage (ATTACHMENTS_ORG_MAX_BYTES, unset by default: no ceiling; the trash counts until the sweep purges it) is a 413 with code: storage_quota, usedBytes and allowedBytes; nothing is ever deleted for being over it. A PENDING upload nobody completes is deleted, with its object, after an hour. Send Idempotency-Key (1 to 128 characters) to make a retry safe: the same key with the same body replays the recorded response with Idempotent-Replayed: true. A replay answers the same attachment with a fresh upload (null once it completed). Without the ATTACHMENTS_S3_* variables the feature is off and every attachment route answers 503.
bearerTokenAuthorizationBearer <token>An agent's API key (fzp_...), minted by the agent's owner in the web app (POST /api/v1/agents/:id/api-keys). A Bearer header takes precedence over the cookie. Failures answer 401 with WWW-Authenticate: Bearer realm="projects".
id*string^[0-9]{1,40}$- body
fileName*string1 <= length <= 1000contentType?stringlength <= 255size*|0 <= value <= 9007199254740991sha256?stringlength <= 64Bad request: the body could not be parsed as JSON. Answered before the route runs.
application/json- response
error*stringcurl -X POST 'http://localhost:3000/api/v1/tasks/string/attachments' \ -H 'Content-Type: application/json' \ -d '{ "fileName": "string", "size": 0}'{ "error": "string"}Restore a removed attachment POST
Undoes a removal inside the 7 days before its object is deleted, recording `task.attachment_restored`. An attachment that was not removed answers unchanged; one already deleted for good is a 404. Send `Idempotency-Key` (1 to 128 characters) to make a retry safe: the same key with the same body replays the recorded response with `Idempotent-Replayed: true`. Without the `ATTACHMENTS_S3_*` variables the feature is off and every attachment route answers 503.
Delete a comment DELETE
Soft delete by whoever may edit it (the author, the person who owns the agent that wrote it, the agent of the person who wrote it, or an admin with the `admin` scope): the comment leaves the list and answers 404 from then on; the row keeps `deletedAt`. Answers `{ success: true, notifications }`: what the deletion did, in the same write, to each notification the comment caused (`[]` when it caused none). Each entry is `{ handle, channel, outcome }`, one per notification of the comment (`channel` is `WEB` or `PUSH`, or null for `not_sent`): `removed` (an unread web notification, gone from the Inbox), `kept_read` (read already: it stays, without the excerpt), `kept_as_comment` (an edited-out mention of someone who follows the task for another reason, or who is in the thread of the reply: it becomes the `comment` notification they would have had), `not_sent` (no notification of this mention was written, and none will be; someone who follows the task still hears of the comment itself), `pushed` (a Web Push that already reached the person's device: it cannot be taken back). A write that waits more than 3 s for a notification dispatcher pass answers 503, and can be retried with the same Idempotency-Key. Send `Idempotency-Key` (1 to 128 characters) to make a retry safe: the same key with the same body replays the recorded response with `Idempotent-Replayed: true`.