Guides/For developers

Need to send verification codes (OTP) from my application?

Two endpoints — we handle the code, expiry, attempt limits and storage. 3 min read

Almost every application needs phone verification, and almost every developer rewrites the flow — usually with the same holes: the code stored in plain text, no expiry, no attempt limit, and reusable forever.

WACO provides that flow complete. Your application only has to draw the screen.

Enabling it (once)

Open Developer in the dashboard → the Ready-made OTP card → press Enable OTP. We create the official verification template on your own WhatsApp number. Templates of this kind are usually approved by Meta instantly, and Meta writes the wording — you do not have to think about the sentence.

1. Send a code

POST /api/v1/otp/kirim
Authorization: Bearer waco_YOUR_KEY
Content-Type: application/json

{ "nomor": "628123456789", "ref": "order-123" }

Response:

{ "ok": true, "kedaluwarsa_pada": "2026-08-14T10:05:00.000Z" }

ref is yours to fill — a transaction id, a user id, anything. It comes back on verification, so you do not need to keep the mapping yourself.

2. Verify the code

POST /api/v1/otp/periksa
Authorization: Bearer waco_YOUR_KEY
Content-Type: application/json

{ "nomor": "628123456789", "kode": "123456" }
{ "ok": true, "valid": true, "ref": "order-123" }
The verify endpoint always answers 200 as long as your API key is valid. A wrong code is a normal answer, not an HTTP failure — if we returned 4xx, many clients would treat it as a network problem and retry. Check the valid field, not the status code.

On failure there is a machine-readable alasan (reason):

alasanMeaning
salahCode does not match. sisa_percobaan tells you the attempts left.
kedaluwarsaOlder than 5 minutes. Request a new code.
terlalu_banyak_percobaanFive wrong attempts. A new code must be sent.
sudah_dipakaiCorrect code, but it was already used.
tidak_adaNo code was ever sent to that number.

The rules we already enforce

Cost

Every code is one authentication-category message — billed by Meta directly to your account at their rate, with no markup from us. Rates differ by the recipient's country; look yours up on Meta's rate card.

The machine spec is in OpenAPI. Message not arriving? See the diagnosis guide.

Still stuck after following this guide? Contact us from the dashboard — attach a screenshot if you have one, it speeds everything up.