---
title: "Live numbers for the experiments dashboard"
method: GET
path: "/api/admin/experiments"
tags: ["admin-affiliate"]
---

# Live numbers for the experiments dashboard

`GET /api/admin/experiments`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/api/admin/experiments`
- Auth: HTTP bearer

Depends on the self-hosted **Umami** analytics API: the runtime env `UMAMI_URL`, `UMAMI_USERNAME` and `UMAMI_PASSWORD` must be set. The server logs in at `<UMAMI_URL>/api/auth/login`, caches the token in-process and logs in again once on a 401.

For every experiment in `EXPERIMENTS` (`src/lib/experiments.ts`) it queries `/api/websites/0e838cbf-d608-4400-b2c7-4557f2613cec/metrics?type=event` and `/event-data/values` per event and property, for the window from `shippedAt` 00:00 UTC to now. Experiments with a `pb` check additionally get PocketBase cohort stats from `users` and `wireframe_states`; the recent cohort covers at most the last 13 days because unverified accounts are pruned after 14.

Any failure (Umami not configured, login or query failed, PocketBase error) answers 502.

## Response `200`

Experiment numbers.

- AdminExperimentsReport
  - `generatedAt` integer, required: Unix epoch milliseconds.
  - `experiments` AdminExperimentResult[], required
    - `id` string, required: `EXPERIMENTS[].id`.
    - `sinceDays` number, required: Days since `shippedAt`, at least 1.
    - `events` object, required: Umami event name → stats.
    - `pb` AdminExperimentPbStats
      - `verifiedNewUsers` integer, required: Verified accounts created since `shippedAt`.
      - `recent` AdminExperimentPbCohort, required: Prune-free tail cohort: the only honest denominator for percentages.
        - `since` string, date, required: Day the cohort starts.
        - `newUsers` integer, required
        - `verifiedNewUsers` integer, required
        - `activatedNewUsers` integer, required: Cohort users owning at least one `wireframe_states` record.

## Other responses

- `403`: Admin access required. Returned for a missing, invalid or expired bearer token as well as for a valid token whose user lacks `is_admin=true`; admin endpoints never answer 401.
- `502`: Umami is not configured, unreachable or failed, or a PocketBase query failed; `error` carries the message.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
