ByCloud Docs
GuidesCLIAPISDK
post/v1/iam/assume-role

Assume 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

required

Content-Type: application/json

role_id

string<uuid>required

duration_seconds

integeroptional

Credential validity duration (15 min to 12 hours)

Default: 3600

Responses

200

Role assumed successfully

Content-Type: application/json

access_key_id

stringoptional

secret_access_key

stringoptional

session_token

stringoptional

expiration

string<date-time>optional
400

Invalid request parameters

Content-Type: application/json

error

objectrequired
401

Authentication required or token invalid

Content-Type: application/json

error

objectrequired
403

Not allowed to assume this role

Content-Type: application/json

error

objectrequired
404

Resource not found

Content-Type: application/json

error

objectrequired
500

Internal server error

Content-Type: application/json

error

objectrequired
curl -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
}'