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

# Geo-blocking

> Restrict Earn API and Perps API actions by country or region using Yield.xyz's mandatory region list plus your own project-level rules.

Geo-blocking restricts Earn API and Perps API actions based on the caller's location, at the country or region level. Yield.xyz maintains a mandatory region list, and you add project-specific restrictions on top. Geo-blocking is one control within your own compliance program and does not replace it.

<Note>
  Geo-blocking is not KYC or eligibility screening. For RWA investor eligibility, see [KYC](/documentation/earn/rwas/kyc).
</Note>

## Configure it in the dashboard

Geo-blocking is configured per project, in the project's **Geo-blocking** section.

* Yield.xyz's mandatory region list is shown read-only, tagged **Crypto Ban**, **OFAC**, **OFSI**, **Staking Ban**, or **Pending Litigation**.
* **Auto Compliance Mode** is a per-project toggle. With it off, only the regions Yield.xyz treats as mandatory are enforced automatically. Turning it on extends enforcement to Yield.xyz's complete flagged-region list, across every tag category.
* You can add your own country or region restrictions on top of whatever Yield.xyz enforces.

<Note>
  Managing geo-blocking (the mandatory list view, Auto Compliance Mode, and your own restrictions) requires the **owner**, **admin**, or **operator** role. All roles can view the configuration.
</Note>

See the full lists: [geoblocked countries and regions](/documentation/advanced-setup/geo-blocking/geoblocked-countries) and [geoblocked US states](/documentation/advanced-setup/geo-blocking/geoblocked-us-states).

## Enforcement points

| API | Routes guarded | Response when blocked |
| - | - | - |
| Earn API | `POST /v1/actions/enter`, `/exit`, `/manage`, `/enter/simulate`, `/exit/simulate` | `403 Forbidden` |
| Perps API | `POST /v1/actions` | `403 Forbidden` |

A blocked request returns the detected location in the error message:

```json theme={null}
{
  "message": "Access denied from US (US-CA)",
  "error": "Forbidden",
  "statusCode": 403
}
```

On the Earn API, a request can also be blocked when the specific yield's own metadata restricts the detected region, even if the region isn't on Yield.xyz's or the project's banned list.

## Which IP is checked

The check uses the `X-Forwarded-For` header when present, falling back to the raw connection IP. If you call the Earn API or Perps API from your own backend rather than directly from the end user's device, forward the end user's IP in `X-Forwarded-For`; otherwise geo-blocking evaluates your server's location instead of the end user's.

## Next steps

<CardGroup cols={2}>
  <Card title="Geoblocked countries" icon="flag" href="/documentation/advanced-setup/geo-blocking/geoblocked-countries">
    The full country and region list, including per-product blocks.
  </Card>

  <Card title="Geoblocked US states" icon="flag-usa" href="/documentation/advanced-setup/geo-blocking/geoblocked-us-states">
    State-level and yield-specific blocks.
  </Card>

  <Card title="Perps" icon="chart-candlestick" href="/documentation/trade/perps">
    How Perps actions are geo-gated in practice.
  </Card>
</CardGroup>


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