> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/es/proxies/dedicated-isp-proxies/enterprise/restful.md).

# Lista blanca de IPs (RESTful)

Aprende a gestionar la lista blanca de IP de tu Dedicated ISP Proxy mediante la API RESTful, incluidos los endpoints para ver, añadir y eliminar IPs.

Incluya IPs en la lista blanca enviando consultas directamente a nuestros endpoints.

{% hint style="info" %}
Tenga en cuenta que hay un período de espera de 5 minutos para confirmar los cambios en su lista de IPs en la lista blanca.
{% endhint %}

## Obteniendo la lista de IPs en lista blanca

`GET https://api.oxylabs.io/v1/whitelisted_ips`

| Respuesta | Descripción                                                                                       |
| --------- | ------------------------------------------------------------------------------------------------- |
| `200`     | Éxito. El cuerpo de la respuesta contiene todas las IPs actualmente en la lista blanca y sus IDs. |

#### Ejemplo de código

{% tabs %}
{% tab title="cURL" %}

```shell
curl -u username:password "https://api.oxylabs.io/v1/whitelisted_ips"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?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);
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
requests.get('https://api.oxylabs.io/v1/whitelisted_ips', auth=('username', 'password'))
```

{% endtab %}
{% endtabs %}

#### Salida de ejemplo

```json
{
    "data": [
        {
            "id": 9765,
            "address": "127.0.0.1"
        },
        {
            "id": 9766,
            "address": "127.0.0.2"
        }
    ]
}
```

## Añadiendo una IP a la lista blanca

`POST https://api.oxylabs.io/v1/whitelisted_ips`

| Respuesta | Descripción                                                                                                                  |
| --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `201`     | Éxito. La dirección IP se ha añadido a la lista. El cuerpo de la respuesta contiene la recién añadida `dirección` y `id`.    |
| `422`     | Error. El cuerpo de la solicitud contiene una dirección IP no válida. El cuerpo de la respuesta contiene el mensaje de error |

#### Ejemplo de código

{% tabs %}
{% tab title="cURL" %}

```shell
curl -X POST -u username:password "https://api.oxylabs.io/v1/whitelisted_ips"
--header "Content-Type: application/json" --data '{"address": "127.0.0.1"}'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://api.oxylabs.io/v1/whitelisted_ips");
$payload = json_encode( array( "address"=> "127.0.0.1" ) );
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
curl_setopt( $curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, 'username:password');

$result = curl_exec($curl);
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
requests.post('https://api.oxylabs.io/v1/whitelisted_ips',
              json={"address": "127.0.0.1"},
              auth=('username', 'password'))
```

{% endtab %}
{% endtabs %}

```json
{
    "error": {
        "message": "This is not a valid IP address.",
        "code": 422
    }
}
```

#### Salida de ejemplo

```json
{
    "id": 9767,
    "address": "127.0.0.1"
}
```

## Eliminando una IP de la lista blanca

`DELETE https://api.oxylabs.io/v1/whitelisted_ips/{id}`

| Parámetro | Descripción                                                                                                |
| --------- | ---------------------------------------------------------------------------------------------------------- |
| `id`      | La `id` de la dirección IP que quieres eliminar (puedes obtenerla del endpoint GET de IPs en lista blanca) |

| Respuesta | Descripción                                                                                                                   |
| --------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `204`     | Éxito. La dirección IP ha sido eliminada de la lista. El cuerpo de la respuesta está vacío.                                   |
| `403`     | Error. La solicitud contiene un valor no válido `id`. El cuerpo de la respuesta contiene el mensaje de error "Access Denied". |

#### Ejemplos de código

{% tabs %}
{% tab title="cURL" %}

```shell
curl -X DELETE -u username:password "https://api.oxylabs.io/v1/whitelisted_ips/{id}"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.oxylabs.io/v1/whitelisted_ips/{id}');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, 'username:password');
$result = curl_exec($curl);
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
requests.delete('https://api.oxylabs.io/v1/whitelisted_ips/{id}', auth=('username', 'password'))
```

{% endtab %}
{% endtabs %}

## Guardando cambios (enfriamiento de 5 min)

`POST https://api.oxylabs.io/v1/whitelisted_ips/upload_to_servers`

| Respuesta | Descripción                                                                                                                                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `202`     | <p>Éxito. Los cambios en tu lista de IPs en lista blanca han sido confirmados. El cuerpo de la respuesta está vacío.<br></p>                                                                                                                |
| `429`     | <p>Error. Los cambios no han sido confirmados; el endpoint está en un enfriamiento de 5 minutos. El cuerpo de la respuesta contiene el mensaje de error "You have exceeded the rate limit for the endpoint. Please try again later"<br></p> |

#### Ejemplos de código

{% tabs %}
{% tab title="cURL" %}

```shell
curl -X POST -u username:password "https://api.oxylabs.io/v1/whitelisted_ips/upload_to_servers"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://api.oxylabs.io/v1/whitelisted_ips/upload_to_servers");
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, 'username:password');

$result = curl_exec($curl);
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
requests.post("https://api.oxylabs.io/v1/whitelisted_ips/upload_to_servers", auth=('username', 'password'))
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/products/es/proxies/dedicated-isp-proxies/enterprise/restful.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
