This guide takes you from account to first send. Pick bot for production, or personal account only when a bot does not fit.
In brief
- Bot: @BotFather token, instance ACTIVE immediately, the user must have sent
/start first
- Personal account: create the instance, scan the QR (or share the link) until status is ACTIVE
- Both modes use the same send API; only the connection differs
Not sure which to pick? See Connection modes.
Before you start
- An API key (
sk_live_... or sk_test_... for sandbox)
- Instance and send scopes on the key, Scopes
- Replace
sk_live_xxxxx and https://api.notifique.dev in examples
Just getting started? Use sk_test_... and check Sandbox.
On Telegram, the user must talk to the bot first (/start). Without that, sends often fail, Bot API policy.
1. Connect the bot
Three paths, pick what fits your integration:1A, Via dashboard
- Telegram → New instance → Bot
- Paste the @BotFather token
- When status is active, note the instance id and
@botUsername
1B, Via API with token
Expected response: 200 with ACTIVE status:Invalid token → TELEGRAM_BOT_TOKEN_INVALID. Save the id.webhookUrl is informational. Notifique already registers this endpoint with Telegram’s Bot API, you do not need to host or configure anything with that URL. It is for audit and debugging (where Telegram delivers updates).
2. Ask the user to start the bot
Share https://t.me/YOUR_BOT and ask them to tap Start (/start).List users who already started:Use chatId or @username from the response in to.3. Send a text message
to is an array (up to 100 recipients). You can use @username if the chat already exists.Expected response: 202:Send with template
See template-api.Use a personal account only when a bot does not fit. Mass DM automation violates Telegram Terms. acceptUserTerms: true is required.
1. Create instance and connect
Four paths, pick what fits your integration:1A, Via dashboard
- Telegram → New instance → Account (USER)
- Accept the displayed terms of use
- Scan the QR in the Telegram app or open the login link
- When status is active, note the instance id
1B, Via API with QR in your UI
Creates the connection and returns the QR in connection, same idea as unofficial WhatsApp:Expected response: 200 with PENDING status and QR in connection:Use connection.base64 to show the QR in your UI or open connection.loginUrl in the Telegram app.1C, Via API with link for the customer to scan
Pass generateShareableLink: true to also get a hosted link, useful when the person scanning is not on your screen:Expected response: 200 with QR and shareable link:Send shareableLink.hostedUrl to the customer. When they finish login, status becomes active.Anyone with the link can authenticate the session on this instance. After use, rotate the secret with POST /v1/telegram/instances/:instanceId/connect-page/rotate-secret.
1D, Via API with session string
Useful with 2FA or when interactive QR does not work, create the USER instance first, then:Instance becomes ACTIVE. 409 if QR is already running in parallel: TELEGRAM_QR_LOGIN_IN_PROGRESS.Summary: dashboard for the simplest path; API with QR to embed the code in your UI; generateShareableLink: true when someone else needs to scan; session when QR does not work.
2. Refresh the QR (if it expires)
QR codes expire quickly. Request a new one without creating a new instance:While preparing (CONNECTING):QR ready (WAITING_QR):You can also receive a new QR via webhook (telegram.instance.qrcode).3. Retrieve the shareable link later
Lost the hostedUrl from create? Query or enable again, same pattern as WhatsApp:Check status (URLs only appear if the secret is still available on the server):Enable or regenerate (returns shareableLink):Expected response: 200 with hostedUrl and embedUrl.Invalidate old links (if the link leaked or the customer already connected):Disable the public page:4. Send a text message
With an ACTIVE instance:Expected response: 202 (same shape as the Bot tab).
After your first send
- List sent:
GET /v1/telegram/messages
- Cancel in queue:
POST /v1/telegram/messages/:id/cancel (telegram.cancelled webhook)
- Inbound:
GET /v1/telegram/messages/inbound, configure in Settings → Received messages
- Webhooks:
telegram.sent, telegram.received, telegram.failed, do not use message.* (WhatsApp). Guide: Webhook events
All send types
In the API reference (Telegram tab), open Send Telegram message and pick an example in the playground: Text, Image, Video, Audio, Document, Location, Template, Scheduled.
Next steps