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

Three login modes Phone + code, QR scan, or one-call restore of a previously logged-in account
2FA aware Surfaces twoFactorRequired so cloud-password accounts complete login cleanly
Stable reusable sessionId Once connected, the id becomes a deterministic account-derived ID that survives restarts and authorizes every endpoint
Optional SOCKS5 proxy Route the account's connection through a per-session proxy for geo or network control

Live API Demo

POST /api/project/telegram-messaging/create-session

API Response (JSON)

{}
📢
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Contact Us

Use Cases

View Subscription Plans →