API pipeline: Have your oracles react to fresh messages in groups at a chosen pace
Index: API pipelines — index · Lifecycle: API pipeline: Create, configure, start, stop, measure and delete a Telegram campaign of any kind
Goal: your oracles react to fresh messages in groups with emoji you choose, at a pace you choose.
Steps
1. Create (Paused).
POST /v0/my/campaigns
Idempotency-Key: react-bali-1
{"title": "Bali reactions", "kind": "mtproto_reactions", "project_nonce": "<Pro project>",
"oracles": ["<oracle nonce>"], "tg_groups": ["<preset nonce>"],
"reactions": ["👍", "🔥", "❤"], "speed": "slow"}
→ {"nonce": "470410000000000001", "kind": "mtproto_reactions", "status": "Paused", …}
reactions: 1–16 emoji; for each message one is picked at random among those the group allows.tg_groups: optional; empty means every group the oracles are in.speed: x_slow | slow | medium (default) | fast | x_fast: how many messages each oracle reacts to per day.
2. Start. POST /v0/my/campaigns/470410000000000001/start → {"success": true, "status": "Active", "is_active": true}.
3. Follow. GET /v0/my/campaigns/470410000000000001/performance → totals.reacted, per day (timeline[].reacted) and per group (groups[].reacted).
4. Stop. POST …/stop. It runs until you stop it.
Behind
- Only recent messages get reactions.
- Changes to oracles or groups are picked up while it runs.
Rules
- Start needs a Pro project, oracles and at least one reaction: 400
assign oracles before activating,assign at least one reaction before activating. - A reaction that is not an emoji → 400
reaction "…" is not an emoji; more than 16 → 400at most 16 reactions.
API surface
| Endpoint | Purpose | FE | AI / oracle |
|---|---|---|---|
POST /v0/my/campaigns (kind: mtproto_reactions) |
Create | yes | yes |
PATCH /v0/my/campaigns/{nonce} |
Reactions, speed, groups, oracles | yes | yes |
POST /v0/my/campaigns/{nonce}/start, /stop |
Run / stop | yes | yes |
GET /v0/my/campaigns/{nonce}/performance |
Reactions per day and group | yes | yes, reporting |