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

# Internet and static IP

> See where a Lusor Phone's Internet traffic exits, and the state of its static IP.

Every Lusor Phone has its own Internet connection. Its traffic exits either from a **static IP** that stays the same, or from a shared **residential** route whose IP changes over time. The API reads both. Changing them happens in the app.

## Available countries

```bash theme={null}
curl https://api.lusor.ai/v1/workspaces/$WS/internet/locations \
  -H "X-Api-Key: $LUSOR_API_KEY"
```

| Field | Meaning |
| - | - |
| `rotating` | Countries a phone can be added in, or moved to, on the residential route. |
| `persistent` | Countries where a static IP is sold. |

Codes are lowercase two-letter country codes, such as `us`. Any other country returns `400 unsupported_country` when you [add a phone](https://docs.lusor.ai/phones/add-and-remove.md) or change its location.

## Where a phone's traffic exits

```bash theme={null}
curl https://api.lusor.ai/v1/workspaces/$WS/devices/$DEVICE/internet-location \
  -H "X-Api-Key: $LUSOR_API_KEY"
```

| Field | Meaning |
| - | - |
| `country` | The country the phone's traffic exits from. |
| `route` | `static` when the phone is on its static IP, `residential` when it is on the shared residential route. |
| `network` | `home` or `mobile`. |
| `applied` | `route` once the phone's route is recorded, `pending` until then. |
| `generation` | Changes each time the phone's route changes. `null` until it has one. |
| `static` | The static IP, in the shape below, or `null`. |

A phone that is not a Lusor Phone returns `409 not_managed_phone`. `503 internet_location_unavailable` means the information is not available yet; retry later.

## Static IP

```bash theme={null}
curl https://api.lusor.ai/v1/workspaces/$WS/devices/$DEVICE/static-ip \
  -H "X-Api-Key: $LUSOR_API_KEY"
```

| Field | Meaning |
| - | - |
| `state` | `active`, `provisioning`, `needs_review` or `disabled`. |
| `static.publicIp` | The address the phone's traffic exits from. |
| `static.country` | The static IP's country. |
| `static.expiresAt` | The end of the paid term. |
| `operationId` | Present while a change is in progress. `static` is absent then. |

### Follow a change

While a static IP change is in progress, pass its `operationId` back as `?operation=`:

```bash theme={null}
curl "https://api.lusor.ai/v1/workspaces/$WS/devices/$DEVICE/static-ip?operation=$OPERATION_ID" \
  -H "X-Api-Key: $LUSOR_API_KEY"
```

It returns `202` while the change is still in progress (ask again later) and `200` once it has settled. If the change failed, the response is the failure:

| Status | `error` | Meaning |
| - | - | - |
| `400` | `unsupported_country` | A static IP is not sold in the phone's country. |
| `402` | `not_entitled` | The phone is not covered by the workspace's current number of Lusor Phones. |
| `409` | `needs_review` | Setting up this phone's static IP needs support. The phone stays on its current connection. |
| `429` | `cap_busy` | Static IPs cannot be set up right now. Try again later. |
| `503` | `static_ip_unavailable` | The static IP service is not available right now. Retry later. |

An `operation` id that does not belong to this phone returns `400 bad_request`.

## Choosing a static IP when you add a phone

When you [add Lusor Phones](https://docs.lusor.ai/phones/add-and-remove.md) with the API, `internetConnection: "persistent"` (the default) gives each phone a static IP where one is sold in its country. `"rotating"` adds it on the residential route.

## Only in the app

These changes are made from the phone's settings in the [Lusor app](https://app.lusor.ai). They are not available to API keys:

* Changing a phone's exit country, or switching between home and mobile IPs (admins and members).
* Turning a phone's static IP on or off, moving a phone onto a static IP the workspace already has, or replacing a static IP (admins).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.