Presigned R2 PUTs for N xorbs
POST
/v1/datasets/upload/prepare-batch
const url = 'https://example.com/v1/datasets/upload/prepare-batch';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"blobs":[{"blob_id":"example","envelope_sha256":"example","content_length":1,"resume_staging_id":"example"}],"ttl_seconds":300}'};
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://example.com/v1/datasets/upload/prepare-batch \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "blobs": [ { "blob_id": "example", "envelope_sha256": "example", "content_length": 1, "resume_staging_id": "example" } ], "ttl_seconds": 300 }'Content-addressed batch presign — one round-trip for a whole file’s xorbs (collapses the per-xorb presign cost that otherwise dominates dedup uploads).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
PrepareUploadBatchBody
object
blobs
required
Array<object>
PrepareUploadObjectBodyobject
blob_id
required
string
envelope_sha256
required
string
content_length
required
integer
resume_staging_id
string | null
ttl_seconds
integer
Responses
Section titled “ Responses ”Successful Response
Media type application/json
Example generated
exampleInvalid or missing API key
Media type application/json
ErrorResponse
Standard error response.
object
detail
required
Error message describing what went wrong
string
Example generated
{ "detail": "example"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Array<object>
ValidationErrorobject
loc
required
Location
Array<string | integer>
msg
required
Message
string
type
required
Error Type
string
input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}