Skip to content

Files

Upload files to posts, tasks, comments, docs, chat, and canvases, then list, read, and delete them. The endpoints live under /media in the URL.

Native session clients can subscribe to mobile:files with organizationId, optional projectId and fileType filters, cursor and limit. It returns the web Files page's flat, combined-source library as items and nextCursor. Each item includes typed Media, size, source, project and creation time. Media uses absolute proxy URLs with requiresAuth and cacheKey. List limits default to 25 and allow up to 50.

Session tokens accept GET /api/v1/media and GET /api/v1/media/:id with media:read. Send Authorization: Bearer with X-Project-Feed-Workspace. Viewers can read accessible files. Access to the containing post, comment, or task is still checked. Session tokens can also upload your own avatar, and viewers need only profile:write for it. Workspace owners and admins can upload the workspace logo from a session.

Endpoints

Every path starts with /api/v1/media. Uploading also needs the write scope of the destination, such as docs:write for a doc. See Upload destinations.

Upload a file

  1. 1.

    Prepare the upload

    Send the destination, file name, and exact size to POST /api/v1/media/uploads. The response has an uploadToken, an expiresAt time, and a transfer object that says how to send the bytes.

  2. 2.

    Transfer the bytes

    Send the file to the URL in transfer, using the method for its type. Send your API credentials only to Project Feed, never to a transfer URL.

  3. 3.

    Complete the upload

    Send the uploadToken to POST /api/v1/media/uploads/complete, with parts for put and multipart transfers. The response describes the new attachment.

HTTP
POST /api/v1/media/uploads
Authorization: Bearer pf_YOUR_API_KEY
Content-Type: application/json

{"destination":{"type":"post","id":"pst_abc123"},"fileName":"diagram.png","fileSize":245760}

# transfer.type is form, so send the file field to transfer.url
curl --fail-with-body -F "file=@diagram.png" "$UPLOAD_URL"

POST /api/v1/media/uploads/complete
Authorization: Bearer pf_YOUR_API_KEY
Content-Type: application/json

{"uploadToken":"TOKEN_FROM_PREPARE"}

Transfer URLs stop working at expiresAt, so start the transfer before then. The upload token stays valid for six hours after you prepare. It is bound to the user, workspace, file, and destination that prepared it. Prepare is not idempotent: each call returns a new token.

Complete is safe to retry with the same token. After a dropped connection, send the same request again, or call the status endpoint to see whether the file is attached. A completed upload returns the same attachment every time. Video completion can return a status of processing until playback is ready. A doc can return pending while the doc update is saved, then attached.

The workspace storage limit, file validation, and IP allowlist apply as they do in the app. The prepare request body is limited to 64 KB. Prepare and the JSON upload together allow 50 requests per hour per API key, on top of the normal REST rate limit.

Transfer types

The transfer.type in the prepare response depends on the file.

TypeUsed forHow to sendSize limit
formImages up to 10 MiB, except SVG and storeOriginal uploads. Video up to 200 MB when transfers leaves out tus.Send a multipart form with the file in a field named file to url. Do not send parts when you complete.10 MiB for images, 200 MB for video
tusVideo, unless transfers leaves out tusResumable upload over TUS 1.0. A HEAD request returns Upload-Offset. Send each PATCH from that offset with Content-Type: application/offset+octet-stream and Tus-Resumable: 1.0.0. Do not send parts when you complete.1 GiB
putFiles up to 50 MiB that do not use form or tusPUT the file body to url with the returned headers. Read the ETag response header and complete with parts: [{ partNumber: 1, etag }].50 MiB
multipartFiles over 50 MiB that do not use tusPUT each consecutive byte range to its part url with the returned headers. Every part has a size (25 MiB, except a shorter last part). Complete with every partNumber and ETag.1 GiB

The size limit is 1 GiB for every type except these. Standalone USD and USDA models are limited to 64 MiB, embedded glTF to 16 MB, and Lottie JSON uploaded with mediaType lottie to 10 MB. See supported file formats for what each format previews as.

Upload destinations

The destination decides where the file goes and what the request needs. A key needs media:write for every destination, plus the scope in the table. Your workspace role and access to the destination are checked again when you complete.

