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

# Run Location

> Run web tests from another country, so your app sees a local IP address

By default, Autosana runs connect to the internet from the United States. If your app works only in some countries, it may block those runs or show a "not available in your region" page.

You can choose a country for a run. All of the run's browser traffic then leaves from a residential IP address in that country, instead of from Autosana's runner IPs.

## What it supports

| Platform | Location |
| - | - |
| Web | Supported |
| Android | Coming later |
| iOS | Coming later |

Countries use two-letter ISO codes, such as `MX` for Mexico. Lowercase codes are accepted and changed to uppercase. Uninhabited territories (`AQ`, `BV`, `HM`, `TF`, `UM`) and sanctioned countries (`CU`, `IR`, `KP`, `SY`) are not available.

## Choose a location

When you choose no location, the run uses the default: the United States.

### In the dashboard

The **Run location** picker shows for web apps only.

* **Run dialog:** choose a country in **Run location**, under **Where it runs**. The Run button then names the country, for example **Run from Mexico**.
* **Automations:** in the automation editor, choose a country in **Run location**, under the browser picker. Every run the automation starts uses it.

Reruns and automatic retries keep the location of the original run.

### With the CLI

```bash theme={null}
autosana flows run --flow checkout --location MX
```

### With the API

Send `location` in the request body of these calls:

| Call | Effect |
| - | - |
| `POST /api/v1/flows/run` ([Run Flows](/api-runs#run-flows)) | The runs it starts use the location. |
| `POST /api/ci/upload-web-build` ([Upload Web Build](/api-ci#upload-web-build)) | Every run the upload starts uses the location. |
| Automation create and update | The automation's runs use the location. |

```bash theme={null}
curl -X POST https://backend.autosana.ai/api/v1/flows/run \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"app_id": "my-web-app", "flow_ids": ["<flow-id>"], "location": "MX"}'
```

### With MCP

These [MCP tools](/mcp-setup) take a `location` argument:

* `flows_run`
* `suites_run`
* `labels_run`
* `automations_create`
* `automations_update`

On `automations_update`, an empty string removes the saved location.

## Build uploads

An upload can carry a location. It applies to every run the upload starts:

* CI/CD automations. The upload's location replaces the automation's own location. If the upload has none, the automation uses its own.
* Later PR test runs against that build.

Send `location` to [Upload Web Build](/api-ci#upload-web-build). Mobile uploads cannot carry a location yet.

## When a run starts

Before the test starts, the run checks that its traffic leaves from the chosen country.

* If the check passes, the browser console log records the IP: `[Autosana location] Exit IP <ip> (MX)`.
* If the check fails, the run fails with an error that starts with `Location proxy unavailable`. A run with a location never falls back to a US IP.

This start check is the only check that can fail the run.

## Combinations Autosana refuses

A request with a location is refused for:

* an environment that uses a [private network](/private-network)
* an MCP `flows_run` call with `branch_name`
* onboarding runs
* iOS and Android runs (coming later)
* mobile runs on a local device
* an unknown or unavailable country code, such as `KP` (the error lists the valid codes)

## Limits

* **Hooks keep Autosana's fixed IP.** [Hook scripts](/hooks) do not use the run's location. If a hook calls an API that blocks US traffic, that API still refuses the call. See [Network Allowlist](/network-allowlist).
* **Allowlists of Autosana's IPs block location runs.** If your app or an API it calls accepts only Autosana's web runner IPs (`flow_runners.virtual_runners.web_browsers` on [Network Allowlist](/network-allowlist)), it blocks every location run.
* **The IP can change during a run.** The residential IP can drop out during a run. When it changes, the run continues, and the browser console log records `[Autosana location] Exit IP changed to <ip> (<country>)`. Autosana does not check the new IP's country.


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