Delete Vultr user API keys with admin access to maintain security and prevent misuse.
Deleting a user's API key is an important security practice to prevent unauthorized access and reduce the risk of compromised credentials. When an API key is no longer in use, or after you generate a replacement during credential rotation, remove the old key to keep your environment secure.
Follow this guide to delete a user API key using the Vultr Customer Portal or the Vultr API.
Send a GET
request to the Get Users endpoint to list all users.
$ curl "https://api.vultr.com/v2/users" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id
of the user whose API key you want to delete.
Send a GET
request to the List User API Keys endpoint to list the API keys for that user.
$ curl "https://api.vultr.com/v2/users/{user-id}/apikeys" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id
of the API key you want to delete.
Send a DELETE
request to the Delete User API Key endpoint to remove the key by ID.
$ curl "https://api.vultr.com/v2/users/{user-id}/apikeys/{apikey-id}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
The API responds with 204 No Content
to confirm successful deletion.
Send a GET
request to the List User API Keys endpoint again to verify the key no longer appears in the response.
$ curl "https://api.vultr.com/v2/users/{user-id}/apikeys" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Confirm that the deleted key ID no longer appears in the output.
No comments yet.