{siteKey} — either its UUID or its domain (a domain segment may contain dots).
All endpoints require Authorization: Bearer {token}.
List sites
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
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
Query parameters
Response — a flat object:
Status:
200 OK.
Update domain
Response — a single site (see Response fields). Status:
200 OK.
Update timezone
Response — a single site (see Response fields). Status:
200 OK.
Update currency
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 whoserevenue_reporting_currencydiffers) —"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.
200 OK.
Update tracking mode
Response — a single site (see Response fields). Status:
200 OK.
Update sharing
Response — a single site (see Response fields). Status:
200 OK.
Toggle pin
200 OK.
Delete a site
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
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.
