Send a code
The response is
201 with a sid that starts with TG, the code’s expires_at, and status: "sent".
If the number has no Telegram account, or Telegram rejects the request for another reason, the request fails with 422 TELEGRAM_REJECTED and you aren’t charged.
Check the code
Whether you pass your owncode or let Telegram generate one, check what your user enters with Verify a Telegram code:
valid in the response. Telegram tracks wrong attempts and expiry; verification_status tells you the result of the latest check:
If you passed your own
code, you can also compare it yourself. Calling the verify endpoint is still recommended — it records the result, which improves Telegram’s delivery statistics.Delivery status
status follows the message on Telegram:
With a
callback, OTPBay sends a webhook each time the status changes. Without one, get the code to read the latest status.
Settings
Open Messaging → Telegram in the dashboard:Refunds
The $0.02 is charged when you send. It’s refunded when:- Telegram rejects the request, or it never reaches Telegram.
- Telegram doesn’t deliver the code before it expires.
callback set, OTPBay checks automatically until shortly after the code expires; otherwise the check happens when you get the code. Codes sent by Verify are always checked when the verification finishes.
After a refund, cost on the message shows 0.00.