TenkaTenka
Sign in

Tenka Help Center › Developer area › Idempotency

Idempotency

Retry a write without duplicating the record.

The rules

  • Send a unique value per operation (a UUID works) in the Idempotency-Key header of every POST.
  • Repeating the same key with the same body does not run again: the original response comes back, flagged by the replay header.
  • The same key with a different body gets 409. Generate a new key for each new operation.
  • The same key while the first call is still running gets 409 with Retry-After: 5.
  • A 5xx response does not freeze the key: retrying runs again.

In a batch the key covers the whole call, not each item: to resend only the failed items, use a new key.

Headers involved

HeaderDescription
Idempotency-KeyYou send: one unique value per operation.
Idempotency-ReplayedTenka returns true when the response is the stored replay.
Warning · X-Api-AvisoTenka returns it while the key is not mandatory and you did not send one.

Mandatory on writes from 2026-12-01

Until then, writes without the key are accepted and the response carries the Warning and X-Api-Aviso headers. After that date, they are refused with 400.

cURL
curl -X POST "https://tenka.app.br/api/v1/clientes" \
  -H "Authorization: Bearer $TENKA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "nome": "Comercial Aurora Ltda",
  "email": "contato@exemplo.com",
  "cpfCnpj": "12.345.678/0001-00",
  "telefone": "+55 11 99999-0000"
}'

POST /api/v1/clientes