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.
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 to | Use | Scope | Role |
|---|---|---|---|
| Attach a file up to 8 MiB in one request | One-shot upload | files:write | editor |
| Attach a larger file, or resume after a broken connection | Multipart upload | files:write | editor |
| Add your own preview image | Previews | files:write | editor, and the person who uploaded |
| List files, get one, download it | Downloads | files:read | viewer |
| Delete a file | DELETE /attachments/{attachmentId} | files:write | editor |
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).
| Kind | Types |
|---|---|
image | image/jpeg, image/png, image/webp, image/gif, image/avif |
video | video/mp4, video/webm, video/quicktime |
file | image/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:
POST /tasks/{taskId}/attachments?name=launch-plan.pdf
Content-Type: application/pdfName 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.pdfimport { createHash, randomUUID } from 'node:crypto';
import { readFile } from 'node:fs/promises';
const bytes = await readFile('launch-plan.pdf');
const url = new URL(`https://taskloader.com/api/v1/tasks/${taskId}/attachments`);
url.searchParams.set('name', 'launch-plan.pdf');
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}`,
'Content-Type': 'application/pdf',
'Idempotency-Key': randomUUID(),
'Content-Digest': `sha-256=:${createHash('sha256').update(bytes).digest('base64')}:`,
},
body: bytes,
});
const attachment = await response.json();
if (!response.ok) throw new Error(`${attachment.code}: ${attachment.detail}`);import base64, hashlib, os, uuid
import requests
with open("launch-plan.pdf", "rb") as file:
data = file.read()
response = requests.post(
f"https://taskloader.com/api/v1/tasks/{task_id}/attachments",
params={"name": "launch-plan.pdf"},
headers={
"Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}",
"Content-Type": "application/pdf",
"Idempotency-Key": str(uuid.uuid4()),
"Content-Digest": f"sha-256=:{base64.b64encode(hashlib.sha256(data).digest()).decode()}:",
},
data=data,
timeout=120,
)
if not response.ok:
problem = response.json()
raise RuntimeError(f"{problem['code']}: {problem['detail']}")
attachment = response.json()The answer is 201 Created with the attachment:
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:
- Start with the file's name, size and type:
POST /tasks/{taskId}/uploads. The answer lists the parts to send, each with its exactsizeand anuploadUrl. - Send each part with
PUTto itsuploadUrl. Parts can go in any order and in parallel; sending a part again replaces it. - Complete with
POST /uploads/{uploadId}/complete. The answer is the attachment.
The answer to the first step:
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"// upload.mjs: node upload.mjs task_… ./product-demo.mp4 video/mp4 (Node.js 20 or later)
import { createHash, randomUUID } from 'node:crypto';
import { open, stat } from 'node:fs/promises';
import { basename } from 'node:path';
const ORIGIN = 'https://taskloader.com';
const auth = { Authorization: `Bearer ${process.env.TASKLOADER_API_KEY}` };
const [taskId, path, type] = process.argv.slice(2);
async function read(response) {
const body = await response.json();
if (!response.ok) throw new Error(`${response.status} ${body.code}: ${body.detail}`);
return body;
}
const { size } = await stat(path);
const upload = await read(
await fetch(`${ORIGIN}/api/v1/tasks/${taskId}/uploads`, {
method: 'POST',
headers: { ...auth, 'Content-Type': 'application/json', 'Idempotency-Key': randomUUID() },
body: JSON.stringify({ name: basename(path), size, type }),
}),
);
const file = await open(path);
try {
for (const part of upload.parts) {
if (upload.receivedParts.includes(part.partNumber)) continue;
const bytes = Buffer.alloc(part.size);
await file.read(bytes, 0, part.size, (part.partNumber - 1) * upload.partSize);
const url = new URL(part.uploadUrl, ORIGIN);
await read(
await fetch(url, {
method: 'PUT',
headers: {
...(url.origin === ORIGIN ? auth : {}),
'Content-Type': 'application/octet-stream',
'Content-Digest': `sha-256=:${createHash('sha256').update(bytes).digest('base64')}:`,
},
body: bytes,
}),
);
}
} finally {
await file.close();
}
const attachment = await read(
await fetch(`${ORIGIN}/api/v1/uploads/${upload.id}/complete`, { method: 'POST', headers: auth }),
);
console.log(attachment.id, attachment.name, attachment.size);# upload.py: python3 upload.py task_… ./product-demo.mp4 video/mp4
import base64, hashlib, os, sys, uuid
from urllib.parse import urljoin, urlsplit
import requests
ORIGIN = "https://taskloader.com"
session = requests.Session()
auth = {"Authorization": f"Bearer {os.environ['TASKLOADER_API_KEY']}"}
task_id, path, file_type = sys.argv[1:4]
def read(response):
body = response.json()
if not response.ok:
raise RuntimeError(f"{response.status_code} {body['code']}: {body['detail']}")
return body
upload = read(session.post(
f"{ORIGIN}/api/v1/tasks/{task_id}/uploads",
headers={**auth, "Idempotency-Key": str(uuid.uuid4())},
json={"name": os.path.basename(path), "size": os.path.getsize(path), "type": file_type},
timeout=30,
))
with open(path, "rb") as file:
for part in upload["parts"]:
if part["partNumber"] in upload["receivedParts"]:
continue
file.seek((part["partNumber"] - 1) * upload["partSize"])
data = file.read(part["size"])
url = urljoin(ORIGIN, part["uploadUrl"])
same_origin = f"{urlsplit(url).scheme}://{urlsplit(url).netloc}" == ORIGIN
digest = base64.b64encode(hashlib.sha256(data).digest()).decode()
read(session.put(
url,
headers={**(auth if same_origin else {}), "Content-Type": "application/octet-stream",
"Content-Digest": f"sha-256=:{digest}:"},
data=data,
timeout=120,
))
attachment = read(session.post(f"{ORIGIN}/api/v1/uploads/{upload['id']}/complete", headers=auth, timeout=30))
print(attachment["id"], attachment["name"], attachment["size"])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:
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 aContent-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 get400 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-Digeston a part is optional and checked before the part is stored: a mismatch answers400 digest_mismatchand 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, then404.
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 asfailed; a storage hiccup may showfailedbriefly 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.
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.webpA 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
#| Request | Returns |
|---|---|
GET /tasks/{taskId}/attachments | The task's files, oldest first |
GET /projects/{projectId}/attachments | Every 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}/content | The file's bytes |
GET /attachments/{attachmentId}/preview | The 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:
curl https://taskloader.com/api/v1/attachments/$ATTACHMENT_ID/content \
-H "Authorization: Bearer $TASKLOADER_API_KEY" \
-H "Range: bytes=0-1048575" \
-o first-mebibyte.binThe 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.
Signed links
#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:
downloadUrldownloads the file, andpreviewUrlshows its preview (or isnull). For images and videos,downloadUrlopens 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 untilurlsExpireAt, 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_tokenwithreasonexpiredorinvalid; 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 code | Meaning | What to do |
|---|---|---|
413 file_too_large | Over 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_large | A preview over 1 MiB | Send a smaller preview |
400 invalid_preview | A 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 one | Send a WebP or JPEG |
400 invalid_request | ?name= and Content-Disposition both sent, or a key with file bytes but no Content-Digest | Send one name; add the digest |
415 unsupported_file_type | Not one of the 19 types | See accepted |
422 file_type_mismatch | The bytes are not the declared type (text must be UTF-8, or UTF-16 with a byte-order mark); the upload was canceled | Check the file and its type, then start again |
429 too_many_open_uploads | You have 12 unfinished uploads | Complete or cancel some first |
413 storage_quota_exceeded | The file would take your files, or the organization's, past the storage quota (limitBytes) | Delete files or cancel unfinished uploads first |
429 too_many_transfers | Too many of your downloads or upload bodies at once | Wait Retry-After seconds, then send it again |
400 part_out_of_range | No such part number | Use 1 to partCount |
400 part_length_mismatch | The part is not exactly its expected size | Send exactly expectedBytes bytes |
400 digest_mismatch | The bytes do not match Content-Digest | Send the part (or file) again |
409 upload_incomplete | Completing before every part arrived | Send missingParts, then complete again |
416 range_not_satisfiable | The Range does not fit the file | Ask for a range within its size |
503 storage_unavailable | File storage is busy or unavailable right now | Wait 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.