Skip to main content
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

curl --request POST \
  --url https://sandbox.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.

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. The key must be 36 total characters including dashes.

Example key

--header 'x-deck-idempotency-key: 00000000-0000-4fff-b000-ffffffffffff'
I