Cabi.Chat API
Cabi.Chat API is one API over the whole graph. Everything you do in Cabi.Chat, the web app does through this API: projects, articles, workspaces, campaigns, oracles, the inbox. Cabi.Chat is the first client of the graph, not the only possible one link. Your scripts, your website, your own oracles and your AI assistant are clients too, on the same terms. An assistant connects through MCP: Connect your AI assistant to Cabi.Chat (MCP)
Two halves
- Graph:
/graph/...reads the graph as the caller may see it,/my/...creates, edits, arranges and runs your cards. Cabi.Chat API — Graph endpoints - Account: you, your tokens, plan and balance, inbox, domains and traffic. Cabi.Chat API — Account endpoints
Who is calling
Send Authorization: Bearer <token>. What a call reaches depends on whom the token speaks for.
- Personal access token: acts as you, for your scripts and tools. Cabi.Chat API — Personal access tokens
- Browser and Mini App session: a person signed in with Telegram. API pipeline: Sign in to Cabi.Chat with Telegram
- Setup access: an oracle that set up your page with your agreement: Cabi.Chat API — Personal access tokens
- Agenda token: an oracle or app you host acts as its agenda, not as you: Cabi.Chat API — Apps
- No token: public reads only, as an anonymous visitor. Telegram groups are Ecosystem cards, so an anonymous caller sees none.
Conventions
- Base URL:
https://api.cabi.chat/v0, JSON in and out;/v1serves the same routes as an alias. - Spec:
https://api.cabi.chat/api-docs/openapi.json. Generate a client from it. - Nonces: every card has a nonce, a 64-bit number. It travels as a string; keep it a string, because JavaScript numbers lose the last digits. Where a path says
{ident}, a@handleworks as well as a nonce; where it says{nonce}, send the nonce. - Language:
?lang=ruorAccept-Language. A card returns every language it is stored in, underi18n. - Errors: JSON
{"error": "..."}that says what to fix. 400: the request needs a fix. 401: the token is wrong or revoked. 404: a card you cannot reach; the API does not confirm that a hidden card exists. 500{"error": "internal error"}: retry later. - Paging: lists take
limitandoffset. The contents of a workspace or a rubric page withcontained_limitandcontained_offset, and the answer givescontained_next_offset. Search and a campaign'ssendspage withpage, from 1. - Timestamps: cards carry RFC 3339 in UTC; report rows (sends, performance) carry
YYYY-MM-DD HH:MM:SS.mmmin UTC. - Card slots: a field that takes cards (
tg_groups,not_tg_groups,oracles,posts) takes workspaces too, and aPATCHreplaces the whole list. - Creates carry an
Idempotency-Key. Cabi.Chat API — Creating cards: idempotency and limits - Rights: every call follows the card policies, exactly as in the app. Cabi.Chat Graph — Card Policies
First call
curl -H "Authorization: Bearer $CABI_PAT" https://api.cabi.chat/v0/my/self
curl -H "Authorization: Bearer $CABI_PAT" https://api.cabi.chat/v0/my/projects
The first answers who you are (200 with your profile), the second lists your projects. Your first project over the API: API pipeline: Create and edit your project page