Restore a previously deleted IAM role on Vultr. Recover the role and its policy attachments to reassign it to users and groups in your organization's IAM.
Restoring a deleted role reinstates it along with its previous configuration. This is useful when a role was deleted by mistake or when you need to recover access configurations that were managed under that role.
id.
This guide explains how to restore a previously deleted role using the Vultr API.
Send a PATCH request to the Restore Role endpoint to restore the deleted role. Replace {role-id} with the id of the deleted role.
$ curl "https://api.vultr.com/v2/roles/{role-id}/restore" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET request to the Read Role endpoint to retrieve the role details.
$ curl "https://api.vultr.com/v2/roles/{role-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the role details are intact.