document-operations

create_upload

Stage bytes for document operations and return a handle.

Cost class: fast (upload I/O only; no processing units charged here).

The returned upload_id is passed as {"type": "upload", "upload_id": "<id>"} in any subsequent document-operation request. Uploads are retained until explicit deletion of the upload, consuming jobs or tenant. Zero retention refuses standalone uploads with 422 invalid_request; use a workspace bound to your own S3 or Azure storage.

Uploads are workspace-free: this is the entry point for callers that want to use granular operations without onboarding to the full ingestion model.

Args: caller: Authenticated tenant (resolved from X-API-Key). session: Database session. file: The document bytes.

Returns: An :class:UploadResponse with the opaque handle, file name, byte count, SHA-256 content hash, and expiry timestamp.

Raises: PlatformError: file_too_large when the upload exceeds NDI_MAX_UPLOAD_BYTES; rate_limited when a service key's account or tenant is over its request budget.

post/v1/uploads

Request

Request body multipart/form-data

filestring binary required

The document to stage for a granular operation.

Response

Successful Response

upload_idstring uuid required

Handle to pass as source.upload_id on a later document operation.

file_namestring required

Original filename as received.

size_bytesinteger required

Byte length of the staged file, after upload completes.

content_hashstring required

SHA-256 hex digest of the staged bytes. Confirms the upload is the file you sent, not a workspace file id.

expires_atstring date-time nullable required

Zero retention cleanup deadline; null for ordinary uploads kept until explicit deletion.

Changes

No recorded changes to this operation across all 1 revision of this API.