Skip to content

List buckets

GET/v1/asset-buckets

Returns 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

pageinteger

Page number, starting at 1. Values below 1 (or non-numbers) are treated as 1. Sending this enables pagination.

min 1

page_sizeinteger

Items per page. Defaults to 10. Values above 100 are capped at 100. Sending this enables pagination.

Default 10min 1 · max 100

qstring

Case-insensitive substring search across the bucket's name, slug, storage bucket name, status and visibility. Only applied when paginating.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The workspace's buckets. pagination is only present when page or page_size was sent.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataarray of objects
Show item attributes
uidstringRequired

Unique identifier of the bucket.

namestringRequired

Display name of the bucket.

slugstringRequired

URL-safe version of the name. Unique within the workspace.

statusstringRequired

Lifecycle state. Uploads, access keys and CORS changes need ready.

One ofprovisioningreadyfaileddeletingdeleted

visibilitystringRequired

public objects are served from their public URL. private objects need a signed read URL.

One ofpublicprivate

public_base_urlstringRequired

Base 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_namestringRequired

Name of the underlying S3 bucket. Use it as the bucket name with S3 clients.

key_prefixstring

Key prefix under which uploads made through the API are stored. Omitted when it cannot be derived.

storage_used_bytesinteger

Total size of the bucket's ready objects, in bytes. Omitted when zero.

free_storage_bytesinteger

Your account's free file storage allowance in bytes. Omitted on some responses (for example after updating allowed origins or deleting).

max_image_size_bytesinteger

Maximum size of a single upload, in bytes. Despite the name it applies to every file type. Omitted on some responses.

created_atstring (date-time)Required

When the bucket was created.

last_failurestring

Why the last create or delete failed. Omitted when there was no failure.

cors_originsarray of stringsRequired

Browser 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.

paginationobject

Paging details. Only present when page or page_size was sent.

Show attributes
pageintegerRequired

Current page number.

page_sizeintegerRequired

Items per page.

totalintegerRequired

Total number of matching items.

total_pagesintegerRequired

Total number of pages.

Errors

StatusMeaning
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.

Errors use the standard error format.