Community timeouts and transient connection drops are an unavoidable actuality in distributed techniques. When a transactional message request occasions out, your utility faces a well-known dilemma: Retry the request and danger sending duplicate OTPs, order confirmations, and automatic voice calls, or simply maintain again and danger not delivering crucial info in any respect.
With idempotency key help now stay in Zoho CPaaS, you now not have to decide on between reliability and duplicate prevention. You’ll be able to safely retry failed or timed-out requests throughout e mail (API and SMTP), SMS, WhatsApp, and voice with out worrying about double-sending.

What’s an idempotency key?
An idempotency key’s a novel string or identifier like a UUID (Universally Distinctive Identifier) {that a} consumer generates and attaches to an API request so the server can safely acknowledge and ignore unintentional duplicate submissions.
Let’s perceive this higher with an instance. Think about you’re sending an OTP e mail, however your web connection drops earlier than you obtain a response. You’re not sure whether or not the e-mail was despatched, so that you retry the request. Now, the recipient might obtain the identical OTP e mail with the identical code twice. However, with an idempotency key connected, Zoho CPaaS acknowledges the retry as the identical request and blocks the duplicate ship.
How does it work?
When Zoho CPaaS receives a request with an idempotency key, it checks whether or not that key has already been processed inside a 24-hour window.
-
First submission: Zoho CPaaS processes the request usually and data the important thing.
-
Subsequent retries with the identical key: If a community glitch forces your app to retry inside 24 hours, Zoho CPaaS acknowledges the important thing, blocks the duplicate submission, and returns a TM_7001 (Request Denied–Duplicate idempotency key discovered) response so no duplicate message or name goes out.
Supported channels for idempotency keys in Zoho CPaaS
Idempotency keys work throughout all channels in Zoho CPaaS. This covers the entire ship APIs, together with single and batch e mail, template-based e mail, voice calls, SMS, and WhatsApp messages.
Idempotency keys are supported throughout all Zoho CPaaS sending endpoints (each /v1.1/ and earlier model /v1.0/).
|
Channel |
Endpoint/protocol |
How you can go the important thing |
|
Electronic mail (REST API) |
/v1.1/e mail, /e mail/batch, /e mail/template, /e mail/template/batch |
“idempotency_key” in JSON physique |
|
Electronic mail (SMTP) |
SMTP relay submissions |
x-tm-idempotency-key e mail header |
|
SMS |
POST /v1.1/sms |
“idempotency_key” in JSON physique |
|
|
POST /v1.1/whatsapp |
“idempotency_key” in JSON physique |
|
Voice |
POST /v1.1/voice |
“idempotency_key” in JSON physique |
How do you employ the idempotency key?
1. When utilizing it in a REST API request (e mail, SMS, WhatsApp, voice)
Embrace the idempotency_key string parameter (as much as 100 characters) instantly in your POST request payload:
{
“from”: { “handle”: “notifications@instance.com” },
“to”: [{ “email_address”: { “address”: “user@example.com” } }],
“topic”: “Your order has shipped”,
“htmlbody”: “
Your order is on its means.
“,
“idempotency_key”: “bc432346-67cf-4671-a572-ae2d0c27e4f2”
}
2. When utilizing it with SMTP e mail relay
Add the x-tm-idempotency-key header (as much as 100 characters) to your message headers:
|
From: notifications@instance.com To: consumer@instance.com Topic: Your order has shipped x-tm-idempotency-key:bc432346-67cf-4671-a572-ae2d0c27e4f2 Your order is on its means. |
Finest practices for dependable retries
-
Generate a novel key per distinct occasion: Use UUIDs or deterministic occasion IDs (like invoice-1042-reminder) so separate messages by no means collide.
-
Preserve the identical key throughout retries: Guarantee your retry employee reuses the very same idempotency_key when re-attempting a timed-out request.
-
Keep inside the the 100-character restrict and 24-hour window: Keys exceeding 100 characters return a TM_8001 (Measurement Exceeded) error, and deduplication stays lively for twenty-four hours after the preliminary request.
Wrapping up
One community timeout shouldn’t flip into three an identical OTPs or duplicate order confirmations. Including an idempotency key takes seconds, saves you from constructing customized safeguards, and retains your buyer expertise spotless when issues go sideways.
Able to make your transactional messaging, e mail, and voice workflows retry-safe? Take a look at the Zoho CPaaS idempotency key documentation to get began.
We hope this characteristic helps preserve your crucial transactional communications retry-safe and dependable. We’re at all times working to make your Zoho CPaaS expertise even higher. Within the meantime, observe us on X and LinkedIn for the newest updates and ideas!