Skip to content
DocsFiles and uploads

REST API

Files and uploads

Attach files to tasks and read them back: one-shot uploads up to 8 MiB, resumable multipart uploads up to 100 MiB, previews, downloads and signed links.

Updated View as Markdown

On this page

Tasks hold files: screenshots, videos, PDFs, documents, archives. Through the API you can attach them, list them, download them and give people short-lived links to them. Every file is served only to people who can see its task.

You want toUseScopeRole
Attach a file up to 8 MiB in one requestOne-shot uploadfiles:writeeditor
Attach a larger file, or resume after a broken connectionMultipart uploadfiles:writeeditor
Add your own preview imagePreviewsfiles:writeeditor, and the person who uploaded
List files, get one, download itDownloadsfiles:readviewer
Delete a fileDELETE /attachments/{attachmentId}files:writeeditor

AI agents connected over MCP use attach_file (files up to 1 MiB) and read_attachment instead; see MCP tools.

Accepted files

#

Files can be up to 100 MiB (104,857,600 bytes), of these 19 types. Send the type as the file's Content-Type (one-shot) or type (multipart).

KindTypes
imageimage/jpeg, image/png, image/webp, image/gif, image/avif
videovideo/mp4, video/webm, video/quicktime
fileimage/heic, image/heif, application/pdf, text/plain, text/markdown, text/csv, application/json, application/zip, Word (application/vnd.openxmlformats-officedocument.wordprocessingml.document), Excel (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet), PowerPoint (application/vnd.openxmlformats-officedocument.presentationml.presentation)

Types are compared as media types: in any case, and with parameters dropped (text/markdown; charset=utf-8 is text/markdown), and stored in that form. Another type gets 415 unsupported_file_type, with the accepted list in accepted. Taskloader also checks the file's first bytes: a file that is not what its type says (a program renamed .pdf, say) gets 422 file_type_mismatch, and nothing is kept. Text files (text/plain, text/markdown, text/csv, application/json) must be UTF-8, or UTF-16 with a byte-order mark as Windows writes "Unicode" text; a text file with NUL bytes (UTF-16 without its mark, UTF-32, or a program renamed .txt) gets 422 file_type_mismatch.

Note Files you upload through the API are stored exactly as sent. Photos keep their metadata, which can include where they were taken. Remove it before uploading if it should not be shared with the project.

One-shot uploads

#

For files up to 8 MiB, send the bytes as the request body:

HTTP
POST /tasks/{taskId}/attachments?name=launch-plan.pdf
Content-Type: application/pdf

Name the file with ?name=, or with Content-Disposition: attachment; filename*=UTF-8''launch%20plan.pdf for names with any characters (a plain filename= sent as UTF-8 keeps its accents too; filename* wins when both are there). Send one of the two: both at once answer 400 invalid_request, and neither answers 400 validation_failed at /name.

A name is 1 to 255 characters, counted as Unicode code points (an emoji is one), with something visible in it. A longer, blank or invisible name answers 400 validation_failed at /name and is never shortened, whether it comes from ?name=, Content-Disposition, start_upload or attach_file. Taskloader keeps the name as sent, except that /, \, tabs, line breaks and other control characters become _, zero-width spaces, byte-order marks and text-direction characters (such as U+202E) are removed, and spaces at either end are trimmed, so a name always shows its real extension. This applies to one-shot and multipart uploads alike: reports/2026/q3.txt is kept as reports_2026_q3.txt. An attachment's name is always the name kept, so look files up by that.

A file over 8 MiB answers 413 file_too_large with limitBytes: 8388608: use a multipart upload. An upload in progress counts toward your 12 unfinished uploads.

Storage quotas and transfers at once

#

Files count toward two storage quotas from the moment their upload starts until they are deleted: the files you uploaded, across every project (10 GiB), and the files in an organization's projects, whoever uploaded them (50 GiB). An unfinished upload counts with its declared size, and an image or video counts 1 MiB more, for its preview, from the start. A file that would go past either answers 413 storage_quota_exceeded with limitBytes before anything is stored: delete files, or cancel unfinished uploads, then try again. Sending or replacing a preview never needs more room than its file claimed.

Taskloader also bounds how many of your file transfers run at once: 8 downloads (files and previews), and 4 parts or one-shot files and 2 previews being sent. Downloads through a signed link count apart from yours: 4 at once through each link, whoever holds it, and 8 through all the links you made together. One more download waits a few seconds for one of yours to finish; one more upload body is refused before it is read. Either way the answer is 429 too_many_transfers with Retry-After: wait, then send it again. When the server as a whole has many downloads open, one more waits its turn too (the person with the fewest open goes first), and a download through a link, or of someone with several open, once it has run a few seconds, may be cut short for someone with fewer (no person's more often than every 10 seconds): ask for the rest with a Range (the file's ETag never changes). After the wait it may get 503 storage_unavailable with Retry-After; that takes hundreds of downloads held open at once. A download that is not read for a minute, or is still open long after its size would take at 64 KiB/s, is ended; ask again with a Range for the rest.

