---
title: "Resend the code of an existing verification session"
method: POST
path: "/verify/resend"
tags: ["Phone Verification (OTP)"]
---

# Resend the code of an existing verification session

`POST /verify/resend`

## Request

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

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.

## Request body

- object
  - `session_id` string, 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 `200`

Code re-sent

- object
  - `session_id` string
  - `message_id` string
  - `to` string
  - `channel` 'sms' | 'whatsapp'
  - `status` string
  - `resend_after_seconds` integer: Seconds before this session accepts another resend
  - `expires_at` string, date-time
  - `sandbox` boolean: Present and true on env_test_ keys; nothing was delivered and nothing was charged
  - `simulated` boolean: Present and true on env_test_ keys
  - `sandbox_code` string: Sandbox keys only — never present on a live key

## Other responses

- `400`: Session already completed or invalid (INVALID_STATE), expired (SESSION_EXPIRED), or a non-numeric code requested over whatsapp (INVALID_CODE_TYPE)
- `402`: Insufficient balance (INSUFFICIENT_BALANCE)
- `404`: Session not found or expired (SESSION_NOT_FOUND). Also returned when a sandbox key targets a live session or vice versa — the message names the cause.
- `429`: Cooldown still open (OTP_COOLDOWN); Retry-After carries the remaining seconds
- `502`: The channel accepted nothing (DELIVERY_FAILED); nothing was charged. Retry over sms.

---

[API](https://skmtc.dev/envoisms/apis/envoisms-ma-api.md) · [All operations](https://skmtc.dev/envoisms/apis/envoisms-ma-api/llms.txt) · [OpenAPI document](https://skmtc.dev/envoisms/apis/envoisms-ma-api/revisions/662db074bd86?raw)
