/v1/asset-bucketsReturns the workspace's buckets, newest first. Deleted buckets are not included, but
buckets that are still provisioning, deleting or failed are.
Without query parameters, every bucket is returned in data. Send page or page_size to
paginate. A top-level pagination object is then added next to data, and q filters the
results. q is ignored unless page or page_size is present.
Requires read access to the workspace (any role).
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Query parameters
pageintegerPage number, starting at 1. Values below 1 (or non-numbers) are treated as 1. Sending this enables pagination.
min 1
page_sizeintegerItems per page. Defaults to 10. Values above 100 are capped at 100. Sending this enables pagination.
Default 10min 1 · max 100
qstringCase-insensitive substring search across the bucket's name, slug, storage bucket name, status and visibility. Only applied when paginating.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The workspace's buckets. pagination is only present when page or page_size was sent.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataarray of objectsShow item attributesHide item attributes
uidstringRequiredUnique identifier of the bucket.
namestringRequiredDisplay name of the bucket.
slugstringRequiredURL-safe version of the name. Unique within the workspace.
statusstringRequiredLifecycle state. Uploads, access keys and CORS changes need ready.
One ofprovisioningreadyfaileddeletingdeleted
visibilitystringRequiredpublic objects are served from their public URL. private objects need a signed read URL.
One ofpublicprivate
public_base_urlstringRequiredBase URL recorded for the bucket on the public assets host. Use each object's public_url or read_url to fetch objects, rather than building URLs from this value.
s3_bucket_namestringRequiredName of the underlying S3 bucket. Use it as the bucket name with S3 clients.
key_prefixstringKey prefix under which uploads made through the API are stored. Omitted when it cannot be derived.
storage_used_bytesintegerTotal size of the bucket's ready objects, in bytes. Omitted when zero.
free_storage_bytesintegerYour account's free file storage allowance in bytes. Omitted on some responses (for example after updating allowed origins or deleting).
max_image_size_bytesintegerMaximum size of a single upload, in bytes. Despite the name it applies to every file type. Omitted on some responses.
created_atstring (date-time)RequiredWhen the bucket was created.
last_failurestringWhy the last create or delete failed. Omitted when there was no failure.
cors_originsarray of stringsRequiredBrowser origins allowed to make cross-origin requests. The console's own origin is always allowed and is not listed. Set with Set bucket allowed origins.
paginationobjectPaging details. Only present when page or page_size was sent.
Show attributesHide attributes
pageintegerRequiredCurrent page number.
page_sizeintegerRequiredItems per page.
totalintegerRequiredTotal number of matching items.
total_pagesintegerRequiredTotal number of pages.
Errors
| Status | Meaning |
|---|---|
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
Errors use the standard error format.