Destinationid isScopesWho can upload
postPost IDmedia:writeThe post author
newPostProject IDmedia:writeAnyone who can post in the project. For a post you have not created yet; see below.
commentPost comment IDmedia:writeThe comment author
taskTask IDmedia:writeAnyone who can edit the task. Viewers cannot upload.
taskCommentTask comment IDmedia:writeThe comment author
newTaskCommentTask IDmedia:writeAnyone who can edit the task. For a comment you have not created yet; see below.
chatMessageChat message IDmedia:write and chat:writeThe message author, with write access to the room
newChatMessageChat room IDmedia:write and chat:writeAnyone with write access to the room. For a message you have not sent yet; see below.
canvasCanvas IDmedia:write and canvas:writeAnyone who can edit the canvas. Archived canvases return 409.
docDoc IDmedia:write and docs:writeAnyone who can edit the doc

Posts, comments, tasks, task comments, and chat messages hold up to 10 files each. A canvas upload creates a media item. Its x, y, width, and height default to 0, 0, 400, and 300, and frameId places it in a frame. A doc upload inserts a media block after afterBlockId, or at the end when you leave it out. Read the doc content to find block IDs. If the block has been removed, prepare a new upload with a current block.

A post upload adds the file to the post's current version. To add it to a new version instead, skip complete and send the uploadToken and parts in uploads to POST /api/v1/posts/:id/versions.

To create a post with its files, prepare each upload with destination newPost and the project ID. Skip complete and send the uploadToken and parts in uploads to POST /api/v1/posts. The post appears with every file already attached.

A task upload adds the file to the task. To attach a file to a comment you are about to create, prepare it with destination newTaskComment and the task ID. It does not count toward the task's own files. Skip complete and send the uploadToken and parts in uploads to POST /api/v1/tasks/:id/comments.

To send a message with its files, prepare each upload with destination newChatMessage and the room ID. Skip complete and send the uploadToken and parts in uploads to POST /api/v1/chat/rooms/:roomId/threads/:threadId/messages or POST /api/v1/chat/rooms/:roomId/threads. The message appears with every file already attached.

Image settings accept PNG, JPEG, GIF, and WebP, and the image is public, as it is in the app.

Destinationid isScopesWho can change itSize limit
avatarYour user IDmedia:write and profile:writeOnly your own avatar5 MiB, 2 MiB for GIF
workspaceLogoWorkspace IDmedia:writeOwners and admins5 MiB
portalLogoClient portal IDmedia:writeOwners and admins5 MiB
projectHeaderProject IDmedia:write and projects:writeAnyone who can change the project's settings10 MiB
projectIconProject IDmedia:write and projects:writeAnyone who can change the project's settings10 MiB
customReactionWorkspace ID, plus namemedia:write and reactions:writeOwners and admins256 KiB

A custom reaction name is 2 to 32 letters, numbers, or underscores and must not already exist.

The CLI runs these steps for you:

Shell
pf media upload diagram.png --doc doc_abc123 --after-block BLOCK_ID
pf media upload review.mp4 --post pst_abc123 --resume-state ./upload.json
pf media upload model.glb --task tsk_abc123
pf media upload reference.png --canvas cnv_abc123 --x 200 --y 100
pf media upload logo.png --workspace-logo ws_abc123
pf media upload celebrate.gif --custom-reaction ws_abc123 --name celebrate
pf media cancel-upload --upload-token "$UPLOAD_TOKEN"

Upload in one JSON request

POST /api/v1/media sends the file as base64 in fileData. It attaches to a post, post comment, task, or task comment, and needs exactly one parent ID. It is meant for small files: the file is limited to 50 MiB, and a request body over about 70 MB returns 413. It rejects raster images and videos, which use the prepare flow, and it returns 403 in workspaces with file encryption on.

The file must match its declared MIME type for audio, PDF, SVG, Rive, and 3D model types. Other types are stored as they arrive and served as downloads, never rendered in the browser. The same upload rules apply: the post or comment author, or a task editor, can upload, and each item holds up to 10 files.

File types

Every file has one fileType. The same values are used by the fileType filter and by POST /api/v1/media/direct.

