> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Whitelisted IP Requests

> Residential Proxy Advanced Parameter Usage via Whitelisted IP Authentication

To authenticate your proxy connection, you can use a Whitelisted IP instead of a username and password. To do this, you'll need to specify all of the proxy parameters directly in the **endpoint**.

Learn how to add a Whitelisted IP [**here**](https://help.decodo.com/docs/residential-proxy-authentication-methods#whitelisted-ip-authentication).

<Warning>
  ### Whitelisted IP Authentication Limitations

  * **Whitelisted IP** authentication only supports `HTTPS` requests.
  * `IPv6` IP addresses are currently unsupported for Whitelisted IP authentication. Please use IPs that are in `IPv4` format (`xx.xx.xx.xx`).
</Warning>

***

## Country Targeting

If IPs from a specific country are needed, then modify the **endpoint** to include the `country-xx` parameter. Use two-letter Alpha-2 codes. There is a full list of them [**here**](https://www.iban.com/country-codes).

Example of a **rotating proxy** that returns IPs from the US:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us.gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

**Rotating** IPs from Italy:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-it.gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

***

## City Targeting

Add a `city-xxxx` parameter to the endpoint to specify a city within a country.

It's used in conjunction with the `country` parameter and is not standalone.

If the city name consists of multiple words, then use underscores.

Example of a **rotating proxy** that returns IPs from New York City:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us-city-new_york.gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

Example of a **rotating proxy** that returns IPs from Rome:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-it-city-rome.gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

***

## State Targeting

Adding the `state-us_xxxxx` to your endpoint will allow for state targeting. Only US states are currently supported.

An example of a **rotating proxy** that returns IPs from the state of New York:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us-state-us_new_york.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

**Rotating** IPs from California:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us-state-us_california.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

***

## Continent Targeting

Adding the `continent` parameter to your endpoint will allow you to target IPs from a specific continent.

An example of a **rotating proxy** that returns IPs from Europe:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://continent-eu.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

<Note>
  ### Continent Codes

  * Asia – `as`
  * Africa – `af`
  * Europe – `eu`
  * North America – `na`
  * Oceania – `oc`
  * South America – `sa`
</Note>

***

## ASN Targeting

Adding the `asn` parameter will allow you to target IPs from a specific carrier.

* You must choose between `city` targeting and `asn` targeting, as they can’t be used simultaneously.
  * The same logic would apply to the `continent`, `state` and `country` parameters.
* An example of a proxy with the **AT\&T Mobility LLC** `asn` number with a rotating session:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://asn-20057.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

<Note>
  ### Carrier Numbers

  You can look up carrier numbers by searching online, for example [**here**](https://asnlookup.com/) .
</Note>

***

## Sticky Session

The examples above have been performed using a rotating session, so you'll get a new IP address with each request. Adding the `session` variable to the endpoint will allow the IP address to persist for multiple requests.

An example of a **Sticky** session that returns IP addresses from the US:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us-session-randomstring123.gate.decodo.com:7000" "https://ip.decodo.com/json"
  ```
</CodeGroup>

Since this proxy is **Sticky**, the same IP address will be returned if you run the command again, as there is still an active session with that IP address.

The **default** session duration is **10 minutes**. The IP address will automatically rotate after that.

There must be a way to differentiate between each session that is assigned to the user, since it's possible to have multiple active sticky sessions at once.

<Note>
  ### Session Values

  The value – `randomstring123` is used in the example above. Any alphanumeric text/string could be used, depending on your preference. All of these would be viable:

  `session-random123`, `session-1`, `session-abcdef`, `session-2`, etc.
</Note>

Different session parameter values are used to differentiate between active sessions and behave just like the different **sticky proxy** ports with our country endpoints.

For example, if you run the command above with the session variable `randomstring123`, you will see that the same proxy IP persists even if you adjust other parameters, such as the country, city, etc.

That means if you require changing the location or rotating the proxy IP sooner, the session parameter must be changed as well. Otherwise, the IP address will not rotate.

<Note>
  ### Maintaining Sessions With Ports

  Alternatively, you can use ports instead of the `session` parameter. E.g.:

  * `country-us-sessionduration-60.gate.decodo.com:10001`;
  * `country-us-sessionduration-60.gate.decodo.com:10002`;
  * `country-us-sessionduration-60.gate.decodo.com:10003`.

  The available port range is `10001`-`49999`.
</Note>

***

## Session Duration

Adding `sessionduration-x` to the endpoint will allow the session to persist for up to **24 hours**.

<Note>
  ### Session Length

  Any integer between **1** and **1440** is accepted.

  For example: `sessionduration-1` `sessionduration-10` `sessionduration-600`
</Note>

<Warning>
  ### Premature Rotation

  The longer the session you have, the more chances there are that **the IP will rotate before** your specified time due to the residential device at the end going offline.
</Warning>

***

An example of a **sticky** IP from Chicago that will persist for up to 90 minutes:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-us-city-chicago-session-example1-sessionduration-90.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

An example of a **sticky** IP from Casablanca that will persist for up to 1 minute:

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://country-ma-city-casablanca-session-example2-sessionduration-1.gate.decodo.com:7000" "ip.decodo.com/json"
  ```
</CodeGroup>

<Note>
  ### Note

  We cannot guarantee IP availability when using **backconnect**, especially if smaller countries or cities are targeted.
</Note>

***

<Columns cols={2}>
  <Card title="Support" href="https://direct.lc.chat/12092754" cta="Let's chat!">
    Need help or just want to say hello? Our support is available 24/7. \
    You can also reach us anytime via email at [support@decodo.com](mailto:support@decodo.com).
  </Card>

  <Card title="Feedback" href="mailto:feedback@decodo.com" cta="Share feedback">
    Can't find what you're looking for? Request an article! \
    Have feedback? Share your thoughts on how we can improve.
  </Card>
</Columns>
