/v1/asset-buckets/{uid}/corsReplaces the browser origins allowed to make cross-origin (CORS) requests to the bucket,
for example so a web app can upload directly to a presigned URL or fetch objects with
fetch(). The RumptyCloud console's own origin is always allowed and is not listed.
The list you send replaces the current one. Send an empty array to remove all custom origins. The change is saved immediately and pushed to storage. If that push fails, a background sync applies it shortly afterwards.
Rules for each origin:
- Must be
scheme://host[:port]withhttps://orhttp://, for examplehttps://app.example.com. Paths, queries, fragments and credentials are rejected. *allows any site. A leading*.wildcard in the host (for examplehttps://*.example.com) allows subdomains.*is not allowed anywhere else in the host.- At most 255 characters each and at most 20 origins. Blank entries are ignored, and origins are lower-cased and de-duplicated.
The bucket must be ready. Requires the resource write permission (owner, admin or
developer role).
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe bucket's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Request body
originsarray of stringsThe full list of allowed browser origins. Replaces the current list. An empty array or omitted field clears it.
Response
The allowed origins were updated. Returns the bucket with the normalised cors_origins.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide 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.
Errors
| Status | Meaning |
|---|---|
400 | An origin is invalid, or there are more than 20. Possible messages include "<origin>" needs https:// (or http://) at the start, "<origin>" must start with https:// or http://, "<origin>" should be just the scheme, host and port, e.g. https://app.example.com, "<origin>" can only use * at the start of the host, e.g. https://*.example.com, "<origin>" is too long, "<origin>" is not a valid origin, e.g. https://app.example.com, a bucket can have at most 20 allowed origins and invalid request (malformed JSON). |
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. |
404 | The bucket does not exist in this workspace. |
409 | The bucket is not ready yet. |
Errors use the standard error format.