- Print
- DarkLight
GenerateIamRoleCredentials
- Print
- DarkLight
Availability
Early Access: July 1, 2026
Early Access is gated; contact the Backblaze Sales team for access.
Limited Availability: July 1, 2026
This API is available only to customers with access to the Backblaze Enterprise Web Console. For more information, contact the Backblaze Sales team.
Generate short-lived AWS-compatible credentials for an IAM role in an account
Returns temporary AWS-compatible credentials (accessKeyId, secretAccessKey, sessionToken) scoped to an IAM role in a target account within the organization. This behaves like the AWS Identity Center GetRoleCredentials API.
Notes
iamRoleis the friendly role name (not an ARN). If omitted, defaults toOrganizationAccountAccessRole.accountIdin the path must be the account that contains the role.- If neither
expireTimenorttlis supplied, the server uses a default session duration of 3600 seconds. ttlmust be specified using protobuf Duration JSON format (for example900s,3600s, or43200s).ttlmust be between 900 and 43200 seconds, inclusive.- Returned credentials are temporary and must be refreshed by calling this API again when expired.
Default policy
The default role is OrganizationAccountAccessRole with an inline policy equivalent to AWS AdministratorAccess (full access to all B2 and IAM actions/resources in the account).
Short-lived bearer token obtained from GET /orgs/v1/authorize. Sent as Authorization - Bearer .
The numeric identifier of the account. Valid account IDs match 9[0-4][0-9]{10}.
Default role with default TTL
{}Explicit role and TTL
{
"iamRole": "AnalyticsRole",
"ttl": "3600s"
}Explicit role and absolute expireTime
{
"iamRole": "AnalyticsRole",
"expireTime": "2026-02-03T22:10:00Z"
}The friendly name (not ARN) of the IAM role to assume. Defaults to OrganizationAccountAccessRole.
Optional absolute expiration of the issued session. Mutually exclusive with ttl.
Optional duration string in protobuf Duration JSON format. Must be between 900s and 43200s inclusive.
The request succeeded.
{
"accessKeyId": "ASIAIOSFODNN7EXAMPLE",
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"sessionToken": "IQoJb3JpZ2luX2VjE...",
"expireTime": "2026-02-03T22:10:00Z"
}AWS-compatible temporary access key ID. Prefixed with ASIA.
AWS-compatible temporary secret access key.
AWS-compatible session token.
RFC 3339 UTC timestamp at which the issued credentials expire.
The request was malformed or failed validation.
| HTTP Status | Code | Description |
|---|---|---|
| 400 | INVALID_ARGUMENT | One or more request parameters were invalid. |
Opaque correlation identifier matching the Request-Id response header. Include in support requests.
Numeric error code.
Human-readable description of the error.
Reserved for structured, non-sensitive diagnostic information related to the error condition.
The request was not authenticated.
| HTTP Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing, expired, or invalid bearer token. |
Opaque correlation identifier matching the Request-Id response header. Include in support requests.
Numeric error code.
Human-readable description of the error.
Reserved for structured, non-sensitive diagnostic information related to the error condition.
The caller is not authorized to perform this operation.
| HTTP Status | Code | Description |
|---|---|---|
| 403 | FORBIDDEN | The authenticated principal lacks permission for this action. |
Opaque correlation identifier matching the Request-Id response header. Include in support requests.
Numeric error code.
Human-readable description of the error.
Reserved for structured, non-sensitive diagnostic information related to the error condition.
The requested resource was not found.
| HTTP Status | Code | Description |
|---|---|---|
| 404 | NOT_FOUND | The resource does not exist or has been purged. |
Opaque correlation identifier matching the Request-Id response header. Include in support requests.
Numeric error code.
Human-readable description of the error.
Reserved for structured, non-sensitive diagnostic information related to the error condition.
The request was rate-limited.
| HTTP Status | Code | Description |
|---|---|---|
| 429 | TOO_MANY_REQUESTS | Rate limit exceeded. Use exponential backoff. |
Opaque correlation identifier matching the Request-Id response header. Include in support requests.
Numeric error code.
Human-readable description of the error.
Reserved for structured, non-sensitive diagnostic information related to the error condition.
The server encountered an unexpected condition.
| HTTP Status | Code | Description |
|---|---|---|
| 500 | INTERNAL | Unexpected server error. Include the requestId when contacting support. |
Opaque correlation identifier matching the Request-Id response header. Include in support requests.
Numeric error code.
Human-readable description of the error.
Reserved for structured, non-sensitive diagnostic information related to the error condition.