Skip to main content
POST
create_upload_session

Authorizations

X-API-Key
string
header
required

Headers

Idempotency-Key
string | null

Replaying a request with the same key returns the original job with 200, never a second job.

Maximum string length: 200

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier.

Body

application/json

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.

path
string
required

Destination path inside the workspace. Relative — must not start with '/'.

Required string length: 1 - 1024
Pattern: ^[^/]
total_size_bytes
integer
required

Exact total size of the file, across every part.

graph_inclusion
enum<string>
default:auto

Whether this file joins the knowledge-graph corpus. 'auto' follows the workspace's KG exclusion rules; 'include'/'exclude' override them for this file.

Available options:
auto,
include,
exclude
labels
Labels · object

Caller-supplied metadata, stored verbatim.

on_conflict
enum<string>
default:reject

'reject' raises path_conflict at complete-time when a file already exists at this path. 'new_version' increments the version and stamps replaced_at on the previous one.

Available options:
reject,
new_version
ttl_seconds
integer
default:5400

How long the session accepts parts before it expires unfinished.

Required range: 1 <= x <= 5400

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.

chunk_size
integer
required

Upload every part at exactly this size, except a shorter final part.

expires_at
string<date-time>
required

When the session stops accepting parts.

session_id
string<uuid>
required
session_token
string
required

Send in the X-Upload-Token header of every subsequent request.

total_parts
integer
required

ceil(total_size_bytes / chunk_size) — the parts complete() expects.