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

# Idempotency

> Safely retrying mutating FLO Partner API requests

Mutation requests that create sessions or resources require an `Idempotency-Key`
header.

```bash theme={null}
curl -X POST https://api.ionage.in/public/fleets/v1/drivers \
  -H "x-api-key: your-api-key" \
  -H "Idempotency-Key: 8b52e548-4e34-4d2c-9b53-c3cb35f95e66" \
  -H "Content-Type: application/json" \
  -d '{"name": "Ananya Rao", "phone_number": "+919876543210"}'
```

## Semantics

Use a client-generated UUID. Keys are retained for **at least 24 hours**.

| Replay | Result |
| - | - |
| Same key, same request body | The original result is returned; nothing new is created |
| Same key, different request body | `409 Conflict` |
| New key | Treated as a new request |

## Why it matters

A network timeout does not tell you whether the server acted. Retrying a session start
or a driver onboarding without a key risks charging twice or creating a duplicate
record. With a key, the retry is safe: generate the key once, before the first
attempt, and reuse it for every retry of that same logical operation.

> [!WARNING]
>
> Generate the key per logical operation, not per HTTP attempt. Generating a fresh
> UUID inside your retry loop defeats the mechanism entirely.

Conflicts surface through the standard error envelope:

```json theme={null}
{
  "error": {
    "code": "CONFLICTING_RESTRICTION",
    "message": "the request conflicts with the current resource state"
  }
}
```


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