thelastapi
Console
Products

Dashboards

Your own dashboards of live numbers from every product, for one business or across all of them, built from a list of metrics, never SQL.

Open as .md

A dashboard is a grid of widgets fed by live data from everything thelastapi runs for you: payments, analytics, session replay, sign-in, AI and spend, email, hosting, phone, social and connectors. Build a churn dashboard, a traffic dashboard, an AI-cost dashboard, or a portfolio of every business side by side. Each widget is a type (a number, a chart, a table…) plus a metric picked from a catalogue, plus its options. Nobody writes a query.

Dashboards live at two levels:

LevelWhereReads
Projectconsole ▸ a project ▸ Dashboards, project_id setthat business
Accountconsole ▸ Dashboards, no project_idevery business, or the ones in project_ids; any widget can break down by business

People make them in the console; agents make them with vibiz dashboards, the vibiz_dashboards tool, the SDK or POST /v1/dashboards. Every answer has a console_url that opens the dashboard with its range.

Templates

One call makes a whole dashboard you can then change:

TemplateLevelWhat is on it
churnprojectrevenue, MRR, active subscribers, churn rate, MRR and revenue over time, new and churned subscriptions, a retention grid by month, revenue per customer, refunds, latest payments
trafficprojectvisitors, pageviews, custom events, sessions with errors, visitors by day, sources, top pages, countries, devices, sessions with problems to watch
ai_costprojectAI spend and calls, spend on every product, AI spend by day and model, spend by model and by product
growthprojectsign-ups, active users, users, visitors, sign-ups by day, latest sign-ups
portfolioaccountrevenue, MRR, visitors and AI spend across businesses, a row per business, revenue and visitors by business, AI spend and errors by business
Terminal
vibiz dashboards create --template churn          # in the app's folder: this project
vibiz dashboards create --template portfolio      # the account, every business

Widget types

The grid has 12 columns; each widget has a layout { x, y, w, h } (rows of 64 px). Leave layout out and it goes in the first free spot. On a phone, widgets stack top to bottom.

TypeShowsMetric shape
statone number for the range, with its change against the period before (red when a rise is bad: churn, errors, spend)scalar
linea number over time; with a breakdown, one line per valuetimeseries
areathe same, filled; with a breakdown, stackedtimeseries
barcolumns over time (stacked by the breakdown), or bars for a breakdown like countriestimeseries or table
tablea breakdown as rows (value and share)table
listthe latest items: payments, sign-ups, deploys, sessions with problems, each with its console linktable
funnelvisitors who reached each step in order, and the drop between stepsfunnel
cohortretention by month of startcohort
texta heading or a note in markdown (#, -, **bold**)none

Options

OptionMeaning
range24h, 7d, 30d, 90d, 12m: this widget's own range (a request's range wins)
buckethour, day, week, month for charts; by default it fits the range
breakdownone of the metric's breakdowns (project at the account level, source, country, model…)
filtersequality filters the metric lists: { "country": "US" }, { "source": "Google" }, { "environment": "development" }
limitrows of a table or list, or series of a chart (the rest are summed as Other); 1 to 50
stepsa funnel's steps in order: a page (/pricing) or an event name (Signup)

The metric catalogue

GET /v1/dashboards/metrics (or vibiz dashboards metrics) lists every metric with its levels, shapes, breakdowns, filters, unit and the permission a Limited key needs. Money is in US cents (usd_cents); AI and product spend in millionths of a dollar (usd_micro). Every metric works at both levels unless it says otherwise, and every one that can be split takes project as a breakdown at the account level.

