Skip to main content
Every mutating request to Bravado (POST, PATCH, DELETE) requires an Idempotency-Key header. This lets you safely retry after network failures without creating duplicate orders, cancellations, withdrawals, or copy-trade subscriptions.

Key format

  • Send Idempotency-Key: <uuid> where <uuid> is a UUID v4.
  • Generate a fresh UUID for every distinct logical operation.
  • Reuse the same UUID only when retrying a request that failed with a network error or timeout.
  • Keys are 36 characters and must match the UUID v4 canonical format.

Scope

Idempotency keys are scoped to your API key. The same UUID sent under a different token is a different key. Keys are also scoped to the target endpoint. The same UUID sent to two different endpoints is treated as two separate operations.

Retention window

Idempotency keys are retained on the Bravado side for a bounded window. Retries received within the window return the original response with Idempotent-Replayed: true set. Retries received after the window has expired are treated as a fresh request and can create a new operation.

Replay behavior

On a successful match against a prior request:
  • The response body is exactly the original response.
  • The HTTP status is the original status.
  • The response includes Idempotent-Replayed: true.
  • No new operation is executed.

Conflicting payloads

If you reuse an idempotency key but change the request body, Bravado returns:
Rules:
  • Do not reuse a key for a semantically different operation.
  • Do generate a new UUID for each new intended operation.

When to retry

Retry with the same key when:
  • The network dropped mid-request and you never received a response.
  • You received a 5xx response.
  • You received a 429 with Retry-After (retry after honoring the header).
Do not retry with the same key when:
  • You received a 4xx response other than 429. Fix the request first, then submit with a new key.
  • Enough time has passed that the key may have expired (see retention window above).

Example

Placing an order with retry-safe idempotency:
The same key is reused across all three attempts. If the first attempt landed and the response was lost, the retry returns the same order with Idempotent-Replayed: true.