Skip to main content
documents.createUpload stages bytes for a granular operation. The handle is single-use: bytes are deleted when the job that reads them finishes. Default TTL is 24 hours; the cap is 7 days. For a durable corpus, use workspaces.

Method signature

FileContent is a path string, URL, Uint8Array, ArrayBuffer, Blob, File, or a { name?, read() } stream.

Parameters

Returns

UploadResponse: upload_id, file_name, size_bytes, content_hash, expires_at. Pass the object itself as source to a document operation.

Options

Errors

  • file_too_large (413) — over the upload size cap
  • upload_expired (409) — handle expired or already consumed
  • unsupported_file_type — usually raised by the next operation, not upload
See Upload guide and Sources.