Skip to main content
Outbound message creates accept an idempotency key. Replaying the same key returns the original result instead of placing a second message on the line.

Why it matters

Your infrastructure will retry:
  • HTTP timeouts after Comms already accepted the send
  • Queue redelivery
  • Deploy mid-request
  • Manual “run again” on a failed job
Without idempotency, customers get duplicate texts. With it, retries are free.

How to send the key

Either header or body (header preferred):

Choosing a key

GoodWhy
order-{id}-shippedStable per business event
booking-{id}-reminder-t24Distinct from other reminders
UUID generated once and stored on the job rowSafe if you persist it before POST
AvoidWhy
Date.now() onlyEvery retry is a new key
Random UUID recreated on each attemptSame problem
User-visible content of the bodyCollisions and encoding noise

Responses

StatusMeaning
202First acceptance — delivery will proceed
200 + "duplicate": trueSame key already processed — use returned message
Both should count as success in your application.

Scope

Idempotency applies to outbound sends (POST /api/v1/comms/messages). List endpoints are read-only and do not need a key.