Whitelisting IPs (RESTful)
Learn about managing your Dedicated ISP Proxy IP whitelist via the RESTful API, including endpoints for viewing, adding, and removing IPs.
Whitelist IPs by sending queries directly to our endpoints.
Getting Whitelisted IPs List
GET https://api.oxylabs.io/v1/whitelisted_ips
200
Success. Response body contains all currently whitelisted IPs and their ids.
Code example
curl -u username:password "https://api.oxylabs.io/v1/whitelisted_ips"<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://api.oxylabs.io/v1/whitelisted_ips");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, 'username:password');
$result = curl_exec($curl);
?>import requests
requests.get('https://api.oxylabs.io/v1/whitelisted_ips', auth=('username', 'password'))Sample output
{
"data": [
{
"id": 9765,
"address": "127.0.0.1"
},
{
"id": 9766,
"address": "127.0.0.2"
}
]
}Adding a Whitelisted IP
POST https://api.oxylabs.io/v1/whitelisted_ips
201
Success. The IP address has been added to the list. Response body contains the newly added address and id.
422
Error. Request body contains an invalid IP address. Response body contains the error message
Code example
Sample output
Removing a Whitelisted IP
DELETE https://api.oxylabs.io/v1/whitelisted_ips/{id}
id
The id of the IP address you want to delete (you can get it from GET whitelisted IPs endpoint)
204
Success. The IP address has been removed from the list. Response body is empty.
403
Error. Request contains an invalid id. Response body contains the error message "Access Denied".
Code examples
Saving Changes (5min Cooldown)
POST https://api.oxylabs.io/v1/whitelisted_ips/upload_to_servers
202
Success. Changes to your whitelisted IP list have been confirmed. Response body is empty.
429
Error. Changes have not been confirmed, the endpoint is on a 5 minute cooldown. Response body contains the error message "You have exceeded the rate limit for the endpoint. Please try again later"
Code examples
Last updated
Was this helpful?

