Skip to main content
POST
Verify a Telegram code

Authorizations

Authorization
string
header
required

Your project API key, sent as Authorization: Bearer otp_live_.... Create keys on the API Keys page of the dashboard.

Path Parameters

sid
string
required

The Telegram code sid returned by Send a Telegram code.

Pattern: ^TG[a-fA-F0-9]{24}$
Example:

"TG6650c52ad3e4f5a6b7c8d9e0"

Body

application/json
code
string
required

The code your user entered, 4–8 digits.

Pattern: ^\d{4,8}$
Example:

"482913"

Response

The code was checked. Read valid to see whether it matched.

valid
boolean
required

true when verification_status is code_valid.

sid
string
required

Unique Telegram code ID.

Pattern: ^TG[a-f0-9]{24}$
Example:

"TG6650c52ad3e4f5a6b7c8d9e0"

status
enum<string>
required

Delivery status reported by Telegram. failed means the code never reached Telegram.

Available options:
sending,
sent,
delivered,
read,
expired,
revoked,
failed
verification_status
enum<string> | null
required

Result of the latest code check, or null before the first check.

Available options:
code_valid,
code_invalid,
code_max_attempts_exceeded,
expired,
null
to
string
required

Destination phone number in international format. OTPBay normalizes it to E.164, so +1 (415) 555-2671 becomes +14155552671.

Example:

"+14155552671"

code_length
integer
required

Number of digits in the code.

Example:

6

cost
string
required

What this code currently costs. 0.00 after a refund.

Pattern: ^\d+\.\d{2}$
Example:

"0.02"

date_created
string<date-time>
required
expires_at
string<date-time>
required
delivered_at
string<date-time> | null
required
verified_at
string<date-time> | null
required
metadata
object
required

Your own key-value data, returned in responses and webhooks. At most 32 keys of 1–64 characters. Values are strings (up to 512 characters), numbers or booleans.

Example:
last_error
string

Why the code couldn't be sent. Only present when there is one.