---
title: "Send a verification code"
method: POST
path: "/v1/messaging/verify/verifications"
tags: ["Verify"]
---

# Send a verification code

`POST /v1/messaging/verify/verifications`

## Request

- Base URL: `https://apihub.co.il`
- URL: `https://apihub.co.il/v1/messaging/verify/verifications`
- Auth: HTTP bearer

Generate a one-time code, deliver it to the recipient, and store only
its hash. Check the user-typed code with
POST /v1/verify/verifications/{verificationId}/check.

Re-POSTing for the same (channel, to) while a verification is active
RESENDS a fresh code on the existing verification (200 with
`resend: true`) instead of creating a new one; resends are limited to
one per 60 seconds (429 with `retryAfterSeconds` inside the cooldown).
The stored brandName/codeLength/ttlMinutes win on a resend.

Codes deliver from a number on your account (`from` optional when
you own exactly one number on the channel), always with a fixed
template:

- `sms`: from an SMS-enabled number. Each accepted send bills one
  verification fee plus the standard message rate.
- `whatsapp`: from a connected WhatsApp number, as a Meta
  AUTHENTICATION template with a copy-code button. The first
  WhatsApp verification on a WhatsApp Business Account creates the
  `zernio_verify_code` template there and answers 422
  `template_pending` until Meta approves it (usually minutes; retry
  after `retryAfterSeconds`). Meta fixes the message text, so
  `brandName` is not shown and the code's validity is not stated in
  the message (`ttlMinutes` is still enforced). Each accepted send
  bills one verification fee; Meta bills its authentication rate to
  your WhatsApp Business Account.


**Billing:** Request; paid actions are priced in credits (see GET /v1/messaging/prices) · **Rate limit:** 60/min

## Headers

- `Idempotency-Key` string
- `X-Tag` string

## Request body

- object
  - `to` string, required: E.164 phone number. WhatsApp only delivers to a phone number, never to a username.
  - `from` string: The number on your account to send from: an SMS-enabled number for `sms`, a connected WhatsApp number for `whatsapp`. Defaults to your only number on that channel.
  - `channel` 'sms' | 'whatsapp', required
  - `brandName` string: Your app or business name, rendered in the SMS message. Defaults to your account name. Not shown on WhatsApp, where Meta fixes the message and shows your WhatsApp display name. Letters, numbers, and basic punctuation only.
  - `codeLength` integer
  - `ttlMinutes` integer

## Response `200`

Completed

- object
  - `id` string: Execution id — stable across internal retries; use it with GET /v1/executions/{id}
  - `status` 'pending' | 'processing' | 'completed' | 'partial' | 'failed' | 'cancelled' | 'timeout'
  - `operation` string
  - `tag` string, nullable: Your X-Tag, if sent
  - `created_at` string, date-time
  - `completed_at` string, date-time, nullable
  - `output` object: A managed OTP verification. The code itself is never returned or stored (hash only).
    - `id` string
    - `to` string
    - `resend` boolean: Present on create responses: true when an active verification was resent instead of created.
    - `status` 'pending' | 'approved' | 'expired' | 'max_attempts_reached' | 'canceled' | 'delivery_failed'
    - `channel` 'sms' | 'whatsapp'
    - `attempts` integer
    - `createdAt` string, date-time
    - `expiresAt` string, date-time
    - `sendCount` integer: Accepted deliveries (initial send + resends); each bills one verification fee.
    - `lastSentAt` string, date-time, nullable
    - `maxAttempts` integer
    - `deliveryStatus` 'delivered' | 'read' | 'failed' | 'null', nullable: WhatsApp only, returned by GET /v1/verify/verifications/{verificationId} (null on create and check responses): what Meta reported for the latest send, null until it reports. A code that never reached the recipient (for example a number not on WhatsApp) reads failed, with the Meta error in deliveryErrorCode. failed does not settle the verification: Meta can report failed and later deliver the same message. Reported for at least an hour after the send, well past any code's expiry.
    - `deliveryErrorCode` integer, nullable: Meta error code when deliveryStatus is failed (e.g. 131026, message undeliverable).
  - `error` string, nullable
  - `usage` object
    - `credits_charged` number, nullable
    - `credits_reserved` number
    - `estimated_credits` number
    - `cost_source` 'provider_reported' | 'calculated' | 'estimated' | 'null', nullable
    - `provider_usage` object, nullable: Normalised consumption, e.g. { VIDEO_SECOND: 22.4 }
  - `balance` object
    - `available` number
    - `reserved` number

## Other responses

- `400`: Invalid input
- `402`: Insufficient credits / project budget
- `404`: Resource not found (or not yours)
- `429`: Rate limited
- `503`: Service temporarily paused

---

[API](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai.md) · [All operations](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/revisions/a8caa42835ce?raw)
