GET /api/sites
Returns all distinct domains that have ingested at least one event. The dashboard uses this endpoint on load to populate the site picker dropdown.This endpoint requires no query parameters. It returns the full list of all known domains and their associated site IDs.
Response
Returns a JSON array of site stat objects, ordered alphabetically by domain.The domain recorded in event payloads (e.g.
example.com). This is the primary filter axis for all other analytics endpoints.The site ID associated with this domain. Computed as
COALESCE(NULLIF(site_id, ''), domain) — falls back to the domain value if no site_id was provided in the event payload.Response shape
SQL logic
COALESCE(NULLIF(site_id, ''), domain) expression means:
- If a
site_idwas configured in the SDK, it is returned as-is. - If
site_idis an empty string, thedomainvalue is used as a fallback.
| Status | Meaning |
|---|---|
200 OK | Query succeeded (empty array if no events have been ingested) |
500 Internal Server Error | Database query failed |
Examples
The dashboard calls this endpoint on load and selects the first domain automatically. If no sites appear, ensure the Iris SDK has been initialised and that at least one event has been recorded.