Skip to main content
Write operations in the Vendaze API support idempotency via the Idempotency-Key header. This allows you to safely retry a request if you did not receive a response, without the risk of creating duplicate records.

How to use it

Include the Idempotency-Key header with a unique string you generate:
If you send the same request again with the same Idempotency-Key, the API returns the original response without processing it again.

Key format

The key must be:
  • A string of up to 255 characters
  • Unique per operation (recommended: UUID v4)
  • Generated by your system, not reused across different operations

Behavior by scenario

Why PATCH and DELETE are naturally idempotent

PATCH and DELETE endpoints do not require the Idempotency-Key header because they are idempotent by definition:
  • PATCH: applying the same update twice produces the same result. Setting full_name to "Ana Costa" a second time leaves the record unchanged.
  • DELETE: deleting a record that has already been deleted returns 404. The end state (record does not exist) is the same regardless of how many times you call it.
The Idempotency-Key header is only necessary for POST operations, where each call without a key would create a new record.

Endpoints that support idempotency

The Idempotency-Key header is accepted on all write endpoints:
  • POST /v1/people
  • POST /v1/companies
  • POST /v1/deals

Tracking idempotency keys in your database

For operations where you need an audit trail or want to correlate your internal records with API responses, store the idempotency key alongside the created resource:
This pattern lets you recover from failures by looking up the idempotency_key in your database and checking whether the operation succeeded before retrying.
Idempotency keys persist for 24 hours. Always use a UUID v4 generated at the time of the operation. Never reuse keys across different operations.

Key conflict

If you send a previously used key with a different body, the API returns:
This protects against bugs where the same key is accidentally reused for two distinct operations.