Analytics

Analytics Summary

Every metric summed over a range of UTC days (both ends inclusive; default: the 30 days ending today, at most 366), from the daily rollups, plus derived rates. Rollups are updated by the `analytics.rollup` job every few minutes (`as_of`). `sequence_id`, `channel` and `mailbox_id` repeat to match any of them.

API key access

Needs the analytics:read scope with an API key (ro_pat_...). A signed-in session uses the caller's role.
GET/api/v1/analytics/summary
AuthorizationBearer <token>

Access token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).

In: header

Query Parameters

from?string | null

First UTC day (default: to minus 29 days)

Formatdate
to?string | null

Last UTC day (default: today)

Formatdate
sequence_id?array<string> | null

Repeat to match any of

channel?array<EventChannel> | null

Repeat to match any of

mailbox_id?array<string> | null

Repeat to match any of

Header Parameters

X-Workspace-Id?string | null

Id of the workspace to act on (must be a member).

Response Body

curl -X GET "http://localhost:8000/api/v1/analytics/summary?from=2019-08-24&to=2019-08-24&sequence_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&channel=email&mailbox_id=497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "X-Workspace-Id: string"
{
  "from": "2019-08-24",
  "to": "2019-08-24",
  "timezone": "UTC",
  "as_of": "2019-08-24T14:15:22Z",
  "filters": {
    "sequence_id": [
      "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ],
    "channel": [
      "email"
    ],
    "mailbox_id": [
      "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ]
  },
  "metrics": {
    "property1": 0.1,
    "property2": 0.1
  },
  "rates": {
    "property1": 0,
    "property2": 0
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}