Skip to navigation

Register a file in a space and get a presigned upload URL

View as Markdown

Reserves a file metadata record in the space and returns { id, uploadUrl, uploadExpiresAt, file }. uploadUrl is a secure PUT URL valid for 15 minutes (see uploadExpiresAt, ISO 8601). Two-step upload: PUT the raw file bytes to uploadUrl with a Content-Type request header EXACTLY equal to the mimeType you sent at create (a mismatch rejects the PUT), then poll getFile until status reaches a terminal value — stored (uploaded, no processing requested), processed (processing succeeded), or failed (see processingError); waiting/processing mean keep polling. Request body: fileName (required), mimeType (required, drives both the record and the required PUT Content-Type), size (bytes, optional), optional processingKind — one of doc-simple | doc-ocr | doc-auto | audio-transcribe | audio-transcribe-and-diarize — selecting how the stored file is post-processed; indexVectors and indexOntology (both default true) are opt-out booleans for semantic and ontology indexing — both are FORCED false for a desk (me:<userId>) space, whose files are never indexed. parentType/parentId in the body are ignored: the API forces the parent to this :spaceId. Authorization: requires space:contribute on :spaceId (missing permission → 403; org admins bypass). An invalid body returns 422.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

spaceIdstringRequired

Request

parentType / parentId are ignored: the parent is forced server-side from the route.

fileNamestringRequired>=1 character
mimeTypestringRequired>=1 character

Drives both the record and the required upload Content-Type.

sizeintegerOptional0-9007199254740991
Size in bytes.
processingKindenumOptional

How the stored file is post-processed. Omit for automatic selection by mime.

Allowed values:
indexVectorsbooleanOptionalDefaults to true
Semantic indexing.
indexOntologybooleanOptionalDefaults to true

Knowledge-graph indexing.

Response

File record created, with its presigned upload URL.
idstring
uploadUrlstring

Presigned upload URL, valid 15 minutes. PUT the raw bytes there with a Content-Type header EXACTLY equal to the mimeType sent at create.

uploadExpiresAtdatetime
fileobject