curl --request POST \
--url https://ndi-api.nace.ai/v1/workspaces/{workspace_id}/upload-sessions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"path": "<string>",
"total_size_bytes": 123
}
'{
"chunk_size": 123,
"expires_at": "2023-11-07T05:31:56Z",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_token": "<string>",
"total_parts": 123
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}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.
curl --request POST \
--url https://ndi-api.nace.ai/v1/workspaces/{workspace_id}/upload-sessions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"path": "<string>",
"total_size_bytes": 123
}
'{
"chunk_size": 123,
"expires_at": "2023-11-07T05:31:56Z",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_token": "<string>",
"total_parts": 123
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}Headers
Use the same key to recover an earlier request. A replay returned as a Job carries Idempotent-Replayed: true and replayed: true without a new charge; Job credits keeps the original cost. Re-serving a settled inline tool answer reports zero credits for that call and also carries Idempotent-Replayed: true; a fresh re-execution after a transient failure carries no header. The key is kept with the job for replay and never cleared, so it must not contain personal data.
200Body
Body for POST /workspaces/{workspace_id}/upload-sessions.
Same destination/conflict/labelling contract as UploadFileRequest —
this is the chunked entry point to the exact same ledger write, for a
file large enough (or a link flaky enough) that one unretried multipart
POST is the wrong shape. total_size_bytes is required and checked
byte-for-byte at complete: nothing here is trusted on faith.
'reject' raises path_conflict at complete-time when a different file (other bytes, labels or graph_inclusion) already occupies this path; an identical re-upload returns the existing file with deduplicated=true. 'new_version' increments the version and stamps replaced_at on the previous one.
reject, new_version Response
Successful Response
A newly created upload session, ready to accept parts.
session_token is sent as X-Upload-Token on every subsequent
request against this session (parts, status, complete, abort) — the
upload grant or API key used to create the session is not sent again.