Get Started
Idempotency
Understanding Grid’s idempotency system and implementing idempotent operations
Grid implements idempotency to ensure that operations can be safely retried without creating duplicate resources or processing the same request multiple times.
How it works
When you make a request to Grid’s API, you can include an x-idempotency-key
header. If you retry a failed request with the same key, Grid ensures that the operation is only processed once.
Using idempotency keys
Include an x-idempotency-key
header in your request:
Key requirements
- The
x-idempotency-key
header is optional but recommended for POST requests - Keys must be unique for each operation
- Keys are case-sensitive
- Keys can contain letters, numbers, hyphens, and underscores
Validity periods
Most idempotency keys are valid for 24 hours. However, intent creation idempotency keys are only valid for 2 minutes. After this period, you must generate a new key for subsequent intent creation requests.