Manage the IP allowlist for an organization user in Vultr IAM to restrict which IP addresses and subnets can authenticate to the Vultr API on their behalf.
Access control restricts which IP addresses and subnets can authenticate to the Vultr API on a user's behalf. Every user's allowlist includes two default entries, Any IPv4 (0.0.0.0/0) and Any IPv6, that permit all addresses. Disable these default entries and add specific subnets to restrict API access to trusted networks only.
Follow this guide to manage API access control for a user using the Vultr Console or the Vultr API.
Log in to the Vultr Console.
Click the organization name in the top navigation bar.
Click Manage Organization.
Click Users.
Click the user you want to manage access control for.
Under API Access, locate the Access Control List section.
Click Add IP to Allowlist.
Enter the Subnet Address and Prefix you want to permit. The subnet address accepts an IPv4 or IPv6 address.
Click Add Subnet.
The subnet appears in the Access Control List table.
To remove a custom entry, click the Delete icon next to the entry and click Remove to confirm. To disable the default Any IPv4 or Any IPv6 entries, click the toggle icon next to the entry.
Send a GET request to the List Users endpoint to retrieve all users and note the target user's id.
$ curl "https://api.vultr.com/v2/users" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a POST request to the Add IP to User Allowlist endpoint to add a subnet to the user's allowlist. Replace {user-id} with the id from the previous step, SUBNET-ADDRESS with the IPv4 or IPv6 address, and SUBNET-SIZE with the subnet prefix size.
$ curl "https://api.vultr.com/v2/users/{user-id}/ip-whitelist" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"subnet": "SUBNET-ADDRESS",
"subnet_size": SUBNET-SIZE
}'
Send a GET request to the List User Allowlist endpoint to retrieve the user's allowlist entries. Replace {user-id} with the user id.
$ curl "https://api.vultr.com/v2/users/{user-id}/ip-whitelist" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the new subnet appears in the response.
Send a DELETE request to the Remove IP from User Allowlist endpoint to remove a subnet from the user's allowlist. Replace {user-id} with the user id, SUBNET-ADDRESS with the subnet address, and SUBNET-SIZE with the subnet prefix size to remove.
$ curl "https://api.vultr.com/v2/users/{user-id}/ip-whitelist" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"subnet": "SUBNET-ADDRESS",
"subnet_size": SUBNET-SIZE
}'