Restore a previously deleted IAM policy on Vultr. Recover the policy and its permission rules to reassociate it with users, groups, and roles in the system.
Restoring a deleted policy reinstates it along with its permission rules. This is useful when a policy was deleted by mistake or when you need to recover permission configurations.
id.
This guide explains how to restore a previously deleted policy using the Vultr API.
Send a PATCH request to the Restore Policy endpoint to restore the deleted policy. Replace {policy-id} with the id of the deleted policy.
$ curl "https://api.vultr.com/v2/policies/{policy-id}/restore" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful restoration returns an HTTP 202 Accepted response.
Send a GET request to the Read Policy endpoint to retrieve the policy details.
$ curl "https://api.vultr.com/v2/policies/{policy-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the policy details are intact.