Zernio
APIFor you
Zernio
APIFor you
API Reference

Verify

Send a verification codePOSTGet a verificationGETCheck a verification codePOST
Dashboard
OverviewPlatformsAPI ReferenceResources
Verify

Send a verification code

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

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.verify.createVerification({  body: {    channel: 'sms',    to: 'string',  },});console.log(data);
{  "id": "string",  "status": "pending",  "channel": "sms",  "to": "string",  "expiresAt": "2019-08-24T14:15:22Z",  "attempts": 0,  "maxAttempts": 0,  "sendCount": 0,  "lastSentAt": "2019-08-24T14:15:22Z",  "deliveryStatus": "delivered",  "deliveryErrorCode": 0,  "createdAt": "2019-08-24T14:15:22Z",  "resend": true}
Was this page helpful?

Upload an RCS logo or banner

Uploads an image and returns a public URL for `profile.logoUrl` or `profile.heroUrl`. The image is cropped and compressed to the carriers' exact rules (logo 224x224 under 50 KB, banner 1440x448 under 200 KB).

Get a verification

Current state of a verification. `status` is effective (a pending code past its expiry reads as `expired`). Verification records are deleted 24 hours after creation, after which this returns 404.

channel*string

Value in

  • "sms"
  • "whatsapp"
to*string

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.

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.

Lengthlength <= 30
codeLength?integer
Range4 <= value <= 8
Default6
ttlMinutes?integer
Range1 <= value <= 15
Default10