InboboDocsMenu

Guides

Idempotency

Networks fail. An idempotency key lets you retry a send without ever messaging a customer twice.

Every POST /messages requires an Idempotency-Key header of 16 to 128 characters. Use one stable key per logical message, for example the record that triggered it plus the event name.

Header
Idempotency-Key: invoice-1042-sent-v1

What Inbobo does

SituationResult
First request with this keyThe message is created and queued. 202.
Same key, same channel, recipient and messageThe original result is returned. Nothing is sent again. 202.
Same key, different channel, recipient or message409 IDEMPOTENCY_MISMATCH. Nothing is sent.
Same key used by a different consumerIndependent. Keys are scoped to your consumer.

Retrying safely

  • If a request times out or the connection drops, you do not know whether it was accepted. Retry with the same key.
  • Never generate a fresh key for a retry. That is the one thing that can cause a duplicate.
  • Only channel_id, to and message are compared. purpose, consent_reference, attribution and correlation may differ between retries.
  • Errors are not remembered. A request rejected with 400 or 422 (including WINDOW_CLOSED) creates nothing, so you can send a corrected request, for example a template, with the same key.