API pipeline: Project visits and your website's traffic
Index: API pipelines — index
Goal: see the visits your campaigns bring to your project, and count visits on your own website.
Steps
- Visits to a project (its owner).
GET /v0/my/console/traffic/summary?project=470000000000000001&window_days=30
→ {"timeline": [{"day": "2026-10-14", "visits": 12, "uniques": 9}, …],
"visits": [{"utm_campaign": "470000000000000061", "utm_source": "telegram", "visits": 8, "uniques": 6}, …],
"domain": "example.com", "domain_verified": true,
"snippet_last_visit": "2026-10-15 19:16:04.703", …}
visits: visits per campaign (utm_campaign) and source (utm_source); empty strings = direct.internal: opens of the project from campaign links inside Cabi.Chat;external: clicks from Cabi.Chat to your verified website;totalssums both.domain: the host of the project's Website contact;domain_verified: whether you proved it is yours;snippet_last_visit: the last visit counted on that site in the past 7 days.
- Visits one campaign brought.
GET /v0/my/console/traffic/campaign?campaign=470000000000000061
→ {"visits": 14, "uniques": 11, "timeline": […],
"rows": [{"utm_source": "telegram", "project": "470000000000000001", "visits": 8, "uniques": 6}, …]}
rows: per source and the project the visitor landed on.
- Verify your domain.
POST /v0/my/console/domains
{"host": "example.com"}
→ {"host": "example.com", "token": "<token>", "verified": false, …}
Place the token one of three ways, then check:
- DNS TXT record
cabi-verify=<token>(method: "dns"); - a file at
https://example.com/cabi-verify-<token>.htmlwhose content is the token ("html"); <meta name="cabi-verify" content="<token>" />in the head of the home page ("meta").
POST /v0/my/console/domains/verify
{"host": "example.com", "method": "meta"}
→ {"verified": true} or {"verified": false, "reason": "…"}
Your domains: GET /v0/my/console/domains; remove one: DELETE /v0/my/console/domains/{host} → 204.
- Count visits on your site. Add to every page:
<script async src="https://cabi.chat/cabi.js" data-project="470000000000000001"></script>
Each page view sends the page path, the referrer and the utm_* parameters; the script keeps an anonymous visitor id in the browser's local storage and sets no cookies. Once views arrive, snippet_last_visit moves and the visits show in step 1.
Behind
- The website block (
domain,domain_verified,snippet_last_visit) follows the project's Website contact: add one first. - Links that carry
utm_campaign=<campaign nonce>andutm_sourceare attributed to that campaign.
Rules
- 400
invalid domain;method must be dns|html|meta. - 404: not your project, campaign or domain.
- DNS changes can take a few minutes to show; verify again.
API surface
| Endpoint | Purpose | FE | AI / oracle |
|---|---|---|---|
GET /v0/my/console/traffic/summary |
Project visits, your site status | yes (Show performance) | yes |
GET /v0/my/console/traffic/campaign |
Visits a campaign brought | yes (campaign performance) | yes |
POST /v0/my/console/domains |
Get a verification token | yes | yes |
POST /v0/my/console/domains/verify |
Check the token | yes (Verify) | yes |
GET / DELETE /v0/my/console/domains |
List / remove domains | no | yes |