Create a Telegram Session (Phone / QR / Restore Login)
View All Telegram Messaging API APIs →Start logging in to a Telegram user account and obtain the sessionId used by every other endpoint. Three modes — pick one and send its JSON body, then poll Get Session Status until status reads CONNECTED. Phone login. Body: {"mode":"phone","phoneNumber":"+8613800138000","deviceName":"My Bot"}. phoneNumber is the full international number with the leading +. Poll the session until status is WAITING_FOR_OTP, then submit the login code from the Telegram app via Verify OTP. If the account has two-factor authentication, the session shows twoFactorRequired=true and you continue with Submit 2FA Password. QR login. Body: {"mode":"qr","deviceName":"My Bot"}. The create response returns a qrPageUrl you can open to watch the login live; poll Get Session Status for the qrImage (base64 data-URI). On the phone: Telegram → Settings → Devices → Link Desktop Device, then scan. Restore. Body: {"mode":"restore","sessionId":"<previous id>"} reconnects a previously logged-in account without a new code. After connecting, the sessionId switches to a stable account-derived ID (both IDs stay valid); keep it for later restore calls. An optional proxy field accepts a SOCKS5 URL such as socks5://user:pass@host:1080.
API Features
Live API Demo
🔒 Sign in to try it live
Log in to call this API with your own API key. New accounts get 100 free credits — no card required.
Log in / Sign upNo active API key found. Create one in your Dashboard, then reload this page. Dashboard →
/api/project/telegram-messaging/create-session API Response (JSON)
{} Query Result
Use Cases
- Bootstrap a Telegram bot or automation by linking an authorized user account
- Onboard users into a support channel with a scan-to-connect flow
- Reconnect a logged-in account after a restart without a new login code