Terminate an active assumed role session in Vultr IAM. Revoke temporary elevated permissions and end the session before its scheduled expiration timestamp.
Terminating an assumed role session immediately revokes the temporary permissions granted by the session. This is useful when a session is no longer needed or when you need to revoke elevated access for security reasons.
This guide explains how to terminate an assumed role session using the Vultr API.
Send a GET request to the Read Assumed Role Session endpoint to retrieve the session details. Replace {session-token} with the session token. Verify that the remaining_duration is greater than 0.
$ curl "https://api.vultr.com/v2/assumed-roles/{session-token}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a DELETE request to the Delete Assumed Role Session endpoint to terminate the session.
$ curl "https://api.vultr.com/v2/assumed-roles/{session-token}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful termination returns an HTTP 204 No Content response with no response body. The session's permissions are immediately revoked.