> ## 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.

# Self-Exclusion Iframe

> Embed the Anunnaki-hosted self-exclusion form in one line of HTML. KGC-compliant durations and confirmation flow built in.

The self-exclusion iframe is the simplest path to a KGC-compliant responsible-gambling page. Drop in one `<iframe>` tag, listen for the success event, and let Anunnaki handle the rest — validation, persistence, master-list propagation, irrevocable-confirmation step for permanent exclusions, and webhook fan-out to every operator under the licence.

## Embed

```html theme={null}
<iframe
  src="https://sandbox.api.anunnakielite.com/iframe/?key=cur_pk_test_YOUR_KEY&tenant=YOUR_TENANT"
  style="width:100%;max-width:560px;height:680px;border:0;border-radius:12px"
  title="Self-exclusion"
></iframe>
```

| URL param | Required | Purpose                                                                                                               |
| --------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `key`     | yes      | Your tenant's public iframe key (`cur_pk_test_*` / `cur_pk_live_*`)                                                   |
| `tenant`  | optional | Tenant slug for logging/audit context                                                                                 |
| `api`     | optional | Override the API base (defaults to `sandbox.api.anunnakielite.com` in sandbox, `api.anunnakielite.com` in production) |

## What it does

1. Shows the user a duration picker (24h, 7 days, 30 days, 6 months, 1 year, **Permanent**)
2. Permanent exclusions require an explicit irrevocability acknowledgement (KGC-mandated)
3. Collects email or phone (at least one required) plus an optional free-text reason
4. `POST /v1/iframe/exclusions` — same validation, audit, and webhook fan-out as the operator-keyed `/v1/exclusions` route
5. Shows the user a success state with their reference ID

## Listen for completion

```js theme={null}
window.addEventListener('message', (e) => {
  if (e.data?.source !== 'currents-self-exclusion') return;
  if (e.data.type !== 'submitted') return;

  const { exclusion_id, duration, is_permanent } = e.data.data;
  // close the modal, show your confirmation, refresh user state, etc.
});
```

Events fired:

* `ready` — iframe loaded
* `submitted` — exclusion created; `data` includes `exclusion_id`, `duration`, `is_permanent`
* `error` — submission failed; `data.status` is the HTTP code, `data.error` is the API error code

## Webhooks (no change from /v1/exclusions)

The iframe submission fires the same webhook events as a direct API call:

* `exclusion.created` (always)
* `exclusion.permanent` (additionally, for `duration_permanent`)

See [Self-Exclusion API](/api-reference/self-exclusion) for the full payload shape and supported durations.

## Mobile

The form is responsive down to a 320px viewport. For modal embeds, give the iframe `height: 100vh` on mobile so the user can scroll all the steps.

## When to use the iframe vs the direct API

| You want…                        | Use                      |
| -------------------------------- | ------------------------ |
| Zero UI work, ship today         | **Iframe**               |
| 100% brand control over the form | Direct API + your own UI |
| Bulk imports, admin tooling      | Direct API               |

You can mix both — the iframe is a strict subset of the direct API.
