Skip to main content
In this guide you send a verification code to your own phone and check it. It takes about five minutes.

Prerequisites

  • An OTPBay account. Sign up — new accounts get $1.00 of free credit.
  • A phone number with Telegram installed, or any phone that receives SMS.

Verify a phone number

1

Create an API key

In the dashboard, open your project and go to API Keys. Click New API key, give it a name and copy the key.Keys start with otp_live_. OTPBay shows a key only once, so store it somewhere safe, such as an environment variable:
2

Start a verification

Send the phone number in international format. OTPBay generates a code and sends it over Telegram, falling back to SMS if Telegram can’t deliver.
The response includes a sid. Save it — you need it to check the code.
3

Check the code

Enter the code you received, using the sid from the previous step:
A correct code returns "valid": true and "status": "approved". The phone number is verified.
A wrong code also returns HTTP 200, with "valid": false. Always read valid rather than relying on the status code.

Next steps

Verify guide

Configure the channel, fallback, code length and expiry.

Webhooks

Get notified when a verification finishes.