Skip to content

How do you send login codes over WhatsApp?

You send one request to Sema with the customer's number, and Sema makes a six-digit code and sends it through your approved authentication template. A second request checks what the customer typed. Nobody at your business ever sees the code, and each one is charged as an authentication message, from KES 0.60 on Scale to KES 0.73 on Solo for a Kenyan number.

Updated 2026-12-02

The two requests

Start: POST /api/v1/verifications with the number (and, if you have it, the address of the person asking). It answers that the code is pending and when it expires. An Idempotency-Key is required, so a retry cannot send, and charge for, a second code.

Check: POST /api/v1/verifications/{id}/check with what the customer typed. Let them in only when the answer says valid: true. That is true once: checking the same code again answers valid: false, so a form sent twice fails safe.

The rules every code follows

  • A code lasts ten minutes.
  • Five wrong tries end it. After that even the right code is refused.
  • Five codes an hour may go to one number. A sixth is refused, and the answer says how many seconds to wait.
  • If you send the address of the person asking, one address may ask for ten codes an hour, whatever numbers it tries. That stops one visitor walking down a list of numbers.
  • A new code for a number cancels the one still waiting.

Nobody at your business sees the code

In the customer’s conversation the message shows six dots, not the code. The code is kept only until it has been sent, and what Sema keeps to check against is not the code itself. That is why Sema’s ordinary send refuses authentication templates: a code sent that way would be one Sema did not make, cannot check and would sit in plain sight.

The template Meta requires

WhatsApp only carries a login code in an authentication template with a copy-code button, and the same code must be in the message and on the button. Make one in Templates, and wait for Meta to approve it. Until one is approved, the first request is refused and says so.

Try it without a phone

A test key sends nothing and charges nothing, and the code is always 000000. It goes through the same checks as a live code, so what works with a test key works with a live one.

What a login code costs, all in

Meta’s price for a login code depends on the country of the number. These are the all-in prices on two plans, as shown before you send.

Number inStarterScale
KenyaKES 0.68KES 0.60
NigeriaKES 1.13KES 0.95
GhanaKES 0.68KES 0.60
UgandaKES 0.68KES 0.60
TanzaniaKES 0.68KES 0.60
South AfricaKES 1.28KES 1.07
United KingdomKES 3.72KES 2.94

Other countries and plans are in the calculator on the pricing page.

Alerts and updates

Order, delivery and appointment updates go as update templates, sent through the same API. They are charged as updates, at the price in the table on the pricing page. Keep a sales line out of them: WhatsApp charges an update with one as an offer.

Questions people ask next

Can I send a login code over WhatsApp?

Yes. Sema makes a six-digit code and sends it through your approved authentication template, then tells you whether the code your customer typed is the right one.

How long does a WhatsApp login code last?

Ten minutes, with five wrong tries allowed. After five wrong tries the code is dead, even if the right one is typed later.

Can my staff see the code?

No. The conversation shows six dots, and the code is kept only until it has been sent.

Can I test without sending real messages?

Yes. A test key sends nothing and charges nothing, and the code is always 000000.

Where this comes from

Try Sema free for 14 days.

Start free