Reserve a file upload

View as Markdown

Reserves quota for a new file and returns a content-PUT URL plus the reservation TTL. Validates the MIME, size, and (for per-task uploads) the run/task field constraints before reserving. The body carries filename, mimeType, sizeBytes, and optional tags, folderId, runId, taskId, fieldKey.

Authentication

AuthorizationBearer

WorkOS session JWT or an organization API key, sent as Authorization: Bearer <token>.

Path parameters

projectIdstringRequired

Request

This endpoint expects an object.
filenamestringRequired
The original file name.
mimeTypestringRequired
The file's MIME type.
sizeBytesintegerRequired<=9007199254740991
The exact byte size of the upload.
tagslist of stringsOptional
Tag labels to apply to the confirmed file.
folderIdstring or nullOptional

Target folder id (null/absent = the Inbox).

runIdstringOptional

For a run-level or per-task upload, the run id.

taskIdstringOptional

For a per-task upload, the task id.

fieldKeystringOptional

For a per-task upload, the file-upload field key.

Response

The reservation with a content-PUT URL.

fileIdstring
uploadUrlstring
expiresIndouble
confirmBystring

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
415
Unsupported Media Type Error
500
Internal Server Error