MetricWhat it isBreakdownsUnit
payments.revenuesales net of refunds (other currencies as they settled), by the day of the salecurrencyusd_cents
payments.salespayments that went throughcurrencycount
payments.refundsrefunded of the sales in the rangeusd_cents
payments.mrrmonthly recurring revenue of paying subscriptions; over time, at the end of each periodusd_cents
payments.active_subscribersactive, trialing and past due subscriptionscount
payments.new_subscriptionssubscriptions startedcount
payments.churned_subscriptionssubscriptions canceledcount
payments.churn_ratecanceled in the period over active at its startpercent
payments.arpurevenue over the customers who paidusd_cents
payments.latestthe newest payments (customers' emails masked for a Limited key without live payment details)list
payments.subscription_retentioncohorts by month of start, share still paying each month after (at least the last 6 months)percent
analytics.visitorsunique visitors (a visitor counts once a day)source, country, device, pagecount
analytics.pageviewspages viewedsource, country, device, pagecount
analytics.eventscustom and server-side eventsevent, page, countrycount
analytics.funnelvisitors through steps, same visitor, same dayfunnel
replay.sessionsrecorded sessionsdevice, countrycount
replay.error_sessionssessions with a JavaScript errordevice, countrycount
replay.errorsJavaScript errorsdevice, countrycount
replay.rage_clicksrage clicksdevice, countrycount
replay.dead_clicksdead clicksdevice, countrycount
replay.problem_sessionsthe latest sessions with problems, each with a link to watch itlist
sign_in.signupsaccounts created in the appcount
sign_in.active_usersusers who signed incount
sign_in.usersevery account, nowcount
sign_in.latest_signupsthe newest accountslist
ai.spendwhat AI calls costmodel, kindusd_micro
ai.callsAI callsmodel, kindcount
usage.spendwhat every product costproduct, toolusd_micro
email.sentemails the app sentcount
email.receivedmessages in the business's inboxcount
email.newsletter_sendsbroadcast and automation emails sentkind, statuscount
email.opensnewsletter emails opened by a personkindcount
email.bouncesnewsletter emails that bouncedkindcount
email.new_contactscontacts added to the liststatuscount
hosting.deploysdeployments startedstatus, targetcount
hosting.latest_deploysthe newest deploymentslist
phone.callscalls made and receiveddirection, statuscount
phone.messagestexts sent and receiveddirectioncount
social.posts_publishedsocial posts that went outcount
connectors.callscalls to your own APIs through connectorsstatus, riskcount
portfolio.projectsaccount only: one row per business with visitors, revenue, sales, MRR, AI spend, sessions with errors and deploystable

Payments metrics read production unless filters.environment is development.

Who can see what

Any key can make and change dashboards: they are views. What a widget reads keeps the permission of reading it directly (Keys):

  • Sign-in metrics read the app's own production database: a Limited key needs database.production:read. Without it, that widget alone answers forbidden with the permission and a grant_url (the page where the owner allows it); the rest of the dashboard still loads. Set the widget's filters.environment to development to read the development database instead.
  • Latest payments shows customers' emails masked unless the key has payments.live:read, as the payments list does. Totals (revenue, MRR, churn) are readable by any key, as GET /v1/projects/:id/payments/revenue is.
  • Every dashboard and every business is the account's own: another account's dashboard or project is 404.

Errors that say what to fix

A spec with problems is refused with every problem named by its field, why, and what would work:

JSON
{
  "error": {
    "code": "invalid_request",
    "message": "widgets.0.metric: \"payments.mrrr\" isn't a metric (did you mean payments.mrr?); widgets.1.type: a funnel widget can't show payments.revenue (it answers scalar, timeseries, table).",
    "details": {
      "field": "widgets.0.metric",
      "problems": [
        { "field": "widgets.0.metric", "message": "widgets.0.metric: \"payments.mrrr\" isn't a metric (did you mean payments.mrr?)" },
        { "field": "widgets.1.type", "message": "widgets.1.type: a funnel widget can't show payments.revenue (it answers scalar, timeseries, table)" }
      ],
      "next_step": "Pick one from GET /v1/dashboards/metrics (vibiz dashboards metrics)."
    }
  }
}

When reading data, each widget fails on its own: widgets[].error has code, message and details.next_step, and the console shows it in the widget with the link to fix it.

In the console

  • Dashboards in the sidebar is the account's; a project's sidebar has its own Dashboards.
  • New dashboard: a template or blank. Edit shows each widget's controls: move (arrows), narrower and wider, shorter and taller, rename and remove; whatever a widget is moved onto slides down. Add widget browses the metrics by product, shows the types each fits and a live preview before adding it.
  • The range (?range=30d, or ?from=2026-10-01&to=2026-10-31), the business picked on an account dashboard (?projects=<id>) and edit mode (?edit=1) are in the URL, so a link opens the same view.
  • Numbers are kept a minute; the refresh button reads them again now.

From an agent

Terminal
vibiz dashboards                                   # this project's dashboards (--level account: the account's)
vibiz dashboards metrics --product payments        # the catalogue
vibiz dashboards create --template traffic --open
vibiz dashboards create "Weekly numbers" --level account
vibiz dashboards add-widget dsh_… --type table --metric analytics.visitors --breakdown country --limit 8
vibiz dashboards add-widget dsh_… --type funnel --metric analytics.funnel --steps /,/pricing,Signup
vibiz dashboards show dsh_… --range 7d              # every widget's numbers, and the link
vibiz dashboards rm-widget dsh_… w_… | rm dsh_… | open dsh_…

MCP: vibiz_dashboards { action: "metrics" | "list" | "create" | "get" | "data" | "update" | "delete" | "add_widget" | "update_widget" | "remove_widget" | "query", … }. query reads one unsaved widget, to try a metric before adding it.

SDK:

TypeScript
const d = await vibiz.dashboards.create({ template: 'churn', project_id: 'prj_…' });
await vibiz.dashboards.addWidget(d.id, {
  type: 'line',
  metric: 'analytics.visitors',
  options: { breakdown: 'source', limit: 5 },
});
const data = await vibiz.dashboards.data(d.id, { range: '90d' });
for (const w of data.widgets) console.log(w.title, w.error?.message ?? w.data);

API

RouteDoes
GET /v1/dashboards/metricsthe catalogue: metrics, widget types, ranges, buckets, templates
GET /v1/dashboardsthe dashboards; ?project_id= one project's, ?level=account the account's
POST /v1/dashboards{ name, project_id?, project_ids?, range?, widgets?, template? } → 201
GET /v1/dashboards/:idone dashboard and its widgets
PATCH /v1/dashboards/:id{ name?, description?, range?, project_ids?, widgets? }; widgets replaces the list
DELETE /v1/dashboards/:iddelete it (the data stays)
POST /v1/dashboards/:id/widgetsadd one widget
PATCH /v1/dashboards/:id/widgets/:widgetIdchange one widget
DELETE /v1/dashboards/:id/widgets/:widgetIdremove one widget
GET /v1/dashboards/:id/dataevery widget's data: ?range= or ?from=&to=, ?project_ids=a,b, ?widget=, ?refresh=1
POST /v1/dashboards/queryone unsaved widget's data

A widget's data, by shape:

JSON
{ "shape": "scalar", "unit": "usd_cents", "value": 482300, "previous": 401200, "change_pct": 20 }
{ "shape": "timeseries", "unit": "count", "bucket": "day", "keys": ["2026-11-11", "…"],
  "series": [{ "key": "Google", "label": "Google", "values": [12, 15], "total": 27 }] }
{ "shape": "table", "unit": "count", "columns": [{ "key": "label", "label": "Source" }, { "key": "value", "label": "Visitors" }],
  "rows": [{ "key": "Google", "label": "Google", "value": 27, "share": 61.4 }] }
{ "shape": "funnel", "unit": "count", "steps": [{ "step": "/pricing", "visitors": 120, "rate_from_start": 100, "rate_from_previous": null }] }
{ "shape": "cohort", "unit": "percent", "periods": 6, "cohorts": [{ "key": "2026-06", "label": "Jun 2026", "size": 40, "values": [100, 92.5, 85] }] }