Skip to main content
By the end of this page your server sends a code to your phone and checks the code you type. It takes two requests and a test key, and you can do it while your application is still in review.

Hand this to your coding agent to wire Tawked Verify into your project.

Open in Cursor
Before you start
  • A Tawked account with an application that has Verify. Sign up if you have none.
  • The account owner’s phone at hand: a test key sends only to it.
Want to see it work before writing code? Open Verify → Test in the console. It sends a test code to the account owner’s phone, checks the code you type, and then shows the same two requests with your test key in them, ready to copy.
1

Create a test key

In the console, open your application, then Application settings → API keys. Choose Create a key, set Type to Test, and select Create test key. Copy the key (tk_test_...): it is shown in full only once.Put it in an environment variable on your server:
.env
A test key sends real SMS, but only to the phone the account owner verified at signup, stamped [TEST], and at most 10 times per application. Testing and the sandbox has the details.
2

Start a verification

Send a code to the owner’s phone. to takes any accepted Saudi mobile format, and lang picks the language of the SMS (Arabic unless it is exactly en).
The answer is 201:
id is what you check against, and expires_at is when the code stops working.If it does not start, the error string says why. The likely ones with a test key:Every other code is on the Errors page.
3

Check the code

Post the id and the code you received. The code is compared exactly as sent: never trimmed, never normalised.
Every outcome is a 200. Read verified first, then status for the reason:
status is one of verified, invalid_code, too_many_attempts, failed, expired or canceled. An unknown id is the one exception: 404 { "error": "not_found" }. A verified request stays verified and ignores later codes.Build a sign-in flow shows what to tell the person for each outcome.
4

Go live

Once the application is approved, create a live key on the same API keys page and put it in TAWKED_KEY. The endpoints and shapes are the same. The [TEST] stamp goes, the sandbox limits no longer apply, and codes reach any Saudi mobile number.Until approval, a live key answers 403 account_not_active on codes. Before you switch, read Reliability and limits: an Idempotency-Key on every start, and client_ip for the protection guard.

Defaults you can tune

Each application has its own settings, under Verify → Settings. The defaults, and their bounds:

What next

Build a sign-in flow

The number field, the code field, resends and what to tell the person.

Authentication

Key types, access by product, expiry and IP allowlists.

Reliability and limits

Idempotency keys, rate limits, retries and the protection guard.

Webhooks

Get told when a verification is verified, fails or expires.
Last modified on October 8, 2026