- Print
- DarkLight
PutRolePolicy
- 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.
Add or replace an inline policy on a role
Actual request: POST / to iam.backblazeb2.com with Action=PutRolePolicy.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Action | string | yes | PutRolePolicy |
| Version | string | yes | 2010-05-08 |
| RoleName | string | yes | Role name. |
| PolicyName | string | yes | Policy name (up to 128 characters). |
| PolicyDocument | string | yes | URL-encoded policy JSON (up to 131,072 characters after decoding). |
Example: Inline role policy allowing uploads only to a specific prefix
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUploadPrefixOnly",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Resource": ["arn:aws:s3:::analytics-bucket/uploads/*"]
}
]
} Errors
NoSuchEntityMalformedPolicyDocumentValidationErrorLimitExceeded
AWS Signature Version 4. The Authorization header takes the form AWS4-HMAC-SHA256 Credential=..., SignedHeaders=..., Signature=.... For IAM and STS requests, the signing region is not validated; use any non-empty region value consistently. The signing service must be iam for IAM requests and sts for STS requests. When using temporary credentials, also include X-Amz-Security-Token: <session-token>.
URL-encoded policy JSON.
The request succeeded. The response body is an XML document specific to the Action invoked, with a ResponseMetadata block containing a RequestId.
Action-specific XML response. See the example response for each operation.
The request was malformed or failed validation.
| HTTP Status | Code | Description |
|---|---|---|
| 400 | ValidationError | Invalid input parameter or failed validation. |
| 400 | MalformedPolicyDocument | Policy JSON is invalid or unsupported. |
The caller is not authorized. For operations that reference IAM resources, authorization may be evaluated before resource existence is disclosed.
| HTTP Status | Code | Description |
|---|---|---|
| 403 | AccessDenied | The authenticated principal lacks permission for this action. |
For an authorized caller, the referenced entity does not exist.
| HTTP Status | Code | Description |
|---|---|---|
| 404 | NoSuchEntity | Referenced role, user, policy, or key does not exist. |
A quota or size limit was exceeded.
| HTTP Status | Code | Description |
|---|---|---|
| 409 | LimitExceeded | Quota or size limit exceeded. |
The request was rate-limited.
| HTTP Status | Code | Description |
|---|---|---|
| 429 | Throttling | Too many requests. Use exponential backoff. |
The server encountered an unexpected condition.
| HTTP Status | Code | Description |
|---|---|---|
| 500 | InternalFailure | Unexpected server error. |