curl "https://taskloader.com/api/v1/tasks/$TASK_ID/attachments?name=launch-plan.pdf" \
  -H "Authorization: Bearer $TASKLOADER_API_KEY" \
  -H "Content-Type: application/pdf" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Digest: sha-256=:$(openssl dgst -sha256 -binary launch-plan.pdf | base64):" \
  --data-binary @launch-plan.pdf

The answer is 201 Created with the attachment:

HTTP
HTTP/1.1 201 Created
Content-Type: application/json
Location: /api/v1/attachments/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718

{
  "object": "attachment",
  "id": "att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "taskId": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "projectId": "prj_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "name": "launch-plan.pdf",
  "size": 482133,
  "mimeType": "application/pdf",
  "kind": "file",
  "status": "ready",
  "width": null,
  "height": null,
  "durationSeconds": null,
  "preview": {
    "status": "none"
  },
  "createdBy": {
    "userId": "usr_kq3Xb1W9pZ0aLm7c",
    "name": "Maya Chen"
  },
  "createdAt": "2026-11-18T10:00:00.123Z",
  "contentUrl": "https://taskloader.com/api/v1/attachments/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/content",
  "downloadUrl": "https://taskloader.com/api/v1/attachments/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/content?exp=1794996600&cred=key_0b6f1d2a8c9e4f00a1b2c3d4e5f60718&sig=Xq3…",
  "previewUrl": null,
  "urlsExpireAt": "2026-11-18T10:10:00.000Z"
}

The file appears on the task at once, and the task's history says who attached it and through what.

Multipart uploads

#

For files over 8 MiB, or whenever you want to resume after a broken connection, upload in parts:

  1. Start with the file's name, size and type: POST /tasks/{taskId}/uploads. The answer lists the parts to send, each with its exact size and an uploadUrl.
  2. Send each part with PUT to its uploadUrl. Parts can go in any order and in parallel; sending a part again replaces it.
  3. Complete with POST /uploads/{uploadId}/complete. The answer is the attachment.

The answer to the first step:

HTTP
HTTP/1.1 201 Created
Content-Type: application/json
Location: /api/v1/uploads/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718

{
  "object": "upload",
  "id": "att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "taskId": "task_0b6f1d2a8c9e4f00a1b2c3d4e5f60718",
  "name": "product-demo.mp4",
  "size": 20971520,
  "mimeType": "video/mp4",
  "partSize": 8388608,
  "partCount": 3,
  "parts": [
    {
      "partNumber": 1,
      "size": 8388608,
      "uploadUrl": "/api/v1/uploads/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/parts/1"
    },
    {
      "partNumber": 2,
      "size": 8388608,
      "uploadUrl": "/api/v1/uploads/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/parts/2"
    },
    {
      "partNumber": 3,
      "size": 4194304,
      "uploadUrl": "/api/v1/uploads/att_0b6f1d2a8c9e4f00a1b2c3d4e5f60718/parts/3"
    }
  ],
  "receivedParts": [],
  "status": "uploading",
  "expiresAt": "2026-11-18T11:00:00.123Z"
}

Part n is the bytes from (n − 1) × partSize to n × partSize of the file, and must be exactly as many bytes as its size says (only the last part is smaller); a part of another length answers 400 part_length_mismatch with expectedBytes. Use the numbers in the answer rather than assuming a part size (today 8 MiB). A file over 100 MiB answers 413 file_too_large, and a size of 0 400 validation_failed.

Treat uploadUrl as opaque, and resolve it against https://taskloader.com: today it is a path such as /api/v1/uploads/att_…/parts/2, but it may become a full address, possibly on another host. Parts sent to https://taskloader.com take your Authorization header, like any other request. Send that header only to https://taskloader.com addresses.

