Skip to content
Start here

Temporary Credentials

Create Temporary Access Credentials
POST/accounts/{account_id}/r2/temp-access-credentials
ModelsExpand Collapse
TemporaryCredential { bucket, parentAccessKeyId, permission, 3 more }
bucket: string

Name of the R2 bucket.

parentAccessKeyId: string

The parent access key id to use for signing.

permission: "admin-read-write" or "admin-read-only" or "object-read-write" or "object-read-only"

Permissions allowed on the credentials.

One of the following:
"admin-read-write"
"admin-read-only"
"object-read-write"
"object-read-only"
ttlSeconds: number

How long the credentials will live for in seconds.

maximum604800
objects: optional array of string

Optional object paths to scope the credentials to.

prefixes: optional array of string

Optional prefix paths to scope the credentials to.

TemporaryCredentialCreateResponse { accessKeyId, secretAccessKey, sessionToken }
accessKeyId: optional string

ID for new access key.

secretAccessKey: optional string

Secret access key.

sessionToken: optional string

Security token.