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

# Signature and delivery

> Headers, how to verify the notification is ours, secret rotation, and what we guarantee

This applies to **all** events in the [catalog](https://docs.fraudeg.com/en/webhooks.md#event-catalog): there is only
one channel.

## Headers

```text theme={null}
X-FraudEG-Event:      verification.decided
X-FraudEG-Delivery:   dlv_01j9c2k4m7q8r5t3v6x9z2b4d7
X-FraudEG-Timestamp:  1789268113
X-FraudEG-Signature:  v1=9f86d0818884...
```

`X-FraudEG-Delivery` identifies the **attempt** and changes on every retry. `X-FraudEG-Event` lets you
route before parsing.

## Verify the signature

Compute `HMAC-SHA256(timestamp + "." + raw_body, secret)` in hexadecimal and compare it against
each `v1=` value in the header, in constant time.

```python theme={null}
import hmac, hashlib, time

def verify(raw_body: bytes, headers: dict, secrets: list[str]) -> bool:
    timestamp = headers["X-FraudEG-Timestamp"]
    if abs(time.time() - int(timestamp)) > 300:
        return False
    message = timestamp.encode() + b"." + raw_body
    presented = headers["X-FraudEG-Signature"].split(",")
    for secret in secrets:
        expected = "v1=" + hmac.new(secret.encode(), message, hashlib.sha256).hexdigest()
        if any(hmac.compare_digest(expected, p.strip()) for p in presented):
            return True
    return False
```

Three things matter, and skipping any of them is a real bug:

* **Use the raw bytes**, before parsing the JSON. Going through a parser can reorder keys or
  change how a number is written, and your signature stops matching for reasons nobody can
  debug.
* **Compare in constant time.** An `==` between strings leaks the signature byte by byte.
* **Check the timestamp.** Reject anything older than five minutes, or a captured delivery
  stays valid forever.

We never send an unsigned delivery. If your company has no secret, deliveries are
held and the log says so.

### Rotate the secret

The header can carry **more than one** `v1=` value, and during a rotation it carries two. That is why the
example loops over a list:

1. Rotate in the dashboard. The new secret is shown only once; the old one keeps signing for 24 hours.
2. Add the new one to your verifier, alongside the old one.
3. Once you see it verifying, remove the old one.

A verifier with a single fixed secret breaks on rotation day. Write the loop now.

## What we guarantee, and what we do not

* **At least once.** Deduplicate by `event_id`. Two endpoints of the same company receive the
  same `event_id` for the same fact.
* **No guaranteed order.** Within the same object (a verification, an analysis, a monitor
  notification), the most recent `occurred_at` wins.
* **A 2xx is success.** Anything else is retried, including a 3xx: we do not follow redirects,
  because a stale redirect or a compromised DNS would deliver signed payloads to a host you
  never registered.
* **Respond quickly.** A delivery times out after 10 seconds. Answer 2xx and do the work afterward.
* **Retries are bounded.** Eight attempts spread over about 28 hours; after that the delivery
  is flagged, visible in the dashboard, and can be resent manually.
* **A dead endpoint gets paused.** If nothing succeeds for 24 hours we stop sending and
  notify you. What we owed you stays queued and goes out when you resume the endpoint; anything waiting more than
  72 hours is considered abandoned.
* **We do not guarantee delivery.** That is why the next section is not optional.

Notifications are also queued for a paused endpoint and go out when you resume it. Those that wait
more than 72 hours are considered abandoned: do not wait for them, reconcile.

## Reconcile anyway

Whatever delivery missed is covered by a daily read. It is exactly the case that a
bounded retry budget leaves open: it is part of the contract, not a patch.

| Events | How you reconcile |
| - | - |
| `transaction.analysis.*` | Go through the `transaction_id`s with no result and query [`GET /v1/transactions/{id}/analysis`](https://docs.fraudeg.com/en/referencia/estado-analisis). The status is kept for 72 hours |
| `verification.*` | List the previous day's verifications with [`GET /verifications`](https://docs.fraudeg.com/en/referencia/verificacion) |
| `monitor.*` | There is no API read: each monitor's history is in the dashboard |

```bash theme={null}
curl "https://api.fraudeg.com/api/v1/verifications?status=DECIDED&from=2026-09-12T00:00:00&to=2026-09-13T00:00:00" \
  -H "X-Api-Key: your_api_key"
```

In pre-official-integration the host is `https://sandbox-api.fraudeg.com/api`. See
[Environments](https://docs.fraudeg.com/en/entornos.md).


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