Campaigns & media endpoints
Create, edit, and manage campaigns, fetch the subscriber deep link, and upload welcome media.
List campaigns
GET /api/camp/list.json
Returns all non-deleted campaigns with aggregate counters.
{
"status": "ok",
"data": [
{
"id": 12,
"code": "abc123",
"bot": 7,
"bot_username": "mytrackbot",
"chat": -1001234567890,
"chat_title": "My Channel",
"status": 0,
"starts": 120,
"confirms": 98,
"unsubs": 12,
"created": "2026-05-10 09:00:00"
}
]
}status | Meaning |
|---|---|
0 | Active |
1 | Paused |
2 | Deleted (soft — leads and stats are preserved) |
Get one campaign
GET /api/camp/get.json
Returns the full campaign record including postback templates and unsub window.
| Parameter | Description |
|---|---|
id | Campaign id |
{
"status": "ok",
"data": {
"id": 12,
"code": "abc123",
"bot": 7,
"bot_username": "mytrackbot",
"chat": -1001234567890,
"chat_title": "My Channel",
"status": 0,
"welcome": "Join *{title}* — exclusive content inside!",
"media": "",
"button_text": "Get access",
"button_url": "https://example.com/lander?click={click}",
"pb_wait": "",
"pb_hold": "",
"pb_approve": "",
"pb_cancel": "",
"pb_trash": "",
"unsub_window": 2592000,
"starts": 120,
"confirms": 98,
"unsubs": 12,
"created": "2026-05-10 09:00:00"
}
}Empty pb_* fields mean the campaign inherits the
global postback templates.
unsub_window is in seconds; 0 means the window never closes (cancel/trash
postbacks always fire, regardless of when the leave happens).
Create a campaign
POST /api/camp/add.json
Creates a new campaign. The chat must come from
bots/chats — it must be a chat where the
chosen bot is currently admin and that is not already tracked by another campaign.
| Parameter | Required | Description |
|---|---|---|
bot | ✓ | Bot id |
chat | ✓ | Chat id (from bots/chats) |
welcome | ✓ | Welcome message text (Telegram Markdown) |
media | Media ref from media/upload; omit for text-only | |
button_text | CPA button label shown in the welcome message | |
button_url | CPA button URL — may contain {click} and other macros | |
pb_wait | Postback URL template for the wait event | |
pb_hold | Postback URL template for the hold event | |
pb_approve | Postback URL template for the approve event | |
pb_cancel | Postback URL template for the cancel event | |
pb_trash | Postback URL template for the trash event | |
unsub_window | Seconds after join within which cancel/trash postbacks fire; 0 = always | |
notify_level | Lead notification level: 0 off (default), 1 approve only, 2 approve + wait, 3 all statuses |
{ "status": "ok", "data": { "id": 12, "code": "abc123" } }Postback override rule: if you set at least one pb_* field, the campaign
uses its own templates for all five events (an empty one disables that specific
event). If you leave all five pb_* fields empty, the campaign inherits your
global templates.
| Error | Meaning |
|---|---|
exists | This chat is already tracked by another campaign |
nochat | No free chat slots available for the chosen bot |
limit | You have reached your tariff’s campaign limit — upgrade at Billing |
Edit a campaign
POST /api/camp/edit.json
Updates the welcome creative, postback templates, or unsub window. The bot and chat cannot be changed after creation.
| Parameter | Required | Description |
|---|---|---|
id | ✓ | Campaign id |
welcome | New welcome message text | |
media | New media ref (pass "" to remove the current media) | |
button_text | New CPA button label | |
button_url | New CPA button URL | |
pb_wait — pb_trash | New postback URL templates (all five are rewritten together) | |
unsub_window | New unsub window in seconds | |
notify_level | New lead notification level (0–3) |
{ "status": "ok" }Get the deep link
GET /api/camp/link.json
Returns the subscriber deep link for this campaign. Distribute this link in your traffic sources — when a subscriber opens it, the bot greets them and the conversion is tracked.
| Parameter | Description |
|---|---|
id | Campaign id |
click | Optional click ID to embed in the link |
{
"status": "ok",
"data": {
"link": "https://t.me/mytrackbot?start=abc123-{click}"
}
}When you pass a click value, that ID is embedded in the returned link directly:
https://t.me/mytrackbot?start=abc123-xyz789. When you omit click, the
{click} placeholder is left as-is for you to substitute before distributing.
Pause or resume
POST /api/camp/pause.json
| Parameter | Description |
|---|---|
id | Campaign id |
pause | 1 to pause, 0 to resume |
{ "status": "ok" }Delete a campaign
POST /api/camp/del.json
Soft-deletes the campaign. Existing leads, journal rows, and stats are preserved and continue to reference it.
| Parameter | Description |
|---|---|
id | Campaign id |
{ "status": "ok" }Upload media
POST /api/media/upload.json
Uploads an image or video to use as the welcome media for a campaign. Returns a media reference to pass when creating or editing a campaign.
Send as multipart/form-data with the file in the file field.
{ "status": "ok", "data": { "media": "img_abc123xyz" } }Pass the returned media value as the media parameter in camp/add or
camp/edit.