How to Add IP Addresses to a User's Whitelist

Updated on 13 August, 2025

Adding an IP address or subnet to a user's whitelist allows authorized administrators to define which public IPs are permitted to access the Vultr platform on that user’s behalf. This action is restricted to root users or those granted the manage_users permission, maintaining strict access control. Only public IP addresses are allowed, with valid subnet ranges of /8 to /32 for IPv4 and /20 to /128 for IPv6. The operation is idempotent—repeated additions of the same IP or subnet do not result in errors, making it safe for use in automated access management scripts.

Follow this guide to add IP addresses for a user's whitelist using the Vultr API.

  1. Send a GET request to the Get Users endpoint to view all users and note the user id for the target user.

    console
    $ curl "https://api.vultr.com/v2/users" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a POST request to the Add IP to User Whitelist endpoint to add IP addresses in the user's whitelist.

    console
    $ curl "https://api.vultr.com/v2/users/{user-id}/ip-whitelist" \
        -X POST \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json" \
        --data '{
            "subnet" : "8.8.8.0",
            "subnet_size" : 24
        }'
    
  3. Send a GET request to the List User IP Whitelist endpoint to list confirm the addition of IP addresses.

    console
    $ curl "https://api.vultr.com/v2/users/{user-id}/ip-whitelist" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    

Comments

No comments yet.