API pipeline: Have your oracles join or leave a list of Telegram groups within Telegram limits

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

Goal: your oracles join (or leave) a list of Telegram groups, paced within Telegram limits, and you see where each one got in.

Steps

1. Create (Paused).

POST /v0/my/campaigns
Idempotency-Key: join-phuket-1
{"title": "Join Phuket chats", "kind": "mtproto_join_chats", "project_nonce": "<Pro project>",
 "tg_groups": ["<preset nonce>"], "oracles": ["<oracle nonce>", "<team workspace>"]}
→ {"nonce": "470400000000000001", "kind": "mtproto_join_chats", "status": "Paused", …}

Leaving: the same with "kind": "mtproto_leave_chats".

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

3. Watch the plan.

GET /v0/my/campaigns/470400000000000001/performance
→ {"totals": {"joined": 30, "already_member": 10, "join_pending": 4, "join_banned": 1, "join_dead": 1, …},
   "join": {"groups": 48, "member": 40, "pending": 4, "skipped": 2, "remaining": 2,
            "oracles": [{"oracle": "…", "member": 40, "pending": 4, "skipped": 2, "remaining": 2, "flooded_until": null}]},
   "groups": [{"username": "example_group", "join_status": "joined", "oracles_member": 1, "oracles_pending": 0, …}], …}

States: joined, already_member, join_pending (a join request waits for the admins), join_banned, join_dead (group gone or unreachable), join_skipped, join_flood (Telegram asked to wait), join_limit; leaving: left, leave_failed, not_member.

4. Done. The campaign turns Completed when every oracle has walked the list. POST …/stop pauses it earlier.

Behind

Rules

API surface

Endpoint Purpose FE AI / oracle
POST /v0/my/campaigns (kind: mtproto_join_chats / mtproto_leave_chats) Create yes yes
PATCH /v0/my/campaigns/{nonce} Groups, oracles yes yes
POST /v0/my/campaigns/{nonce}/start, /stop Run / pause yes yes
GET /v0/my/campaigns/{nonce}/performance Join plan and states per group and oracle yes yes, reporting

Mentioned