Buckets
Create, list, read, rename, and delete a project’s buckets.
The bucket object
{
"id": "01m3c081d2wj4g63qcr53pa1yh",
"name": "invoices",
"visibility": "public",
"publicUrl": "https://files.digitospace.com/k3m9q2x7v1c8r4t6w0z5/",
"bytesStored": 48213,
"objectCount": 1,
"webhookUrl": "https://example.com/hooks/storage",
"createdAt": "2026-09-26T09:00:00Z",
"updatedAt": "2026-09-26T09:30:00Z"
}idstringThe bucket’s ID. It never changes, even when you rename the bucket.
namestring3 to 63 characters: lowercase letters, digits, and single hyphens, starting and ending with a letter or digit. Unique in the project.
visibilitystringprivate, where only requests allowed in the project can reach the files, orpublic, where anyone with a file’s address can open it.publicUrlstringOnly on public buckets. The start of every file’s public address. See Share files publicly.
bytesStoredintegerThe size of every file in the bucket, in bytes.
objectCountintegerHow many files the bucket holds.
webhookUrlstringOnly when the bucket has a webhook. The address we call when an upload finishes. See Know when an upload finishes.
createdAtstringWhen the bucket was created.
updatedAtstringWhen the bucket, or a file in it, last changed.
List buckets
/v1/projects/{project}/bucketsReturns the project’s buckets by name, a page at a time. Needs Storage buckets: View.
Create a bucket
/v1/projects/{project}/buckets{ "name": "invoices" }Returns 201 with the new bucket. Needs Storage buckets: Create. A name the project already uses gets 409 with bucket_name_taken. A project that already has the most buckets allowed gets 403 with bucket_limit_reached.
Read a bucket
/v1/projects/{project}/buckets/{bucket}Needs Storage buckets: View.
Change a bucket
/v1/projects/{project}/buckets/{bucket}Send a new name, a new visibility, or both:
{ "name": "invoices-2026", "visibility": "private" }Returns the changed bucket. Its files stay where they are. Needs Storage buckets: Edit. Making a bucket public gets 403 with public_buckets_unavailable where public files are not offered.
Delete a bucket
/v1/projects/{project}/buckets/{bucket}Returns 204. Needs Storage buckets: Delete.
- A bucket with files gets
409withbucket_not_empty. - With
?force=true, the bucket and every file in it are deleted. The bucket disappears at once, its files are removed shortly after, and uploads in progress are cancelled. This cannot be undone.
Webhook
/v1/projects/{project}/buckets/{bucket}/webhookReturns the bucket’s webhook, or 404 when it has none. Needs Storage buckets: Edit, because the answer holds the secret.
{ "url": "https://example.com/hooks/storage", "secret": "whsec_…" }/v1/projects/{project}/buckets/{bucket}/webhook{ "url": "https://example.com/hooks/storage" }Adds the webhook, or changes its address and keeps its secret. Returns the webhook. Needs Storage buckets: Edit.
urlstringAn https address on a public network, of at most 2,048 characters.
/v1/projects/{project}/buckets/{bucket}/webhook/secretMakes a new secret, used from the next call on, and returns the webhook. Needs Storage buckets: Edit.
/v1/projects/{project}/buckets/{bucket}/webhookRemoves the webhook. Calls still waiting to be sent are dropped. Returns 204. Needs Storage buckets: Edit.
Presets
/v1/projects/{project}/buckets/{bucket}/presetsLists the bucket’s presets, the four built in ones first. Needs Storage buckets: View.
[
{
"name": "thumb",
"width": 200,
"height": 200,
"fit": "cover",
"quality": 80,
"builtIn": true
}
]/v1/projects/{project}/buckets/{bucket}/presets/{name}{ "width": 640, "height": 360, "fit": "cover", "quality": 75 }Adds or changes a preset, and returns it. Needs Storage buckets: Edit.
namestringIn the path: 1 to 32 lowercase letters, digits, and hyphens, starting with a letter. Not the name of a built in preset.
widthinteger1 to 4,096 pixels.
heightinteger1 to 4,096 pixels. Needed with
cover.fitstringscale-downkeeps the shape and never makes an image larger.containkeeps the shape and fits inside the size.coverfills the size and crops what is outside it.qualityinteger1 to 100.
80when you leave it out.
A bucket can hold 20 presets of its own. One more gets preset_limit_reached.
/v1/projects/{project}/buckets/{bucket}/presets/{name}Deletes one of the bucket’s own presets. Returns 204. Needs Storage buckets: Edit.
Last updated