5 minutes to help shape OpenTodo. Anonymous, no account. Take the survey

Attachments API

Attachments are files or links on a task or one of its comments.

Implementation notes

Attachments (OpenSpec attachments) are files or links on a task or one of its comments. Their metadata is an entity in the operation log (attachment, fields in docs/sync.md); the bytes are files moved with these routes. Every route answers 404 not_found for an attachment or task you cannot read. Uploads need a session or a full token (read tokens get 403) and are limited to 120 per hour per account (429 rate_limited).

PATCH /api/v1/attachments/{id}

Update a attachment · Token or session

{"name": "…"}: rename (author only)

Path parameters
FieldTypeDescription
id requiredstringpath
Request body
FieldTypeDescription
namestring | null
Response 200
FieldTypeDescription
uploadedboolean

DELETE /api/v1/attachments/{id}

Delete a attachment · Token or session

Remove (author, project admin or owner); 204

Path parameters
FieldTypeDescription
id requiredstringpath

Response 204: No content

GET /api/v1/attachments/{id}/content

Get attachment content · Token or session

The file, with ranges and If-None-Match. ?download=1 forces a download

Path parameters
FieldTypeDescription
id requiredstringpath

Response 200: OK

PUT /api/v1/attachments/{id}/content

Update attachment content · Token or session

The raw bytes of an attachment you created (from a device that queued it offline); 204. The bytes must match the attachment's size and sha256

Path parameters
FieldTypeDescription
id requiredstringpath

Response 200: OK

GET /api/v1/notes/{id}/attachments

List note attachments · Token or session

The same for a standalone note: its attachments carry note_id instead of task_id (no comment_id). A note's copy (moved to another project, or turned into a task) names the original's stored file in file_id and serves its bytes

Path parameters
FieldTypeDescription
id requiredstringpath
Response 200
FieldTypeDescription
attachments requiredarray of object

POST /api/v1/notes/{id}/attachments

Create a note attachment · Token or session

The same for a standalone note: its attachments carry note_id instead of task_id (no comment_id). A note's copy (moved to another project, or turned into a task) names the original's stored file in file_id and serves its bytes

Path parameters
FieldTypeDescription
id requiredstringpath
Request body
FieldTypeDescription
name requiredstring
url requiredstring
Response 200
FieldTypeDescription
uploadedboolean
Response 201
FieldTypeDescription
uploadedboolean

GET /api/v1/settings/attachments

List settings attachments · Token or session

{enabled, max_file_mb, quota_mb}; changing them is for the owner (max_file_mb 1–2048, quota_mb 0 = unlimited). Changes are audited as settings.changed

Response 200
FieldTypeDescription
enabled requiredboolean
max_file_mb requirednumber
quota_mb requirednumber

PUT /api/v1/settings/attachments

Update settings attachments · Token or session

{enabled, max_file_mb, quota_mb}; changing them is for the owner (max_file_mb 1–2048, quota_mb 0 = unlimited). Changes are audited as settings.changed

Only the server's owner.

Request body
FieldTypeDescription
enabled requiredboolean
max_file_mb requirednumber
quota_mb requirednumber
Response 200
FieldTypeDescription
enabled requiredboolean
max_file_mb requirednumber
quota_mb requirednumber

GET /api/v1/tasks/{id}/attachments

List task attachments · Token or session

The task's attachments that are not removed, oldest first, each with uploaded

Path parameters
FieldTypeDescription
id requiredstringpath
Response 200
FieldTypeDescription
attachments requiredarray of object

POST /api/v1/tasks/{id}/attachments

Create a task attachment · Token or session

Multipart file (and optional comment_id): stores the file and creates the attachment in one request. JSON {"url": "https://…", "name"?: "…"}: a link attachment. 201 with the attachment. Honours Idempotency-Key (a retry answers 200 with Idempotent-Replayed: true)

Path parameters
FieldTypeDescription
id requiredstringpath
Request body
FieldTypeDescription
name requiredstring
url requiredstring
Response 200
FieldTypeDescription
uploadedboolean
Response 201
FieldTypeDescription
uploadedboolean

This group in the HTTP API guide