Documentation

Idempotency

Retry safely without sending twice.

How it worksLive

Send an Idempotency-Key header (up to 128 characters) with any send, on native and Green-compatible routes. If a network error makes you retry, repeat the request with the same key: the same message is returned and nothing is sent twice.

Example
curl -X POST https://api.sendjade.com/api/v1/instances/$INSTANCE_UUID/messages/file \
  -H "Authorization: Bearer $SENDJADE_API_KEY" \
  -H "Idempotency-Key: invoice-1042-whatsapp" \
  -H "Content-Type: application/json" \
  -d '{ "chatId": "2348012345678", "url": "https://files.example.com/inv-1042.pdf", "fileName": "Invoice-1042.pdf" }'

# first call  -> 202 { "data": { "message": {...}, "duplicate": false } }
# repeat call -> 200 { "data": { "message": {...same...}, "duplicate": true } }   + header  Idempotent-Replayed: true
  • Use a stable key per business event, for example one per invoice, not a random value per attempt.
  • Keys are scoped to the instance.
  • On Green-style routes a replay returns the same idMessage.
  • The key identifies the message: the body of a repeated request is not compared.