GET
/api/public/v1/analytics/metricsList analytics metrics
The metric vocabulary the report accepts, and the ranges it can be asked over. Read this before calling the report — the `key` values here are the only ones it takes, and `unit` says how to render each. A `location` metric narrows with the `locationId` filter; a `company` one ignores it, because there is nothing per-location to narrow. Metrics are retired from time to time, so treat this as the current truth rather than caching it.
Required scope
The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.
analytics:read
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/analytics/metrics" \
-H "Authorization: Bearer your_access_token"200Example response
json
{
"message": "Analytics metrics retrieved successfully!",
"content": {
"metrics": [
{
"key": "revenue",
"label": "Revenue",
"hint": "Confirmed income, net of refunds.",
"unit": "currency",
"scope": "company"
}
],
"ranges": [
{
"key": "30d",
"label": "Last 30 days"
}
]
}
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.
Analytics
/analytics