Analytics

Get a user metric

GET/analytics/users/{id}

Returns one named count over the token organisation's users, as a value or a series of {key, value} buckets; each slug is described under metric.

Counts the token's organisation, 404 when it has none; an entrepreneur gets 403 forbidden. Figures come from the analytics store, which trails live data. filter[created_at] bounds when a user was created, all time with none; logins and views take filter[occurred_at]. Use GET /analytics/users/{user_id}/activity for one user. An unknown metric is a 404. It only reads.

Path parameters

  • idstringRequired#

    What to count. Each value is described under x-enum-descriptions.

    One of: total, active-users, by-status, invites-accepted, investors, by-type, online, recently-active, invites-accepted-percent, active-vs-total, logins, views

Query parameters

  • filter[created_at]string (date-time)#

    Only users created in a range, written filter[created_at][gte]=2026-10-01. Takes gt, gte, lt and lte. With none, all users count. Not taken by logins and views. For active-vs-total it sets the window of buckets; with none, the last 12 months, 12 weeks or 30 days ending now.

  • filter[occurred_at]string (date-time)#

    Only events in a range, written filter[occurred_at][gte]=2026-10-01. Takes gt, gte, lt and lte. Taken only by logins and views; with none, all time.

  • granularitystring#

    The bucket size of a time series: day, week (starting Monday) or month. Defaults to month. Taken only by active-vs-total; any other slug answers 422. A window of more than 366 buckets is 422 validation_failed on filter.created_at.

    One of: day, week, monthDefault: "month"

Responses

200

The metric.

AnalyticsMetric
{
  "data": {
    "metric": "total",
    "category": "users",
    "filter": {},
    "value": 1284
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl https://your-org-domain/kong/core/api/v2/analytics/users/{id}\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"