Overview
Hosts, versions and your first request
The Viakite API is the same API the dashboard runs on. Every report, goal, key and webhook you see in the dashboard comes from these endpoints, so anything you can do there you can do from your own server with a secret key. Use it to pull your numbers into your own tools, manage goals and keys from code, or get told when something happens.
Hosts
The API is split in two. The control plane holds your organization's settings and is the same everywhere. The data plane lives in your organization's region and holds the data itself: events, reports and exports. Only one region exists today, the United States (us), so every data host starts with us..
| Host | Plane | What it serves |
|---|---|---|
https://api.vk.viabio.me | Control | Organizations, members, projects and their settings, keys, webhooks, alerts, public pages |
https://us.api.vk.viabio.me | Data | Reports and queries, realtime, funnels, journeys, goals, segments, annotations, exports |
wss://us.live.vk.viabio.me | Data | WebSockets: the realtime and live feed streams |
https://us.e.vk.viabio.me | Data | Ingest: events sent by the script tag and the SDK |
You don't need to hard-code the data host. GET/v1/projects/{project} returns the project's region and the address of each host:
1{2"id": "prj_…",3"org_id": "org_…",4"name": "Marketing site",5"region": "us",6"endpoints": {7"api": "https://us.api.vk.viabio.me",8"live": "wss://us.live.vk.viabio.me",9"ingest": "https://us.e.vk.viabio.me"10}11}
Keys carry the region too: sk_live_us_… belongs to the United States. See Authentication.
Versions
Every path starts with /v1. Version 1 only changes by adding: new endpoints, new optional fields, new error codes. Nothing in it is renamed or removed. A change that would break your code goes into /v2, and /v1 keeps working.
Write your client so a new field in a response, or a new value in a list such as webhook event types, doesn't break it.
Requests and responses
- JSON in and out. Send
Content-Type: application/jsonwith a body. Request bodies are at most 1 MB. - Unknown fields are refused. A body field the endpoint doesn't know is a
400 bad_request, so a typo never passes silently. snake_casefor every field:project_ids,next_cursor,created_at.- Times in UTC, ISO 8601:
2026-11-19T10:30:00Z. - Lists return
{ "data": [...], "next_cursor": "…" }. See Pagination. - Errors return one shape with the right HTTP status. See Errors.
- Every response carries an
X-Request-Idheader. Quote it when you write to support.
Ids
Every id starts with a prefix that names its kind, followed by a ULID, so ids sort by the time they were made. Ids never contain the region.
| Prefix | Kind | Prefix | Kind |
|---|---|---|---|
org_ | Organization | gol_ | Goal |
prj_ | Project | fnl_ | Funnel |
mem_ | Member | seg_ | Segment |
inv_ | Invite | ann_ | Annotation |
grp_ | Group | pgg_ | Page group |
rol_ | Role | shr_ | Public page (share) |
key_ | API key | alr_ | Alert |
whk_ | Webhook | exp_ | Export |
dlv_ | Webhook delivery | aud_ | Audit log entry |
With a secret key, GET/v1/orgs returns the key's own organization, and GET/v1/orgs/{org}/projects the projects the key can reach, with their ids.
Your first request
Create a secret key in Settings → API keys with the analytics.view scope. Then ask for the visitors and page views of the last 7 days:
1curl https://us.api.vk.viabio.me/v1/projects/prj_…/analytics/query \2-H "Authorization: Bearer sk_live_us_…" \3-H "Content-Type: application/json" \4-d '{ "measures": ["visitors", "pageviews"], "date_range": { "preset": "7d" } }'
1const res = await fetch("https://us.api.vk.viabio.me/v1/projects/prj_…/analytics/query", {2method: "POST",3headers: {4Authorization: `Bearer ${process.env.VIAKITE_SECRET_KEY}`,5"Content-Type": "application/json",6},7body: JSON.stringify({ measures: ["visitors", "pageviews"], date_range: { preset: "7d" } }),8});9if (!res.ok) throw new Error((await res.json()).error.message);10const report = await res.json();11console.log(report.data[0]); // { visitors: 1840, pageviews: 5312 }
1import os2import requests34res = requests.post(5"https://us.api.vk.viabio.me/v1/projects/prj_…/analytics/query",6headers={"Authorization": f"Bearer {os.environ['VIAKITE_SECRET_KEY']}"},7json={"measures": ["visitors", "pageviews"], "date_range": {"preset": "7d"}},8)9res.raise_for_status()10print(res.json()["data"][0]) # {'visitors': 1840, 'pageviews': 5312}
The answer holds one row of totals, and the exact range it covered:
1{2"data": [{ "visitors": 1840, "pageviews": 5312 }],3"date_range": { "from": "2026-11-14T18:30:00Z", "to": "2026-11-21T18:30:00Z" }4}
Days start at midnight in the project's time zone, here Asia/Kolkata, so the range starts at 18:30 UTC. To add a chart line, breakdowns and filters, read Querying analytics.
Rate limits
Each secret key may make 10 requests a second. A paid organization can raise that to 100 in Settings → API keys. Every answer to a secret key carries three headers:
| Header | What it says |
|---|---|
RateLimit-Limit | The requests this key may make each second |
RateLimit-Remaining | How many are left in this second |
RateLimit-Reset | Seconds until the count starts again |
A request over the limit gets 429 rate_limited with a Retry-After header: wait that many seconds and try again. Requests from the dashboard, public keys and share links don't count, and neither do events sent to POST /v1/events. More in API keys.
The reference
Every endpoint, with its parameters, body and answer, is in the reference.