Verify

Send a verification code

Changed on

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.
post/v1/verify/verifications

Request

  • Base URL: https://zernio.com/api
  • URL: https://zernio.com/api/v1/verify/verifications
  • Auth: HTTP bearer

Request body

channel'sms' | 'whatsapp' required
tostring required

E.164 phone number. WhatsApp only delivers to a phone number, never to a username.

fromstring

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.

brandNamestring

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.

codeLengthinteger
ttlMinutesinteger

Response

Active verification found: a fresh code was resent (resend: true).

idstring
status'pending' | 'approved' | 'expired' | 'max_attempts_reached' | 'canceled' | 'delivery_failed'
channel'sms' | 'whatsapp'
tostring
expiresAtstring date-time
attemptsinteger
maxAttemptsinteger
sendCountinteger

Accepted deliveries (initial send + resends); each bills one verification fee.

lastSentAtstring date-time nullable
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.

deliveryErrorCodeinteger nullable

Meta error code when deliveryStatus is failed (e.g. 131026, message undeliverable).

createdAtstring date-time
resendboolean

Present on create responses: true when an active verification was resent instead of created.

Changes

    • warning

      added the new account enum value to the / response property for the response status

    • warning

      added the new account enum value to the / response property for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status