POST, PATCH, and DELETE requests accept an Idempotency-Key header. Retry with the same key and Deck returns the original response instead of performing the operation again. GET requests are naturally idempotent and do not require a key.
How it works
Include anIdempotency-Key header on any POST, PATCH, or DELETE request.
- Same parameters: Deck returns the cached response. The operation is not repeated.
- Different parameters: Deck returns a
409 Conflictwith anidempotency_errorto prevent accidental misuse. - After 24 hours: the key expires and can be reused.
When to use them
Use idempotency keys on any create operation where a duplicate would cause problems:| Operation | Why |
|---|---|
| Storing a credential | Prevents duplicate credentials for the same user |
| Running a task | Prevents the same task from executing twice |
| Creating agents, sources, tasks | Prevents duplicate resources |
| Creating event destinations | Prevents duplicate webhook subscriptions |
| Updating or deleting resources | Guarantees the operation happens exactly once |
GET requests. Reads are naturally idempotent.
Key format
Keys can be any string up to 256 characters. Keys longer than 256 characters are rejected with a400 error.
| Pattern | Example | When to use |
|---|---|---|
| Business logic key | user_456_run_task_789 | When the operation maps to a domain action |
| Request identifier | req_20260218_abc123 | When you track requests in your system |
| UUID | 550e8400-e29b-41d4-a716-446655440000 | When you need a guaranteed-unique random key |
Generating keys
Retry pattern
A typical retry flow with idempotency:Error handling
Key reuse with different parameters returns HTTP409:
400: