Telegram OTP API for sending and verifying one-time codes
TeleAuth turns your own Telegram bot into an OTP delivery channel. You call one endpoint to send a code, one endpoint to verify it, and TeleAuth handles code generation, expiry, rate windows and delivery logging.
How the OTP flow works
A complete verification is two HTTP requests. TeleAuth generates a six-digit code, delivers it through your connected bot and stores only a hashed copy until it is used or expires.
- POST /v1/otp/send with a Telegram username
- The user receives the code in your bot's chat, not over SMS
- POST /v1/otp/verify with the same username and the code the user typed
- Codes expire after 300 seconds by default and are single use
Send a code
Authenticate with the project API key you created in the dashboard. Keep the key on your server — it must never reach a browser bundle or mobile app.
curl -X POST https://teleauth.run.place/api/public/v1/otp/send \
-H "x-api-key: $TELEAUTH_API_KEY" \
-H "content-type: application/json" \
-d '{ "username": "ada_lovelace" }'Verify the code
Verification is idempotent per code: once a code is accepted or expires, further attempts fail closed.
curl -X POST https://teleauth.run.place/api/public/v1/otp/verify \
-H "x-api-key: $TELEAUTH_API_KEY" \
-H "content-type: application/json" \
-d '{ "username": "ada_lovelace", "code": "418302" }'What you get out of the box
Everything a production auth flow needs, without building bot plumbing yourself.
- Per-project API keys with prefixes so you can rotate safely
- HMAC-signed webhooks for send, delivered and verified events
- Authentication logs with recipient, result and timestamp
- A live playground to test keys and payloads before you ship
Common questions
Do I need my own Telegram bot?
Yes. You connect a bot token from BotFather in the Bots page, and TeleAuth wires the webhook automatically. Codes are always delivered from your own bot so users see your branding.
How long is an OTP valid?
Five minutes (300 seconds) by default. Codes are single use and are stored hashed.
Is the API free to start?
Yes, you can create a project, connect a bot and send test codes without a paid plan.
Related guides
More ways to use Telegram for authentication and verification.
Telegram bot OTP verification
Step-by-step guide to sending verification codes from your own Telegram bot: create the bot, connect the token, wire the webhook and send your first OTP.
Send OTP without SMS
Cut SMS verification costs by delivering one-time codes through Telegram: no per-message fees, no carrier filtering, no SIM-swap risk.
Telegram username verification
Verify Telegram usernames with one-time codes delivered by your own bot. No phone number, no SMS, no contact sharing.
Try telegram otp api with TeleAuth
Create a project, connect your Telegram bot, and send your first OTP in minutes.
Create free account