Skip to main content

/o/server-stats/data-points

Endpoint

/o/server-stats/data-points

Overview

Returns aggregated server data-point metrics (sessions/events and derived totals) for accessible apps over the requested period.

Authentication

Countly API supports three authentication methods:

  1. API Key (parameter): api_key=YOUR_API_KEY
  2. Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  3. Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

Authenticated dashboard user credentials are required (api_key or auth_token).

  • Non-global users are restricted to apps from their user-app access list.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)API key for authentication.
auth_tokenStringNoAuth token as query parameter or countly-token header.
periodStringNoPeriod expression supported by Countly period parser (default: 30days).
selected_appStringNoRestrict output to one app ID.

Response

Success Response

{
"all-apps": {
"events": 1240,
"sessions": 910,
"push": 30,
"dp": 2150,
"change": 180,
"crash": 6,
"views": 420,
"actions": 110,
"nps": 14,
"surveys": 5,
"ratings": 9,
"apm": 44,
"custom": 1170,
"cs": 2,
"ps": 25,
"llm": 7,
"aclk": 3
},
"6991c75b024cb89cdc04efd2": {
"events": 1240,
"sessions": 910,
"push": 30,
"dp": 2150,
"change": 180,
"crash": 6,
"views": 420,
"actions": 110,
"nps": 14,
"surveys": 5,
"ratings": 9,
"apm": 44,
"custom": 1170,
"cs": 2,
"ps": 25,
"llm": 7,
"aclk": 3
}
}

Response Fields

FieldTypeDescription
(root)ObjectRaw map of aggregated datapoint objects keyed by all-apps and/or app IDs.
{key}.eventsNumberTotal event count in requested range.
{key}.sessionsNumberTotal session count in requested range.
{key}.dpNumberTotal datapoints (sessions + event datapoints).
{key}.changeNumberCurrent period datapoint difference vs previous period.
{key}.pushNumberPush action count.
{key}.crashNumberCrash count.
{key}.viewsNumberView count.
{key}.actionsNumberAction count.
{key}.npsNumberNPS event count.
{key}.surveysNumberSurvey event count.
{key}.ratingsNumberStar-rating event count.
{key}.apmNumberAPM event count.
{key}.customNumberCustom-event count.
{key}.csNumberConsent-event count.
{key}.psNumberPush-sent count.
{key}.llmNumberLLM-event count.
{key}.aclkNumberAttribution-click event count.

Error Responses

401 Unauthorized

{
"result": "User does not have apps"
}

400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Global modeAuthenticated user is global admin and selected_app not setAggregates matching period buckets across all apps.Raw object keyed by all-apps and app IDs.
Global single-app modeGlobal admin with selected_appAggregates only selected app and suppresses all-apps aggregate.Raw object keyed by selected app ID.
Restricted modeAuthenticated non-global userAggregates only apps returned by user-app access list; optional selected_app is applied only if in that list.Raw object keyed by accessible app IDs and all-apps aggregate when not single-app.

Impact on Other Data

  • This endpoint is read-only and does not mutate persisted metrics.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication validationReads member account and lock status during authenticated-user validation authentication.
countly.server_stats_data_pointsStores monthly and hourly datapoint metrics per appReads period-matching metric documents and aggregates counters for output.

Examples

Read datapoints for default period

/o/server-stats/data-points?api_key=YOUR_API_KEY

Read datapoints for one app and custom period

/o/server-stats/data-points?api_key=YOUR_API_KEY&selected_app=YOUR_APP_ID&period=60days

Limitations

  • Metric output depends on pre-aggregated server_stats_data_points documents.
  • Non-global users without app access receive User does not have apps.

Last Updated

2026-02-17