Bots endpoints

Connect and manage the Telegram bots that greet subscribers and track joins in your chats.


List bots

GET /api/bots/list.json

Returns all bots connected to your account, including soft-deleted ones.

{
  "status": "ok",
  "data": [
    {
      "id": 7,
      "tg": 7123456789,
      "username": "mytrackbot",
      "name": "My Tracking Bot",
      "status": 0,
      "created": "2026-05-01 12:00:00"
    }
  ]
}
statusMeaning
0Active
1Warning — the bot has lost admin rights in one or more chats
3Deleted (soft)

Connect a bot

POST /api/bots/add.json

Connects a bot by its BotFather token. Validates the token against the Telegram API, then registers a webhook so the bot can receive updates.

ParameterDescription
tokenBot token from @BotFather, e.g. 1234567890:AABBCCdd…
{
  "status": "ok",
  "data": {
    "id": 7,
    "username": "mytrackbot",
    "name": "My Tracking Bot"
  }
}

Restore on re-add: if you previously disconnected this bot and add the same token again, the existing record is reactivated — no duplicate is created and the bot’s campaigns are preserved.

ErrorMeaning
tokenThe token is invalid or Telegram rejected it
existsThis token is already connected to a different account
webhookToken is valid but webhook registration failed

List admin chats

GET /api/bots/chats.json

Returns cached chats where the bot is an admin, excluding any chat already tracked by a campaign. This is the picker used when creating a campaign.

ParameterDescription
idBot id
{
  "status": "ok",
  "data": [
    { "id": -1001234567890, "title": "My Channel", "type": "channel" }
  ]
}

The list is a cache populated when the bot is promoted to admin in a chat. If a chat you expect is missing, confirm the bot is actually an admin of that chat and retry.


Disconnect a bot

POST /api/bots/del.json

Soft-deletes the bot, drops its webhook, and clears caches. The row is kept for history; all leads and stats referencing this bot are preserved. You can reconnect the bot later — the “Restore on re-add” behaviour applies.

ParameterDescription
idBot id
{ "status": "ok" }