Skip to content

Presigned R2 PUT for one xorb

Deprecated
POST
/v1/datasets/upload/prepare-object
curl --request POST \
--url https://example.com/v1/datasets/upload/prepare-object \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "blob_id": "example", "envelope_sha256": "example", "content_length": 1, "ttl_seconds": 300 }'

Deprecated: only SDKs before 0.6.9 call this, and it is removed at the date in its Sunset header. Use POST /v1/datasets/upload/prepare-batch, which presigns every xorb of a file in one call, as the current SDK does.

Content-addressed presigned PUT URL. The customer PUTs the xorb bytes straight to R2 with this URL — bytes never touch the gateway.

Media type application/json
PrepareUploadBody
object
blob_id
required
string
/^[0-9a-f]{64}$/
envelope_sha256
required
string
/^[0-9a-f]{64}$/
content_length
required
integer
>= 1
ttl_seconds
integer
default: 300 >= 60 <= 3600

Successful Response

Media type application/json
Example generated
example

Invalid 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>
ValidationError
object
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": {}
}
]
}