Delete an IAM role from your Vultr organization. Remove the role and disassociate all attached policies, users, and groups from the role in the IAM system.
Deleting a role removes it from your organization. Users and groups that were assigned the role lose any permissions granted through it. The role can be restored using the Restore Role endpoint if you have its id.
This guide explains how to delete a role using the Vultr Console and the Vultr API.
Send a GET request to the List Roles endpoint to retrieve all roles in your organization.
$ curl "https://api.vultr.com/v2/roles" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id of the role you want to delete.
Send a DELETE request to the Delete Role endpoint to delete the role. Replace {role-id} with the id of the role you want to delete.
$ curl "https://api.vultr.com/v2/roles/{role-id}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful deletion returns an HTTP 204 No Content response with no response body.
Send a GET request to the List Roles endpoint to retrieve all roles.
$ curl "https://api.vultr.com/v2/roles" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the deleted role no longer appears in the list.