Perception
Start a chunked upload
Send each call below straight to the document service, with X-Upload-Token: <session_token>:
Send each call below straight to the document service, with X-Upload-Token: <session_token>:
PUT {upload_session_url}/parts/{n}for each part, numbered from 0.POST {upload_session_url}/complete?wait_seconds=60with anIdempotency-Key. It assembles the file in the background and answers202while it runs.- Repeat step 2 with the same key until it answers
200withresult.file(workspace_id,file_id).
GET {upload_session_url} shows progress, and DELETE {upload_session_url} aborts.
Other errors (500, 502, 503, 504, 529) are on Errors.
Authorization
bearerAuth Your API key, sent as Authorization: Bearer nace_sk_...
- Where: the dashboard's API Keys page. It is shown once, when you create it.
- Format:
nace_sk_followed by 43 URL-safe characters (A-Z,a-z,0-9,_and-). - Limit: an account can hold at most 3 active keys.
- Wrong or missing key: returns
401 authentication_error.
In: header
Header Parameters
Scoped to your account. Retry with the same key to get the same session.
length <= 200Request Body
application/json
Optional. A workspace from the Workspaces API that this key may use; the file goes into that workspace. Leave it out to upload a file for your document jobs (parse, extract, classify, split, ground).
1 <= value1 <= value <= 5400Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/documents/upload-sessions" \ -H "Content-Type: application/json" \ -d '{ "path": "media/interview.mp4", "total_size_bytes": 73400320 }'{ "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", "session_id": "string", "session_token": "string", "chunk_size": 0, "total_parts": 0, "expires_at": "2019-08-24T14:15:22Z", "upload_session_url": "http://example.com"}Create an upload grant POST
A short-lived token for uploading one file straight to the document service, into the workspace workspace_id names, or, without one, for your document jobs.
Delete an uploaded file DELETE
Deletes a file you uploaded from your account's workspace: every version of it, and everything derived from it (parse outputs, search-index entries).