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

# Geoblocking

> Restrict access to yield functionality based on user location

## Overview

The Yield.xyz API enables you to stay at the forefront of innovation while maintaining full compliance with global regulatory standards. Our built-in geoblocking system ensures your integration remains compliant — without requiring you to maintain country-by-country enforcement logic.

<Info>
  Geoblocking allows you to selectively restrict access to yield-related functionality based on a user's location — at the country or region level — using a flexible, configuration-based system.
</Info>

***

## How It Works

Geoblocking is enforced at the **action level** — including all `enter`, `exit`, and `manage` flows. If a user is in a blocked region, the API returns a `403 Forbidden` error and prevents the transaction from being created.

All geoblocking checks are performed at the **project level**, allowing you to define your own compliance posture.

***

## Configuration Options

Manage geoblocking settings directly in your dashboard:

<CardGroup cols={2}>
  <Card title="Auto Compliance Mode" icon="shield-check">
    Block all regions on global compliance risk lists (OFAC, OFSI, crypto bans, staking bans)
  </Card>

  <Card title="Manual Configuration" icon="sliders">
    Add or remove specific country or region-level restrictions
  </Card>

  <Card title="Override Locations" icon="unlock">
    Allow specific locations to match your legal position
  </Card>

  <Card title="Default OFAC" icon="flag-usa">
    By default, only OFAC-level restrictions are applied
  </Card>
</CardGroup>

<Card title="Configure Geoblocking" icon="gear" href="https://dashboard.yield.xyz/settings/geoblocking">
  Manage your geoblocking settings in the dashboard
</Card>

***

## Region Categories

Yield.xyz maintains an up-to-date global region list across several categories:

<Tabs>
  <Tab title="Official Crypto Bans">
    Countries with explicit bans on cryptocurrency trading, staking, or DeFi use.

    Block access from these regions to align with local regulations.
  </Tab>

  <Tab title="OFAC Sanctions">
    The U.S. Treasury's Office of Foreign Assets Control (OFAC) publishes a list of sanctioned countries.

    Enforcing OFAC bans ensures your product avoids prohibited jurisdictions under U.S. policy.
  </Tab>

  <Tab title="OFSI Sanctions">
    The U.K.'s Office of Financial Sanctions Implementation (OFSI) maintains a sanctions regime.

    Block OFSI-restricted countries with a single toggle.
  </Tab>

  <Tab title="Pending Litigation">
    **Optional** — In response to U.S. scrutiny around staking, Yield.xyz allows restricting access from states with active legal cases.

    Follows patterns adopted by platforms like Coinbase (California, New Jersey, South Carolina).
  </Tab>
</Tabs>

***

## Error Response

If a request is blocked due to geoblocking, the API returns:

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

The response includes the detected region, making it easy to handle programmatically or inform the user.

***

## Implementation Example

```typescript theme={null}
try {
  const action = await fetch('https://api.yield.xyz/v1/actions/enter', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': apiKey,
    },
    body: JSON.stringify({
      yieldId: 'ethereum-eth-lido-staking',
      address: userAddress,
      arguments: { amount: '1000000000000000000' },
    }),
  });

  if (!action.ok) {
    const error = await action.json();
    
    if (error.statusCode === 403) {
      // Handle geoblocking
      console.log('User blocked:', error.message);
      showGeoblockingMessage(error.message);
      return;
    }
  }
  
  // Continue with action...
} catch (error) {
  console.error('Request failed:', error);
}
```

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Geoblocked Countries" icon="flag" href="/documentation/advanced-setup/dashboard-configuration/geo-blocking/geoblocked-countries">
    View full country list
  </Card>

  <Card title="Geoblocked US States" icon="flag-usa" href="/documentation/advanced-setup/dashboard-configuration/geo-blocking/geoblocked-us-states">
    View US state restrictions
  </Card>
</CardGroup>
