Ranges and weeks follow your project’s time zone, and a week is Monday to Sunday.
Save a view
POST /v1/views with a name and a definition. The name is 1 to 80 characters and the optional description up to 280. The key is optional, defaults to a slug of the name (view- goes in front when a digit leads: “7 day actives” is view-7-day-actives), and must not be taken by another view in the project: lowercase words joined by dashes, starting with a letter, up to 64 characters; a taken key is refused with validation_failed. The audience and the units it names must exist.
Read a view
GET /v1/views/{id} takes the view’s view_… ID or its key, and answers with the view and its answer. Read it from your server: the key never goes in browser code.
range: read over another range, such as?range=last_30_days.compare:?compare=truealso answers for the span of the same length just before, for “up 12% on last week”.audience: read for another audience than the view’swho.
number: each measure is oneseriesentry, and itstotalis the answer.over_time: eachseriesentry also haspoints, one per day, week or month inside the range.list:rowsholds the ranking, withvaluefor the first measure andvaluesfor each.total_rowssays how many rows there are in all.
compare, previous_total, previous_points and previous_rank are filled in, and compared_with names the span before.
Preview a view
POST /v1/views/preview answers a definition (and compare) without saving it, over a range with a start, never all time. For a funnel, its answer adds steps.
A funnel is a preview-only shape: { "type": "funnel", "steps": [...], "within": "1d" }, and what is [{ "measure": "active_users" }]. Each step is an event, with an optional where. people took a step and every one before, in order; median_seconds is the typical time from the step before.
How a person is counted:
- Each person has one try, from their first step one in the range. A later try is not counted.
- Each later step comes strictly after the one before, at most
withinafter step one (that moment included, even past the range). - A visitor who signs in is one person, through their aliases.
{ "reward": "first" }: a person’s first units from a rule or by hand (not starting units, passes, sends or undone rewards; held units count when given). A reward from the step’s own event is 0 seconds after it. Only the first reward is read: if it came before the step before, the person is not counted.
A funnel cannot be saved as a view yet.
What each measure counts
events: events that happened in the range. Leave outeventto count every event.active_users: people with at least one event in the range, each counted once.new_users: people Lurk first heard of in the range.returning_users: active people Lurk first heard of before the range began.given: what was added to a unit in the range, by rules, by hand or by an undo.spentis what was taken, as a positive number.held: what everyone holds of a unit at the end of the range.nowis only forheld, as a number or a ranked list of people.
source. Set definition.source to trusted (your server only) or any (a device’s too). given, spent, held and new_users count whatever source says.
Ranked lists
Alist ranks people (by: "user"), rules (by: "rule") or the values of one property of an event (by: "property"), up to size rows (at most 100).
- People can be ranked by
events,given,spentorheld. - Rules can be ranked by
givenorspent. - A list by property names its
propertyand counts one named event. A value that looks personal, such as an email address or a link, is counted under one row, Hidden. It is a best-effort check, not a guarantee.
List and change views
GET /v1/viewslists the project’s views, newest first.searchmatches part of a name or key, andconversion=truekeeps only conversions. Lists come a page at a time (Pagination).PATCH /v1/views/{id}renames a view, changes its description (nullremoves it) or replaces its whole definition. Send at least one of them. Dashboards that show it show the new question.
Conversions
A conversion is a view markedconversion: true: something you want people to do. Only a view that counts one named event can be one. Set it with conversion on POST /v1/views or PATCH /v1/views/{id}. At the project’s limit, turn one off first.
Only an owner, admin or developer, or a project key, can mark a conversion, clear the mark, or change a marked view.
Agents reach the same operations through the MCP server. Every view also lists its endpoint (/v1/views/top-earners) and the dashboards that show it.