# Idempotency and retries

Networks fail. If a request times out, you can't tell whether the verification ran, or whether you were charged. To retry safely, send an `Idempotency-Key` header:

```
Idempotency-Key: 6f1c2a90-order-1042
```

- **Same key, same body:** you get the original verification back with the same `id`, and you are not charged again.
- **Same key while the first attempt is still running:** you get `409`. Wait a moment, then retry with the same key.
- **Same key, different body:** you get `409`. A key is tied to the request it was first used with.
- **Failed verification (`502`):** the key is released, so retrying with the same key runs the check again.
- Keys are scoped to your organization. A key is up to 255 characters; a UUID or your own order or reference number works well.

## Recommended retry policy

| Response | Retry? |
| --- | --- |
| Timeout or connection error | Yes, with the same `Idempotency-Key` |
| `502` with `retryable: true` | Yes, after a back-off (e.g. 2 s, 10 s, 60 s) |
| `429` | Yes, after a back-off |
| `400`, `401`, `402`, `403`, `409` | No; fix the cause first |
