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

# Idempotency

> Prevent duplicate create attempts with X-Idempotency-Key.

Every create request requires a unique, caller-controlled
`X-Idempotency-Key`. The key provides at-most-once admission, not response
replay.

```text theme={null}
X-Idempotency-Key: invoice-1042-attempt-1
```

## Single-use behavior

Once an authenticated, schema-valid request reaches the operation, Slash
permanently consumes its key for that operation and legal entity whether the
operation succeeds or fails. Every later request with that key in the same
scope returns `409 conflict`, even if its body is identical. A `409` does not
replay the original response and does not prove that the resource was created.

Generate and persist the key with the intended request before sending it. When
the response arrives, store the returned resource id.

## Recovering after a timeout

Do not resend a timed-out request with the same key, and do not immediately
send it with a new key. Use the resource's list endpoint to reconcile the
request, then retrieve a matching resource by id to confirm its current state.
Create a new key only after you have established that you intend to make a new
create attempt.
