Perception

Start a chunked upload

Send each call below straight to the document service, with X-Upload-Token: <session_token>:

POST
/v1/documents/upload-sessions

Send each call below straight to the document service, with X-Upload-Token: <session_token>:

  1. PUT {upload_session_url}/parts/{n} for each part, numbered from 0.
  2. POST {upload_session_url}/complete?wait_seconds=60 with an Idempotency-Key. It assembles the file in the background and answers 202 while it runs.
  3. Repeat step 2 with the same key until it answers 200 with result.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
AuthorizationBearer <token>

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

Idempotency-Keystring

Scoped to your account. Retry with the same key to get the same session.

Lengthlength <= 200

Request Body

application/json

workspace_idstring

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).

pathstringrequired
total_size_bytesintegerrequired
Range1 <= value
ttl_secondsinteger
Range1 <= value <= 5400
[key: string]any

Response 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"}