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

# Geo-Blocking

> Three-tier country list (blocked / restricted / allowed). Signup-only IP check. KGC-mandated jurisdictions enforced centrally.

Anunnaki manages the country list centrally and updates it when the KGC adds or removes jurisdictions. Operators cannot edit the list directly. Production cutover will use **MaxMind GeoIP2**; sandbox runs against a deterministic stub resolver.

<Note>
  Sandbox uses a stub IP resolver covering a fixed set of test IP prefixes. **Real-world IPs (your office, dev laptop, etc.) will resolve as `unresolvable_ip` and return `status_blocked`** — this is expected. Use the sandbox test IPs below to exercise each tier. Production swaps in the real MaxMind GeoIP2 database so every IP resolves.
</Note>

## Sandbox test IPs

Use these against `https://sandbox.api.anunnakielite.com/v1/geo/check` to exercise each tier and country. Any IP matching the prefix resolves the same way (e.g. `203.0.113.1` and `203.0.113.99` both resolve to Canada).

### Allowed

| IP              | Country       |
| --------------- | ------------- |
| `203.0.113.10`  | Canada (CA)   |
| `200.160.5.10`  | Brazil (BR)   |
| `198.51.100.10` | Japan (JP)    |
| `39.32.5.10`    | Pakistan (PK) |

### Restricted (local-licence regimes)

| IP             | Country             |
| -------------- | ------------------- |
| `81.2.69.142`  | United Kingdom (GB) |
| `1.1.1.10`     | Australia (AU)      |
| `78.193.5.10`  | France (FR)         |
| `46.114.5.10`  | Germany (DE)        |
| `83.46.5.10`   | Spain (ES)          |
| `93.41.5.10`   | Italy (IT)          |
| `193.190.5.10` | Netherlands (NL)    |
| `155.4.5.10`   | Sweden (SE)         |

### Blocked (KGC-mandated)

| IP              | Country            |
| --------------- | ------------------ |
| `8.8.8.8`       | United States (US) |
| `95.108.213.10` | Russia (RU)        |
| `178.124.5.10`  | Belarus (BY)       |
| `175.45.5.10`   | North Korea (KP)   |
| `5.232.5.10`    | Iran (IR)          |
| `202.165.5.10`  | Myanmar (MM)       |

### Unresolvable (always returns `block_reason: "unresolvable_ip"`)

Any IP not listed above will hit the stub's fallback and resolve as `unresolvable_ip → status_blocked`. Useful for testing your fallback handling.

## The three tiers

| Tier                | Meaning                             | Operator action                     |
| ------------------- | ----------------------------------- | ----------------------------------- |
| `status_allowed`    | Default for unlisted countries.     | Continue signup.                    |
| `status_restricted` | Country has its own license regime. | Route to compliance review.         |
| `status_blocked`    | KGC-mandated ban.                   | Reject signup, show `user_message`. |

### Currently blocked (KGC-mandated)

US, RU, BY, KP, IR, MM.

### Currently restricted (local-license regimes)

UK, CA-ON, SE, NL, DE, FR, ES, IT, AU.

## Endpoints

| Method | Path                | Description                                                                  |
| ------ | ------------------- | ---------------------------------------------------------------------------- |
| `POST` | `/v1/geo/check`     | Resolve IP → tier.                                                           |
| `GET`  | `/v1/geo/countries` | Full list with current tier values (`Cache-Control: public, max-age=86400`). |

### `POST /v1/geo/check`

```bash theme={null}
curl https://sandbox.api.anunnakielite.com/v1/geo/check \
  -H "Authorization: Bearer cur_sk_test_EXAMPLEKEY123456789012345678901234" \
  -H "Content-Type: application/json" \
  -d '{
    "ip_address": "203.0.113.42",
    "user_agent": "Mozilla/5.0...",
    "context": "signup"
  }'
```

Allowed:

```json theme={null}
{
  "status": "status_allowed",
  "country_code": "FR",
  "country_name": "France",
  "region": "EU",
  "ip_address": "203.0.113.42",
  "checked_at": "2026-05-24T15:02:00Z"
}
```

Blocked:

```json theme={null}
{
  "status": "status_blocked",
  "country_code": "US",
  "country_name": "United States",
  "block_reason": "kgc_us_undertaking_2016",
  "user_message": "Sorry, we are unable to accept players from your jurisdiction.",
  "checked_at": "2026-05-24T15:02:00Z"
}
```

Restricted:

```json theme={null}
{
  "status": "status_restricted",
  "country_code": "GB",
  "country_name": "United Kingdom",
  "restriction_reason": "requires_local_license",
  "user_message": "Service availability in your region is under review.",
  "next_action": "queue_for_review"
}
```

Responses include `X-Cache: HIT|MISS`. The IP resolver is internally cached for 24h per (IP, country); unresolvable IPs are **not** cached. Every request — HIT or MISS — writes a row to the 7-year audit log.

### `GET /v1/geo/countries`

```json theme={null}
{
  "version": "2026-05-24",
  "countries": [
    { "code": "US", "name": "United States", "status": "blocked" },
    { "code": "RU", "name": "Russia",        "status": "blocked" },
    { "code": "GB", "name": "United Kingdom","status": "restricted" },
    { "code": "FR", "name": "France",        "status": "allowed" }
  ]
}
```

## Webhooks

| Event                    | Fires when                         |
| ------------------------ | ---------------------------------- |
| `geo.country_blocked`    | A country moves to `blocked`.      |
| `geo.country_restricted` | A country moves to `restricted`.   |
| `geo.country_allowed`    | A country moves back to `allowed`. |

```json theme={null}
{
  "event": "geo.country_blocked",
  "event_id": "evt_geo_99f02a",
  "timestamp": "2026-05-24T15:02:00Z",
  "data": {
    "country_code": "TR",
    "country_name": "Turkey",
    "previous_status": "allowed",
    "new_status": "blocked",
    "reason": "kgc_mandate_2026"
  }
}
```

## Operator policy

* **Frequency:** signup only. No per-login or per-transaction re-checks.
* **VPN handling:** none. Raw IP only.
* **Audit:** every check is retained for 7 years (KGC).
* **Override:** only Anunnaki compliance can grant case-by-case exceptions.

## Error codes

| Status | Code                                        |
| ------ | ------------------------------------------- |
| 400    | `invalid_ip`                                |
| 401    | `unauthorized`                              |
| 422    | `unresolvable_ip` (rare — treat as blocked) |
| 429    | `rate_limited`                              |
