API pipeline: Post your posts into groups at a pace set by their traffic and follow what was sent and deleted

Index: API pipelines — index · Lifecycle: API pipeline: Create, configure, start, stop, measure and delete a Telegram campaign of any kind

Goal: your oracles post your posts into a list of groups, each group at a pace set by its own traffic, and you follow what was sent, deleted and replied to. Replies to your posts are answered under your agenda.

Steps

1. Create (Paused).

POST /v0/my/campaigns
Idempotency-Key: ann-villas-1
{"title": "Villa offers", "kind": "mtproto_announcements", "project_nonce": "<Pro project>",
 "posts": ["<post or posts workspace>"], "tg_groups": ["<preset nonce>"], "oracles": ["<oracle nonce>"],
 "agenda": "<swappable agenda>", "speed": "medium", "mode": "linear", "forward": false, "join_missing": false}
→ {"nonce": "470380000000000001", "kind": "mtproto_announcements", "status": "Paused", …}

2. Start. POST /v0/my/campaigns/470380000000000001/start → {"success": true, "status": "Active", "is_active": true}.

3. Follow.

GET /v0/my/campaigns/470380000000000001/sends?page=1&limit=50
→ {"rows": [{"username": "example_group", "message_id": 17552, "post": "…", "oracle": "…",
             "sent_at": "…", "deleted_at": null, "replied_at": "…", "replies": 2}], "total": 56, "has_more": true, …}
GET /v0/my/campaigns/470380000000000001/performance
→ {"totals": {"sent": 56, "deleted": 33, "replied": 3, "groups": 39, "oracles": 2, …}, "timeline": […], "groups": […]}

The posts actually sent are also kept in the campaign's sent_posts_workspace.

4. Stop. POST …/stop. The campaign runs until you stop it.

Behind

Rules

API surface

Endpoint Purpose FE AI / oracle
POST /v0/my/campaigns (kind: mtproto_announcements) Create yes yes
PATCH /v0/my/campaigns/{nonce} Posts, groups, oracles, agenda, speed, mode, forward, join_missing yes yes
POST /v0/my/campaigns/{nonce}/start, /stop Run / stop yes yes
GET /v0/my/campaigns/{nonce}/sends Each sent message: deleted, replied yes yes
GET /v0/my/campaigns/{nonce}/performance Totals, timeline, per group yes yes, reporting

Mentioned