viakite
Dashboard

API/Goals and settings/Create a page or event goal, up to 50

Create a page or event goal, up to 50

POST/v1/projects/{project}/goals
Secret keyus.api.vk.viabio.me

Path parameters

projectstringrequired
The project's id (prj_…).

Body

namestringup to 100 chars
kindstring
A page visit or a custom event.
pageevent
page_pathstringup to 255 chars
Starts with /, no spaces; * matches anything.
event_namestringup to 255 chars
conditionsPropertyCondition[]up to 20 items
One test on an event property, such as plan is pro.
Show 3 fields
propertystringrequiredup to 255 chars
operatorstringrequired
isis_notcontainsstarts_with
valuestringrequiredup to 255 chars

Responses

The AnalyticsGoal.

idstringrequired
A prefixed ULID; the prefix names the kind (prj_… a project, org_… an organization).
project_idstringrequired
A prefixed ULID; the prefix names the kind (prj_… a project, org_… an organization).
namestringrequired
kindstringrequired
A page visit or a custom event.
pageevent
page_pathstring
With kind page: /signup, /docs/*.
event_namestring
With kind event.
conditionsPropertyCondition[]required
With kind event, tests on its properties; empty for a page.
Show 3 fields
propertystringrequiredup to 255 chars
operatorstringrequired
isis_notcontainsstarts_with
valuestringrequiredup to 255 chars
created_atstring · date-timerequired
A time in UTC, ISO 8601.
updated_atstring · date-timerequired
A time in UTC, ISO 8601.
Example response
1{
2 "id": "id_01JD8Q2M4W9XK3T7B5",
3 "project_id": "prj_01JD8Q2M4W9XK3T7B5",
4 "name": "Production",
5 "kind": "page",
6 "page_path": "string",
7 "event_name": "string",
8 "conditions": [
9 {
10 "property": "plan",
11 "operator": "is",
12 "value": "pro"
13 }
14 ],
15 "created_at": "2026-11-21T09:30:00Z",
16 "updated_at": "2026-11-21T09:30:00Z"
17}

Errors

Every error has the same shape: error.code, a message for people and details.

StatusCode
422validation_error
422goal_limit
409goal_name_taken