viakite
Dashboard

API/Basics/Overview

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..

HostPlaneWhat it serves
https://api.vk.viabio.meControlOrganizations, members, projects and their settings, keys, webhooks, alerts, public pages
https://us.api.vk.viabio.meDataReports and queries, realtime, funnels, journeys, goals, segments, annotations, exports
wss://us.live.vk.viabio.meDataWebSockets: the realtime and live feed streams
https://us.e.vk.viabio.meDataIngest: 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:

response.json
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/json with 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_case for 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-Id header. 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.

PrefixKindPrefixKind
org_Organizationgol_Goal
prj_Projectfnl_Funnel
mem_Memberseg_Segment
inv_Inviteann_Annotation
grp_Grouppgg_Page group
rol_Roleshr_Public page (share)
key_API keyalr_Alert
whk_Webhookexp_Export
dlv_Webhook deliveryaud_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:

terminal
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" } }'
query.mjs
1const res = await fetch("https://us.api.vk.viabio.me/v1/projects/prj_…/analytics/query", {
2 method: "POST",
3 headers: {
4 Authorization: `Bearer ${process.env.VIAKITE_SECRET_KEY}`,
5 "Content-Type": "application/json",
6 },
7 body: 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 }
query.py
1import os
2import requests
3
4res = requests.post(
5 "https://us.api.vk.viabio.me/v1/projects/prj_…/analytics/query",
6 headers={"Authorization": f"Bearer {os.environ['VIAKITE_SECRET_KEY']}"},
7 json={"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:

response.json
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:

HeaderWhat it says
RateLimit-LimitThe requests this key may make each second
RateLimit-RemainingHow many are left in this second
RateLimit-ResetSeconds 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.