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

# Idempotency

> Send an Idempotency-Key so a retried request cannot place a second call.

Some requests have effects you cannot undo, such as dialing a phone. These endpoints require an `Idempotency-Key` header:

* `POST /v1/calls`
* `POST /v1/campaigns/{id}/start`
* `POST /v1/contacts/imports`

Use a unique value for each logical operation, for example a UUID. Keys are 8 to 255 characters.

```bash theme={null}
curl https://api-us.larynth.com/v1/calls \
  -H "Authorization: Bearer $LARYNTH_API_KEY" \
  -H "Idempotency-Key: 6f1c2f6e-8f0b-4d57-b4c5-3a5e8c1d9a10" \
  -H "Content-Type: application/json" \
  -d '{
    "assistant_id": "3f1c6e0a-5b1d-4c3e-9a57-2d0f4c8d1e11",
    "from_e164": "+14155550100",
    "to_e164": "+14155550123",
    "purpose": "informational"
  }'
```

## Behavior

* Send the same key and the same body again within 24 hours and you get the stored response. No second call is placed.
* Send the same key with a different body and you get `409` with `idempotency.key_reused`.
* Send the same key while the first request is still running and you get `409` with `idempotency.in_progress`. Wait a moment and retry.
* Leave the header out on an endpoint that requires it and you get `400` with `idempotency.key_required`.

Generate the key once, before the first attempt, and reuse it on every retry of that attempt.


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