Phone Verification (OTP)

Resend the code of an existing verification session

Re-delivers the code of a still-pending session, optionally over a different channel. Available on every plan, including Starter — it needs the same verify scope as /verify/send and nothing more.

The code itself is unchanged, so an earlier message that arrives late is still valid. Whichever channel you choose, the session's expiry and remaining attempts are untouched.

Cooldown. A resend is refused with OTP_COOLDOWN (429) until the window opened by the previous delivery has passed: 60 s after a WhatsApp delivery, 30 s after an SMS one. /verify/send reports the applicable figure as resend_after_seconds, and GET /verify/{session_id} reports the live countdown as resend_available_in_seconds. The window is per account and destination — other customers' traffic to the same number does not affect yours. Retry-After on the 429 carries the exact remaining seconds.

Sandbox keys. An env_test_ key simulates: nothing is delivered and nothing is charged. The response carries sandbox: true alongside the sandbox_code, so a simulated resend is never mistaken for a delivered one. A sandbox key can only resend sessions it created, and a live key only live sessions.

post/verify/resend

Request

  • Base URL: https://api.envoisms.ma/v1
  • URL: https://api.envoisms.ma/v1/verify/resend
  • Auth: HTTP bearer

Request body

session_idstring required

The session returned by /verify/send. Must still be pending and unexpired.

channel'sms' | 'whatsapp'

Channel for this delivery. Defaults to sms, which is also the useful fallback when a WhatsApp code did not arrive. whatsapp requires the session's code to be 4–8 numeric digits, the only shape the authentication template accepts.

Response

Code re-sent

session_idstring
message_idstring
tostring
channel'sms' | 'whatsapp'
statusstring
resend_after_secondsinteger

Seconds before this session accepts another resend

expires_atstring date-time
sandboxboolean

Present and true on env_test_ keys; nothing was delivered and nothing was charged

simulatedboolean

Present and true on env_test_ keys

sandbox_codestring

Sandbox keys only — never present on a live key

Example response

{
  "status": "sent"
}

Changes

No recorded changes to this operation across all 1 revision of this API.