Temporarily stage a document for this application user
POST
/t1/document/uploads
const url = 'https://api.tansr.com/t1/document/uploads';const options = { method: 'POST', headers: {'x-tansr-app-token': '<x-tansr-app-token>', 'Content-Type': 'application/json'}, body: '{"fileName":"example","mime":"application/pdf","dataBase64":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Temporary scoped reference, never file content
Media typeapplication/json
object
uploadRef
required
string
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
本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。