Presigned R2 GET plan by content hash (one round-trip)
POST
/v1/datasets/download/presign-by-hash
const url = 'https://example.com/v1/datasets/download/presign-by-hash';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","content_hash":"example","path":"","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/download/presign-by-hash \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "content_hash": "example", "path": "", "ttl_seconds": 300 }'Resolve a file by its BLAKE3 content hash within the caller’s own
dataset and return the presigned GET plan in ONE round-trip (the git
smudge fast path — no tree listing, no separate presign call). Read-only:
never creates an alias row. {found: false} on miss.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ” x-api-key
string | null
Request Body required
Section titled “Request Body required ” Media type application/json
PresignByHashBody
object
name
required
string
content_hash
required
string
path
string
ttl_seconds
integer
Responses
Section titled “ Responses ”Successful Response
Media type application/json
Example generated
exampleValidation 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": {} } ]}