跳转到内容

Temporarily stage a document for this application user

POST
/t1/document/uploads
curl --request POST \
--url https://api.tansr.com/t1/document/uploads \
--header 'Content-Type: application/json' \
--header 'x-tansr-app-token: <x-tansr-app-token>' \
--data '{ "fileName": "example", "mime": "application/pdf", "dataBase64": "example" }'

Requires document capability. Content is held only in memory on this API instance for at most 10 minutes, with per-scope and instance limits. It is lost on restart. No provider call, quotation or charge is created. Do not automatically repeat an upload after an uncertain response. This endpoint has no durable Idempotency-Key semantics.

Media typeapplication/json
object
fileName
required
string
>= 1 characters <= 200 characters /^[^\\/\u0000-\u001f\u007f]+$/
mime
required
Any of:
string
Allowed value: application/pdf
dataBase64
required
string
>= 4 characters <= 27962028 characters /^[A-Za-z0-9+/]*={0,2}$/

Temporary scoped reference, never file content

Media typeapplication/json
object
uploadRef
required
string
/^document_[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/
expiresAt
required
string format: date-time
Examplegenerated
{
"uploadRef": "example",
"expiresAt": "2026-04-15T12:00:00Z"
}

Invalid file content, encoding, MIME or filename

Document capability not authorized

File or temporary storage limit exceeded