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

# How it works

> The three pieces of the integration, and which one holds the API key

A verification has three legs. Two are yours and the one in the middle belongs to the person.

```text theme={null}
1. Your backend     POST /v1/verifications        ← your API key goes here
                    receives { id, url, ... }

2. Your page        sends the person to `url`     ← the browser only gets the url

3. Your backend     receives verification.decided ← the decision, signed
```

## Where the API key goes

**On your server, and nowhere else.** The call that creates the verification is the only one that
uses it. If the key reaches the browser, anyone can read it and create verifications in your name.

You give the browser **only the `url`**. It is single-purpose: it works for that verification
and nothing else.

## What you store

| Field | Where it lives | What for |
| - | - | - |
| `id` | Your backend | Link the verification to your own record |
| `customer_ref` | Your backend and your page | Your identifier for the person. Always send it |
| `url` | Only the browser, and only while it lasts | It is where the person goes |
| `session_token` | Nowhere: do not store it or log it | It is a credential |

## Environments

You pick the host per environment, the same pair scoring uses. There is no
`/verifications/sandbox` path: for identity you change the host, not the path.

Details: [Environments](https://docs.fraudeg.com/en/entornos.md). Summary:

| When | API base URL |
| - | - |
| Pre-official-integration | `https://sandbox-api.fraudeg.com/api` |
| Production | `https://api.fraudeg.com/api` |

A key from one environment does not work in the other, and verifications do not cross over between them.
The web app (`sandbox.fraudeg.com` / `fraudeg.com`) is the dashboard, not the API.

## The two ways to present the flow

| Option | What it looks like | When |
| - | - | - |
| Redirect | The person leaves your page, gets verified, and returns to the URL you set in `callback_url` | Works today, with no dependencies |
| Embedded | The verification opens inside your own page, without the person leaving it | With our web SDK, which we will document when we publish it |

Both use exactly the same `url` and the same decision by webhook. Switching from one to the other does not
touch your backend.

## What the browser never decides

When the person finishes, your page knows they **finished**, not that they were approved. The difference
matters: someone who closes the window also "finishes." The decision reaches your backend by webhook,
and it is the only source you should use to let someone through.

## Next step

[Your first verification](https://docs.fraudeg.com/en/identidad/primera-verificacion.md): the curl against your environment's API and its response.


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