palbaseDocs

Palbase Storage · API

POST/storage/buckets/{bucket}/signed-urls

Sign a download URL

A URL that reads one object, by anyone holding it, until it expires (at most 7 days). The object must exist. The URL is the project's own address; it opens nothing at another project's.

Called by your server, with the project's secret key.

Path

bucketstring · requiredThe bucket's name: a lowercase letter, then lowercase letters, digits and -, 2 to 63 characters.

Request body

expires_ininteger · requiredSeconds the URL works, 1 to 604800.
pathstring · requiredThe object's path.
curl
curl -X POST "https://<your-ref>.palbase.studio/storage/buckets/<bucket>/signed-urls" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"expires_in":1,"path":"string"}'

Responses

200The URL

400The request is malformed: a field, a path or a parameter is wrong

401No key, or not a key of this project (the edge's answer)

403Not the project's secret key; or, on a credential-less route, a private object or a link that is not valid for it

404No such bucket, object or variant

429The project's request rate, or its storage quota for the period, is used up — or, slowed for its month's traffic, it has as many downloads under way as are paced at once; Retry-After says when to try again

503The platform could not answer now; retrying is safe (Retry-After)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation CreateSignedUrl of storage's contract.