Connect Telegram directly
Connect a Telegram channel/group directly using the chat ID. Alternative to the access code flow. The bot must already be an admin in the channel/group.
API key authentication - use your Late API key as a Bearer token
In: header
The Telegram chat ID. Numeric ID (e.g. "-1001234567890") or username with @ prefix (e.g. "@mychannel").
The profile ID to connect the account to
Response Body
application/json
application/json
curl -X POST "https://getlate.dev/api/v1/connect/telegram" \ -H "Content-Type: application/json" \ -d '{ "chatId": "-1001234567890", "profileId": "6507a1b2c3d4e5f6a7b8c9d0" }'{
"message": "Telegram channel connected successfully",
"account": {
"_id": "64e1f0a9e2b5af0012ab34cd",
"platform": "telegram",
"username": "mychannel",
"displayName": "My Channel",
"isActive": true,
"chatType": "channel"
}
}{
"error": "Unauthorized"
}Generate Telegram code GET
Generate an access code (valid 15 minutes) for connecting a Telegram channel or group. Add the bot as admin, then send the code + @yourchannel to the bot. Poll PATCH /v1/connect/telegram to check status.
Check Telegram status PATCH
Poll this endpoint to check if a Telegram access code has been used to connect a channel/group. Recommended polling interval: 3 seconds. Status values: pending (waiting for user), connected (channel/group linked), expired (generate a new code).