Skip to main content
Manage the current team’s sites (properties) and read their topline analytics. Every endpoint is scoped to the token’s team. A site is addressed by {siteKey} — either its UUID or its domain (a domain segment may contain dots). All endpoints require Authorization: Bearer {token}.

List sites

List the current team’s sites, each with a period-scoped overview (default last 24 hours). Pinned sites float to the top. Query parameters Response — flat JSON array of: revenue / revenue_sparkline are period payments (Stripe or API invoices in the window), not MRR. There is no top-level workspace summary on this endpoint — the response stays a flat array for compatibility. Use the MCP list-sites-tool (or the web dashboard) when you need aggregated totals. Breaking change: visitors_24h / change_24h were renamed to visitors / change and are always scoped to the selected period (default 24h). Status: 200 OK.

Create a site

Create a new site in the current team. This endpoint is gated by the team’s site quota (SitePolicy::create, via Gate::authorize('create', [Site::class, $team])): a team at its plan’s site ceiling, or with no active plan and no trial, is rejected with 403 Forbidden. The ceiling is a single global setting (config('clickbase.max_sites_per_team'), default 30) that applies to every team regardless of plan. Body parameters Response — a single site (see Response fields). Status: 201 Created.

Site overview

Topline analytics for one site over a date range, with the equivalent previous period for a delta. Path parameters Query parameters Response — a flat object: Status: 200 OK.

Update domain

Change a site’s domain. The domain keys the dashboard and public share URLs — update any bookmarks/integrations after this runs. Body parameters Response — a single site (see Response fields). Status: 200 OK.

Update timezone

Change the timezone that defines the site’s reporting day. Body parameters Response — a single site (see Response fields). Status: 200 OK.

Update currency

Change a site’s reporting currency. Body parameters Only a fixed subset of currencies is accepted: USD, EUR, GBP, BRL, JPY, CAD, AUD, CHF, CNY, INR, MXN, ZAR, SEK, NOK, DKK, PLN, CZK, HUF, RUB, TRY, KRW, SGD, HKD, NZD, THB, IDR, MYR, PHP, VND, AED. Anything else returns 422 ("This currency is not supported."). The UpdateSiteCurrency Action also rejects the change (both 422) when:
  • The site has any revenue goal (a goal with a non-null currency) — "Delete your revenue goals before changing the site currency." A revenue goal’s target amount is denominated in the currency active when it was created, so switching the site currency afterward would silently fork reporting into two currencies that can never be summed together again.
  • The site has payments recorded in a different reporting currency than the target (checked via SiteHasPaymentsInAnotherCurrency, which scans ClickHouse for any payment event whose revenue_reporting_currency differs) — "This team has payments recorded in another currency. Reconcile or remove them before changing the reporting currency." Every revenue reader sums payment amounts with no currency filter, so mixed-currency payments would add different minor units into one meaningless total.
Response — a single site (see Response fields). Status: 200 OK.

Update tracking mode

Body parameters Response — a single site (see Response fields). Status: 200 OK.

Update sharing

Toggle whether the site’s dashboard is publicly shared. Body parameters Response — a single site (see Response fields). Status: 200 OK.

Toggle pin

Pin the site to the top of the team’s site list, or unpin it if it’s already pinned. No body. Response — a single site (see Response fields). Status: 200 OK.

Delete a site

Permanently delete a site. Queues the removal of its analytics events and session replays (both in ClickHouse and their R2 blobs). Cannot be undone. Requires Admin or Owner. Authorized via SitePolicy::delete, which checks the site:delete team permission — only the Owner and Admin roles have it. A plain Member gets 403 Forbidden. Status: 204 No Content.

Timezone & currency options

The accepted values for Update timezone and Update currency, as combobox options — the same lists the dashboard’s site-settings selects use. Neither is scoped to a site. GET /api/timezones lists every IANA timezone identifier; GET /api/currencies lists every reporting currency UpdateSiteCurrency accepts, with a human-readable name from ICU. Response — a flat JSON array of: Status: 200 OK.

Response fields

The single-site endpoints (store, updateDomain, updateTimezone, updateCurrency, updateTrackingMode, updateSharing, togglePin) return: This is a different (richer) shape than the list sites endpoint, which returns a lighter per-site overview (favicon_url, visitors, change, sparkline, revenue, etc.) instead.