GET
/api/public/v1/analytics/report

Get the analytics report

Ask for up to three metrics over one range and get a series per metric on a shared time axis, plus a summary comparing the window against the one before it. Everything is derived on read; nothing here is a stored figure. Unknown metric keys are dropped rather than rejected, so retiring one never breaks a saved call — and because one plot has one y-scale, the first metric decides the unit and any later one that disagrees is dropped too. Ask with no metric at all and you get whichever chart this company actually has data behind. The `locationId` filter can only narrow what the token already reaches.

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

Query Parameters

NameTypeRequiredDescription
metricstringOptionalRepeatable, up to three. From the metrics endpoint.
rangestringOptionalFrom the metrics endpoint’s `ranges`.
locationIdstringOptionalRepeatable. Omit for every location the token can reach.
chartstring
area
bar
line
OptionalCarried through to the response for rendering.
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/analytics/report" \
  -H "Authorization: Bearer your_access_token"
200Example response
json
{
  "message": "Analytics report retrieved successfully!",
  "content": {
    "config": {
      "metrics": [
        "revenue"
      ],
      "range": "30d",
      "chart": "area",
      "locationIds": []
    },
    "points": [
      {
        "bucket": "2026-08-01T00:00:00.000Z",
        "revenue": 1420000
      }
    ],
    "summaries": [
      {
        "key": "revenue",
        "current": 4210000,
        "previous": 3880000,
        "percent": 8.5
      }
    ],
    "empty": false,
    "rangeNoun": "the 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