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's publicationMode is batch.
  • GET /uploads/:uploadId/content — read a prepared upload's content before its batch commits.
  • POST /uploads/:uploadId/abort — abort an upload.

Notes:

  • POST /uploads is idempotent only when a checksum is provided; if metadata matches, the existing upload is returned to support resume.
  • replaceActiveUpload: true aborts unfinished uploads of the same file key instead of failing with UPLOAD_ALREADY_ACTIVE.

Files

  • POST /files — upload and publish a file in one multipart request, optionally with a precondition.
  • 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 optional prefix filter.
  • POST /files/snapshots — read many files' metadata and revisions at once.
  • POST /files/search and POST /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_FOUND
  • UPLOAD_ALREADY_ACTIVE
  • UPLOAD_EXPIRED
  • UPLOAD_INVALID_STATE
  • FILE_NOT_FOUND
  • FILE_DELETED
  • FILE_PRECONDITION_FAILED
  • FILE_TOO_LARGE
  • INVALID_FILE_KEY
  • INVALID_CHECKSUM
  • INVALID_REQUEST