SMSLocal
OTP & Transactional

Idempotency keys for OTP sends

Prevent duplicate OTPs when your app retries. Pass a UUIDv4 Idempotency-Key header on /v2/otp/send and we return the original response without triggering a new send.

2 min readUpdated 14 Mar 2026

If your application retries a send request because of a network blip, you can end up sending two OTPs to the same user. Idempotency keys prevent this completely.

How to use them

  1. 01Generate a unique key (we recommend a UUIDv4) for each OTP request.
  2. 02Pass it in the Idempotency-Key header on POST /v2/otp/send.
  3. 03If the same key arrives within 24 hours, we return the original response without sending a second OTP.
  4. 04Keep the key until you receive a terminal status (delivered, failed, or expired).

Did this article help?

If something isn't clear or the steps don't match what you're seeing, tell us and we'll fix the doc the same day.