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

# Idempotency

> The Deck API supports idempotency keys so you can safely retry requests without performing the same operation twice.

When creating or updating resources, include an optional idempotency key header in your request. If a network error or timeout occurs, you can resend the same request with the same key. Deck recognizes the key and returns the original response instead of repeating the operation.

#### Example header with idempotency key

```bash highlight={5} theme={null}
curl --request POST \
  --url https://live.deck.co/api/v1/jobs/submit \
  --header 'x-deck-client-id: <client-id>' \
  --header 'x-deck-secret: <client-secret>' \
  --header 'x-deck-idempotency-key: 00000000-0000-4fff-b000-ffffffffffff' \
  --header 'Content-Type: application/json'
```

## When to use idempotency keys

Idempotency keys are supported on all [`POST` calls to run a job](/api-reference-v1/jobs/run-a-job).

## How idempotency keys work in Deck

When a request with a unique idempotency key is received, Deck stores the result of that request, including the status code and body.

If the same key is used again:

* **If the parameters match:** Deck returns the original result, even if it failed (for example, with a `500` error).
* **If the parameters differ:** Deck returns a `409 Conflict` error to prevent accidental misuse.
* **After 24 hours:** idempotency keys can be safely reused.

## Key format

The idempotency key header must contain a unique identifier formatted as a [Version 4 UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_\(random\)). The key must be 36 total characters including dashes.

#### Example key

```bash theme={null}
--header 'x-deck-idempotency-key: 00000000-0000-4fff-b000-ffffffffffff'
```
