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

# Idempotency

> Retry a request safely without doing the work twice.

If a request times out, you can't tell whether it went through. Send an `Idempotency-Key` header and you can retry without sending the same message twice or escalating twice.

```bash theme={null}
curl -X POST https://api.getdecimal.ai/v0/chat \
  -H "Authorization: Bearer sk-de-..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2a9e-4b7d-4f0e-9a3b-2c8d5e7f1a20" \
  -d '{"message": "How do I configure SSO?"}'
```

Use a new UUID for each request, and reuse it only to retry that request. Keys can be up to 255 characters. Sending a message and escalating a conversation both accept the header.

Within 24 hours, a retry with the same key returns the original response with an `Idempotent-Replayed: true` header. Only successful responses are saved, so a request that failed can be retried with the same key.

Reusing a key with a different path or request body returns `409` with code `conflict`.


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