create_upload_session
Open a chunked upload for a large file. Cost class: fast.
Same auth as upload_file — an X-API-Key or a short-lived X-Upload-Token grant — but redeemed exactly once, here. Every later request against the session (parts, status, complete, abort) presents the session_token this returns instead, in the same X-Upload-Token header.
Upload every part with PUT .../upload-sessions/{session_id}/parts/{n} at exactly chunk_size bytes (the final part may be shorter), then call POST .../complete. GET the session at any point to see which parts have already landed, e.g. after a dropped connection.
Args: session: Database session. body: Destination path, declared total size, and conflict policy — the same fields upload_file takes, minus the bytes. upload_auth: The resolved workspace context, plus the upload grant when the caller redeemed one instead of sending an API key. idempotency_key: Replaying with the same key returns the original session rather than opening a second one.
Returns: A :class:CreateUploadSessionResponse with the session token.
Raises: PlatformError: file_too_large when total_size_bytes exceeds the effective byte cap. PlatformError: access_denied when a path-pinned grant is used to create a session at a different path. PlatformError: unauthorized when a single-use grant is replayed.
Request
- Base URLhttps://ndi-api.nace.ai (the document declares no server; this is the origin it was published from)
- Auth
- API key in header X-API-Key
- or API key in header X-Upload-Token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Workspace identifier.
Headers
Replaying a request with the same key returns the original job with 200, never a second job. The key is kept with the job for replay and never cleared, so it must not contain personal data.
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.