Skip to guide
WhatsOS

BUILD WITH WHATSOS

From request
to verified.

Build phone verification into your website or app. Start in the sandbox, connect your business, then switch to live delivery.

REST API · JSON over HTTPS · Server-side integration

YOUR VERIFICATION FLOWAPI v1
  1. 01
    Request a codePOST /verifications
  2. 02
    Verify the responsePOST /verifications/{id}/check
  3. 03
    Complete the matching action once

    Bind the result to your server-side action session.

BASE URLhttps://whatsos.com/api/v1/otp

AuthenticationBearer API key
Test code123456
Code lifetime5 minutes

Choose who generates and verifies the OTP

WhatsOS-generated OTP: use the verification flow below. Send your own OTP: your software generates and verifies the code; WhatsOS delivers it using your existing API key and template.

Read the supplied-code delivery API guide

01

Create your project and key

Open your OTP workspace and select a test project. Create a scoped API key and store the secret on your backend. Test and live projects use separate credentials.

A safe place to start

Test delivery is simulated. No WhatsApp message is sent, and the verification code is 123456. Use a fictional number while building your integration.

Choose the scopes your backend needs
ScopePermission
otp:sendCreate and resend verification codes
otp:verifyCheck a submitted code
otp:readRead delivery and verification status
otp:cancelCancel a verification

Keep API keys out of browser JavaScript, public repositories and mobile binaries. Your application calls your backend; your backend calls WhatsOS.

Open your OTP workspace
02

Send an OTP

Request a code for the user's phone number. Use an opaque reference to associate the request with the action in your application.

POST/verificationsotp:send
cURL · server request
curl -X POST 'https://whatsos.com/api/v1/otp/verifications' \
  -H 'Authorization: Bearer YOUR_SERVER_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: login-send-001' \
  -d '{
    "to": "+12025550123",
    "purpose": "login",
    "reference": "opaque-action-session",
    "locale": "en_US"
  }'

Save the returned verification_id against your server-side action session. A 202 response means the request is queued; it does not mean the message was delivered.

Use a unique idempotency key for each operation. If the request times out, retry with the same key and body. Examples use placeholder credentials and a fictional phone number.

03

Verify the user's code

Pass the code entered by the user and the verification_id you saved. Use a new idempotency key for this check operation.

POST/verifications/{id}/checkotp:verify
cURL · server request
curl -X POST 'https://whatsos.com/api/v1/otp/verifications/VERIFICATION_ID/check' \
  -H 'Authorization: Bearer YOUR_SERVER_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: login-check-001' \
  -d '{"code":"123456"}'

Verify the result before completing the action

Require verified: true and status: verified from a successful check. Bind that result to the original recipient, purpose and action session before logging the user in.

A fresh check after consumption returns 409. Retrying the original successful operation returns its recorded result. Your backend must also deduplicate its own login or business action.

04

Handle status, expiry and resend

Delivery and verification are separate events. Read both statuses to understand the result of an OTP request.

cURL · read status
curl 'https://whatsos.com/api/v1/otp/verifications/VERIFICATION_ID' \
  -H 'Authorization: Bearer YOUR_SERVER_API_KEY'

delivery_statusWas the message delivered?

Tracks message delivery through the provider.

statusWas the code verified?

Tracks the verification challenge and its outcome.

Manage an existing verification
OperationEndpoint and behavior
GET/verifications/{id}

Read status with otp:read.

POST/verifications/{id}/resend

Replace the previous challenge after the 30-second cooldown. Requires otp:send.

POST/verifications/{id}/cancel

Invalidate the challenge. Requires otp:cancel.

Save the new verification_id returned by resend, replacing the previous ID in your server-side action session. Resend and cancel use an empty JSON object and a fresh idempotency key. Codes expire five minutes after creation. Five wrong checks lock a challenge; shared request limits survive resends.

05

Receive signed events

Add an HTTPS destination under Webhooks in the OTP dashboard. Events report verification success, expiry or lock, and message delivery or failure.

  1. Read X-WhatsOS-Timestamp and reject timestamps outside a five-minute tolerance.
  2. Compute HMAC-SHA256 over timestamp + '.' + rawBody using your webhook secret.
  3. Prefix the hex digest with sha256= and compare it with X-WhatsOS-Signature using a constant-time comparison.
  4. Deduplicate X-WhatsOS-Event-Id. Return a 2xx response after durable processing.

Use the original raw request body for signature verification. Callbacks may arrive more than once, retry for up to 24 hours and be replayed after failure. A delivered message is never proof of a verified recipient.

06

Move from sandbox to live

Complete your sender setup before switching your integration to live credentials.

  • Connect your production WhatsApp business number.
  • Select an approved authentication template with a Copy code button and five-minute expiry text.
  • Complete sender and template readiness checks.
  • Activate your subscription and enable the live project when service activation is available.
  • Use live API keys and run a controlled test for a recipient who requested the code.
Your setup and your payment are separate steps

Payment does not complete business onboarding or guarantee template approval. Business app coexistence is available only for eligible numbers. Test keys cannot send through live projects.

Continue your OTP setup

REFERENCE

Errors & retries

Inspect the response error code and message. Preserve your operation key when retrying the same request.

Common HTTP responses
StatusWhat to check
400Invalid input. Check your request body and headers.
401Invalid or missing API key.
403Scope, quota or setup does not allow this operation.
404The verification was not found in this project.
409State or idempotency conflict. Inspect the returned error.
429Rate limit reached. Honor Retry-After. After a definitive rejection, start a new attempt with a new idempotency key.
503Temporary unavailability. Retry with the same operation key.

YOUR SERVICE

No transaction charges from WhatsOS.

Your annual licence includes OTP API access, with no additional WhatsOS fee for each OTP transaction. New live requests require a current subscription.

Renewal is manual, with no automatic debit. Existing projects retain their agreed billing terms; your workspace shows the applicable price. See the pricing page for the current package, GST and renewal total.

View current pricing

NEXT STEP

Try it in your sandbox.

Create a test key and follow the request examples.

Open OTP dashboard

Invoices & receipts API

Send transactional WhatsApp messages from POS, websites, Shopify and billing software using your developer project.

Read the transactional messaging guide