Skip to content

Create a bucket access key

POST/v1/asset-buckets/{uid}/access-keys

Creates an S3 access key scoped to this bucket, for use with any S3-compatible client (AWS CLI, SDKs, rclone and so on). Point the client at endpoint and region, and use bucket as the bucket name.

The secret_access_key appears only in this response. Store it securely, because it cannot be retrieved again.

The key starts in provisioning while it is granted on storage, and becomes active when the operation finishes. Poll Get an operation with operation_id before using the key. If provisioning fails the key's status is failed.

The bucket must be ready. Requires the secrets manage 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

uidstringRequired

The bucket's uid.

Headers

X-Workspace-SlugstringRequired

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

Request body

namestringRequired

Label for the key. Leading and trailing spaces are trimmed.

permissionsarray of strings

What the key may do. Case-insensitive, duplicates are ignored. Defaults to all four (read, write, list, delete) when omitted or empty.

One ofreadwritelistdelete

Response

201

The key was created and its provisioning operation was queued. The response includes the one-time secret_access_key.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
uidstringRequired

Unique identifier of the access key. Use it to revoke the key.

bucket_uidstringRequired

UID of the bucket the key is scoped to.

namestringRequired

Label you gave the key.

access_key_idstringRequired

S3 access key ID. Starts with RPTY.

permissionsarray of stringsRequired

What the key may do in the bucket.

One ofreadwritelistdelete

statusstringRequired

provisioning until the grant is applied on storage, then active.

One ofprovisioningactiverevokedfailed

endpointstringRequired

S3 endpoint to point your client at.

regionstringRequired

S3 region to configure in your client.

bucketstringRequired

S3 bucket name to use with the key (same as the bucket's s3_bucket_name).

created_atstring (date-time)Required

When the key was created.

revoked_atstring (date-time)

When the key was revoked. Omitted for keys that are not revoked.

last_used_atstring (date-time)

When the key was last used. Omitted if it has never been used.

secret_access_keystringRequired

The S3 secret access key. Shown only once.

operation_idstringRequired

ID of the operation that provisions the key. Pass it to Get an operation.

operation_statusstringRequired

Status of the operation when it was queued. Always queued.

events_urlstringRequired

Path of the operation's progress event stream.

Errors

StatusMeaning
400Validation failed. Possible messages: invalid request (malformed JSON or missing name), name is required, unsupported permission "<value>", at least one permission is required (only blank entries were sent).
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.
404The bucket does not exist in this workspace.
409The bucket is not ready.

Errors use the standard error format.