fileTypeHoldsAccepted by
imageRaster images and SVGPrepare. JSON upload for SVG only.
videoVideoPrepare
audioAudioPrepare, JSON upload
documentPDFPrepare, JSON upload
model3D modelsPrepare, JSON upload
animationRive animationsPrepare, JSON upload
lottieLottie JSONPrepare with mediaType lottie. JSON upload when the content validates as Lottie.
spriteSprite sheetsInstalled tools only (POST /api/v1/media/direct)
fileEverything else, such as text, code, data, Office documents, and archivesPrepare, JSON upload

List and read files

List, get, and delete cover files on posts, comments, tasks, and task comments. Files added to chat messages, canvases, and docs, and image settings, are not returned. Reads follow the parent's visibility. Listing files for a post, comment, or task comment you cannot see returns an empty page. A task filter for a task that does not exist returns 404, and one you cannot access returns 403. An unrecognized cursor starts again from the first page.

The list returns items and hasMore. nextCursor is null on the last page. Treat the cursor as an opaque string. See pagination.

Each file has id, fileName, originalFileName, fileType, fileSize, mimeType, url, thumbnailUrl, width, height, duration, order, posterUrl and srcset for video posters and responsive images, downloadUrl, isProcessing, hasError, conversionStatus (processing, ready, error, or null), conversionError, and createdAt in milliseconds. Files on posts also have postId, projectId, and authorId. width, height, and duration are left out when they do not apply. url links to the file. Links can expire, so read the file again for a fresh one instead of storing it. A single file also has an author with id, name, email, and image.

The parent fields depend on the target. List items for non-post targets use target and parentId. A single file has these.

TargetParent ID fieldsExtra fields
postpostIdpost with id and title. No target or parent field.
commentcommentId, postIdparent: { kind, id, postId }
tasktaskIdparent: { kind, id, title }
taskCommenttaskCommentId, taskIdparent: { kind, id, taskId }

Delete a file

Who can delete depends on the target. For a post file, the post author or a workspace owner or admin. For a comment file, the comment author or an owner or admin. For a task file, the person who uploaded it or an owner or admin, and never a viewer. For a task comment file, the uploader, the comment author, or an owner or admin. The response is { "success": true }.

A file under a retention policy returns 409. Storage for a deleted file is cleaned up after a 7-day grace period.

Errors

Errors use the format on the errors page. These are the statuses specific to files.

StatusWhen
400The request body, file name, or ID is invalid. The upload token is invalid or expired (prepare again). The uploaded bytes do not match the declared type. A base64 body is malformed or empty.
403The key is missing media:write or the destination's scope. You cannot edit the destination. The workspace storage limit is reached or the workspace IP allowlist blocks the request. The workspace has file encryption on and you used POST /api/v1/media.
404The destination or the file does not exist, or you cannot see it.
409A custom reaction with that name exists. The canvas is archived or the frame is locked. The doc block you pointed at is gone. A file under a retention policy cannot be deleted.
413The file or request body is over its limit, or the destination already has 10 files.
429The upload rate limit or the normal REST rate limit was hit. Wait for the Retry-After header.
503The upload service is temporarily unavailable. Retry after the number of seconds in Retry-After.

Installed tools

POST /api/v1/media/direct is the last step of the upload flow that installed tools use. It receives no file bytes. It attaches a file that earlier steps already uploaded and confirmed, so it needs values those steps return. For new scripts, use the prepare flow instead.

FieldReturned by
reservationIdThe reserve step: /api/upload/request, /api/upload/images-request, or /api/upload/stream-request.
mediaBlobId and dedupConfirmationKeyThe confirm step: /api/upload/confirm, /api/upload/images-confirm, or /api/upload/stream-confirm. They are returned only when the file was registered with its contentHash. Send both or neither.
r2Key, cfImageId, or cfStreamVideoIdThe confirm step for the matching file, image, or video.

Send each value back unchanged. The request must identify exactly one uploaded file. Only the post author can attach, and a post holds up to 10 files. Sending the same uploaded file to the same post again returns the existing attachment ID. The request body is limited to 64 KB and returns 413 above it. Invalid metadata returns 400, a post you did not write returns 403, and a post in another workspace returns 404. The response is 201 with { "id": "att_abc123" }.

Next steps

Image preview
100%