Skip to main content
All POST endpoints accept an Idempotency-Key header. If two requests share the same key, the second returns the cached response from the first instead of creating a duplicate resource. This is critical for Vision API operations that consume credits. A network timeout during POST /compare shouldn’t cost you twice.

Usage

Pass a unique key (we recommend UUIDv4) in the Idempotency-Key header:
If the request succeeds, any subsequent request with the same key returns the original 202 response — no new job is created and no credits are charged.

Behavior

Key Rules

  • Keys are scoped to your organization. Two different organizations can use the same key.
  • Keys expire after 24 hours. After expiry, the same key can be reused.
  • Keys must be between 1 and 256 characters (alphanumeric, hyphens, and underscores).
  • Sending a different request body with an existing key returns a 409 Conflict error.

Response Headers

When a cached response is returned, the response includes:
On the first request:

When to Use

Use idempotency keys on any POST that creates resources or starts jobs:
  • POST /drawings — prevent duplicate drawing processing
  • POST /drawings/{id}/compare — prevent duplicate comparisons
  • POST /compare — prevent duplicate analysis
  • POST /parse — prevent duplicate parsing
You don’t need idempotency keys on GET, PATCH, or DELETE — these are naturally idempotent.

Example: Retry with Idempotency