# Start: name, size in bytes and type.
curl https://taskloader.com/api/v1/tasks/$TASK_ID/uploads \
  -H "Authorization: Bearer $TASKLOADER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d "{\"name\":\"product-demo.mp4\",\"size\":$(wc -c < product-demo.mp4),\"type\":\"video/mp4\"}" \
  | tee upload.json

# Send every part, cut at the partSize the answer gives, then complete.
UPLOAD_ID=$(jq -r .id upload.json)
PART_SIZE=$(jq -r .partSize upload.json)
for N in $(jq -r '.parts[].partNumber' upload.json); do
  dd if=product-demo.mp4 of=part.bin bs="$PART_SIZE" skip=$((N - 1)) count=1 2>/dev/null
  URL=$(jq -r --argjson n "$N" '.parts[] | select(.partNumber == $n) | .uploadUrl' upload.json)
  case "$URL" in /*) URL="https://taskloader.com$URL" ;; esac # A path: resolve it.
  AUTH=() # Your key goes only to taskloader.com.
  case "$URL" in https://taskloader.com/*) AUTH=(-H "Authorization: Bearer $TASKLOADER_API_KEY") ;; esac
  curl -sf -X PUT "$URL" "${AUTH[@]}" \
    -H "Content-Type: application/octet-stream" \
    -H "Content-Digest: sha-256=:$(openssl dgst -sha256 -binary part.bin | base64):" \
    --data-binary @part.bin > /dev/null || { echo "Part $N failed; send it again." >&2; break; }
done

curl -X POST https://taskloader.com/api/v1/uploads/$UPLOAD_ID/complete \
  -H "Authorization: Bearer $TASKLOADER_API_KEY"

Resuming

#

An upload stays open while its parts keep arriving: it is canceled when no part arrives for an hour, and 24 hours after it started at the latest. expiresAt says when, and each part moves it on. Once it is canceled, every request about it answers 404, and the file needs a new upload. If your program stops halfway, come back within the hour, ask which parts arrived and send only the rest:

Shell
curl https://taskloader.com/api/v1/uploads/$UPLOAD_ID \
  -H "Authorization: Bearer $TASKLOADER_API_KEY" | jq '{receivedParts, partCount}'

GET /uploads/{uploadId} returns the same upload, with receivedParts read from storage. Completing before every part arrived answers 409 upload_incomplete with missingParts and receivedParts: send the missing parts, then complete again. (missingParts can be empty when storage refused to join parts that were being sent again at that moment: complete again.) Completing twice, even at the same moment, is safe: the file is attached once, and both get the same attachment.

To give up, cancel with DELETE /uploads/{uploadId}. Unfinished uploads are canceled automatically an hour after their last part arrived (or after they started, before the first part), and 24 hours after they started at the latest. A canceled upload no longer counts toward your 12 unfinished uploads.

Once an upload is complete, the attachment has the same id. GET /uploads/{uploadId}, a part and a cancel then answer 404 with a detail that says so: read it with GET /attachments/{attachmentId}, or delete the attachment instead. If storage has already joined the parts, a part answers that you should complete the upload. If storage no longer holds an upload, every request about it answers 404: cancel it and start again.

Only the person who started an upload can continue, complete or cancel it, and continuing or completing also needs them to still be able to edit the task. Anyone else gets 404 not_found.

Retrying uploads

#
  • One-shot uploads: send an Idempotency-Key, and with it a Content-Digest: sha-256=:<base64 of the SHA-256 of the body>: header (RFC 9530). The digest is required whenever you send a key with file bytes; without it you get 400 invalid_request. A retry with the same key and the same bytes returns the first answer; the same key with other bytes is refused.
  • Starting a session: send an Idempotency-Key, as with any create.
  • Parts: just send the part again; it replaces the earlier one. A Content-Digest on a part is optional and checked before the part is stored: a mismatch answers 400 digest_mismatch and nothing is kept.
  • Completing: safe to repeat.
  • Canceling: send an Idempotency-Key: a retry with the same key gets the first answer for 24 hours. Without one, a cancel sent again answers the same only until the stored parts are freed, then 404.

Previews

#

An attachment's preview.status says whether it has a preview image: none, queued, running, ready or failed.

  • Images get one automatically: after a JPEG, PNG, WebP, GIF or AVIF upload of up to 25 MiB without a preview of its own, Taskloader renders an upright WebP preview, at most 960 pixels on its long edge, without the photo's metadata. When it is ready, the changes feed sends attachment.preview_ready. An image Taskloader cannot read ends as failed; a storage hiccup may show failed briefly while Taskloader tries again.
  • Videos, HEIC and HEIF images get no automatic preview. If your program can make one (a video's poster frame, say), upload it.

Upload your own preview with PUT /attachments/{attachmentId}/preview: a WebP or JPEG body up to 1 MiB, with its type as Content-Type and width, height and, for videos only, duration (seconds) in the query string, all three optional. You can send it while the upload is still in progress or after it completed. Only the person who uploaded the file can, while they can edit the task. Your preview always wins: it replaces one Taskloader made, and for a finished file the changes feed sends attachment.preview_ready.

Shell
curl -X PUT "https://taskloader.com/api/v1/attachments/$ATTACHMENT_ID/preview?width=960&height=540&duration=42.5" \
  -H "Authorization: Bearer $TASKLOADER_API_KEY" \
  -H "Content-Type: image/webp" \
  --data-binary @poster.webp

A preview over 1 MiB answers 413 payload_too_large. A body that is not WebP or JPEG, a Content-Type that does not match it, a duration for a file that is not a video, or a file that cannot have a preview answers 400 invalid_preview.

Downloads

#
RequestReturns
GET /tasks/{taskId}/attachmentsThe task's files, oldest first
GET /projects/{projectId}/attachmentsEvery file in the project; filter with taskId (a task of this project: another answers 400 validation_failed) and kind
GET /attachments/{attachmentId}One attachment, with fresh signed links
GET /attachments/{attachmentId}/contentThe file's bytes
GET /attachments/{attachmentId}/previewThe preview image (WebP or JPEG); 404 when there is none

GET /attachments/{attachmentId}/content streams the file with Content-Length, an ETag of the form "att_…-<size>" (files never change), Cache-Control: private, no-store, and Content-Disposition: attachment with the file's name. It answers as application/octet-stream, so a browser saves the file instead of opening it. For images and videos, ?disposition=inline answers with the file's own type instead, to show it.

The preview image answers with Cache-Control: private, max-age=3600, or private, no-store when it is fetched through a signed previewUrl.

Downloads support one byte range per request, to resume a download or read part of a file:

Shell
curl https://taskloader.com/api/v1/attachments/$ATTACHMENT_ID/content \
  -H "Authorization: Bearer $TASKLOADER_API_KEY" \
  -H "Range: bytes=0-1048575" \
  -o first-mebibyte.bin

The answer is 206 Partial Content with Content-Range. A range outside the file, bytes=-0, or several ranges at once answer 416 range_not_satisfiable, with Content-Range: bytes */<size> and the file's size in the problem. A range in a unit other than bytes is ignored: you get the whole file.

#

Some things cannot send an Authorization header: an <img> tag, a link a person clicks, an AI client showing a file. For them, each attachment carries signed links:

  • downloadUrl downloads the file, and previewUrl shows its preview (or is null). For images and videos, downloadUrl opens in the browser and may be embedded in another site's page; every other file downloads.
  • They look like …/attachments/att_…/content?exp=<unix time>&cred=<key_… or oag_…>&sig=<signature>, and work without a header until urlsExpireAt, at most 10 minutes after you read the attachment. Read the attachment again for fresh ones; do not store them, and do not take them apart: their form may change.
  • They are bound to you, the credential that asked for them, and the file. They stop working at once when that API key is revoked or expires, when that app is disconnected or loses its tokens (a password reset does that; approving the app again does not bring old links back), or when you lose access to the task (then they answer 404).
  • A link that expired, was changed or belongs to a revoked credential answers 401 invalid_token with reason expired or invalid; a forged link and a revoked one look the same on purpose.

contentUrl is the plain API address of the file, for requests that send your Authorization header. Link previews of bookmarks carry signed cover.url and icon.url the same way. Taskloader never hands out permanent or public links to files.

Errors

#
Status and codeMeaningWhat to do
413 file_too_largeOver 100 MiB, or over 8 MiB for a one-shot upload (limitBytes says which)Use a multipart upload; files over 100 MiB cannot be attached
413 payload_too_largeA preview over 1 MiBSend a smaller preview
400 invalid_previewA preview that is not WebP or JPEG, a Content-Type that does not match it, a duration for a file that is not a video, or a file that cannot have oneSend a WebP or JPEG
400 invalid_request?name= and Content-Disposition both sent, or a key with file bytes but no Content-DigestSend one name; add the digest
415 unsupported_file_typeNot one of the 19 typesSee accepted
422 file_type_mismatchThe bytes are not the declared type (text must be UTF-8, or UTF-16 with a byte-order mark); the upload was canceledCheck the file and its type, then start again
429 too_many_open_uploadsYou have 12 unfinished uploadsComplete or cancel some first
413 storage_quota_exceededThe file would take your files, or the organization's, past the storage quota (limitBytes)Delete files or cancel unfinished uploads first
429 too_many_transfersToo many of your downloads or upload bodies at onceWait Retry-After seconds, then send it again
400 part_out_of_rangeNo such part numberUse 1 to partCount
400 part_length_mismatchThe part is not exactly its expected sizeSend exactly expectedBytes bytes
400 digest_mismatchThe bytes do not match Content-DigestSend the part (or file) again
409 upload_incompleteCompleting before every part arrivedSend missingParts, then complete again
416 range_not_satisfiableThe Range does not fit the fileAsk for a range within its size
503 storage_unavailableFile storage is busy or unavailable right nowWait Retry-After seconds (also in retryAfter), then send the same request again

Uploads also count against your upload limit: parts per hour, per person, shared by all your credentials. The limits page has the numbers.