Suspend or unsuspend a user in your Vultr organization. Temporarily revoke or reinstate a user's access to organizational resources through the IAM API.
Suspending a user in an organization temporarily disables their access to all resources, roles, and policies within that organization without removing them. This is useful when you need to revoke access temporarily, such as during an investigation or when a user is on extended leave. Unsuspending the user restores their previous access.
This guide explains how to suspend and unsuspend a user in an organization using the Vultr API.
Send a GET request to the List Organizations endpoint to retrieve all organizations associated with your account.
$ curl "https://api.vultr.com/v2/organizations" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id of the organization in which you want to suspend the user.
Identify the user_id of the user you want to suspend. Follow the steps in How to List All Users in an Organization to retrieve user IDs.
Send a PUT request to the Suspend User endpoint to suspend the user. Replace {organization-id} with the organization id and {user-id} with the id of the user you want to suspend.
$ curl "https://api.vultr.com/v2/organizations/{organization-id}/user/{user-id}/suspend" \
-X PUT \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful suspension returns an HTTP 204 No Content response with no response body.
Send a GET request to the List Suspended Users endpoint to retrieve the suspended users list.
$ curl "https://api.vultr.com/v2/organizations/{organization-id}/suspended-users" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the suspended user appears in the list.
Send a GET request to the List Suspended Users endpoint to retrieve the list of suspended users in your organization.
$ curl "https://api.vultr.com/v2/organizations/{organization-id}/suspended-users" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the uuid of the user you want to unsuspend.
Send a PUT request to the Unsuspend User endpoint to restore the user's access. Replace {organization-id} with the organization id and {user-id} with the uuid of the suspended user.
$ curl "https://api.vultr.com/v2/organizations/{organization-id}/user/{user-id}/unsuspend" \
-X PUT \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful unsuspension returns an HTTP 204 No Content response with no response body.
Send a GET request to the List Suspended Users endpoint to retrieve the suspended users list.
$ curl "https://api.vultr.com/v2/organizations/{organization-id}/suspended-users" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the user no longer appears in the suspended users list.