Routes
HTTP endpoints for uploads and files.
Uploads
POST /uploads— create an upload session.GET /uploads/:uploadId— read upload status.PUT /uploads/:uploadId/content— send the upload's content. It publishes the file, or prepares it when the upload'spublicationModeisbatch.GET /uploads/:uploadId/content— read a prepared upload's content before its batch commits.POST /uploads/:uploadId/abort— abort an upload.
Notes:
POST /uploadsis idempotent only when a checksum is provided; if metadata matches, the existing upload is returned to support resume.replaceActiveUpload: trueaborts unfinished uploads of the same file key instead of failing withUPLOAD_ALREADY_ACTIVE.
Files
POST /files— upload and publish a file in one multipart request, optionally with aprecondition.POST /files/commit-prepared— atomically publish prepared uploads, delete files, and assert file revisions.POST /files/apply-edits— apply text edits to files atomically.GET /files— list files with cursor pagination and an optionalprefixfilter.POST /files/snapshots— read many files' metadata and revisions at once.POST /files/searchandPOST /files/search/hydrate— search the text index.GET /files/by-key?key=<fileKey>— fetch file metadata.PATCH /files/by-key?key=<fileKey>— update file metadata.DELETE /files/by-key?key=<fileKey>— delete a file and its content (idempotent).GET /files/by-key/content?key=<fileKey>— download a file's content.
Error codes
UPLOAD_NOT_FOUNDUPLOAD_ALREADY_ACTIVEUPLOAD_EXPIREDUPLOAD_INVALID_STATEFILE_NOT_FOUNDFILE_DELETEDFILE_PRECONDITION_FAILEDFILE_TOO_LARGEINVALID_FILE_KEYINVALID_CHECKSUMINVALID_REQUEST