/v1/iam/assume-roleAssume role
Assume an IAM role and receive temporary credentials. The caller must be allowed by the role's trust policy. Can be used by service accounts to get temporary credentials for a specific role.
Request Body
requiredContent-Type: application/json
role_id
string<uuid>requiredduration_seconds
integeroptionalCredential validity duration (15 min to 12 hours)
Default: 3600
Responses
Role assumed successfully
Content-Type: application/json
access_key_id
stringoptionalsecret_access_key
stringoptionalsession_token
stringoptionalexpiration
string<date-time>optionalInvalid request parameters
Content-Type: application/json
error
objectrequiredAuthentication required or token invalid
Content-Type: application/json
error
objectrequiredNot allowed to assume this role
Content-Type: application/json
error
objectrequiredResource not found
Content-Type: application/json
error
objectrequiredInternal server error
Content-Type: application/json
error
objectrequiredcurl -X POST "https://api.spo1.mycloud.com/v1/iam/assume-role" \-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \-H "Content-Type: application/json" \-d '{"role_id": "550e8400-e29b-41d4-a716-446655440000","duration_seconds": 3600}'