Don’t send twice
Give each send a unique key so a retry doesn’t message them again.
1 min read
Add an optional header when you call POST /v1/messages/send:
Idempotency-Key: order-2048-confirm After a successful send, Kenalko remembers that key for 1 hour. Reusing the same key in that window returns the original result — no second message.
Example
curl -sS -X POST "$BASE/v1/messages/send"
-H "Authorization: Bearer $KEY"
-H "Idempotency-Key: order-2048-confirm"
-H "Content-Type: application/json"
-d '{"to": "peer_username", "message": "Your order #2048 is confirmed"}' Tips
- Use something stable per business action (order id, invoice number).
- Retry a failed request with the same key.
- Do not reuse a key for a different recipient or different message body.