Skip to main content

User Profiles - Counts

Endpoint

/o?method=user_counts

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Returns total user count and unidentified user count.

Authentication

Authentication methods:

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • User Profiles: Read permission.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID
methodStringYesMust be user_counts

Response

Success Response

{
"unidentified": 3,
"total": 245
}

Response Fields

FieldTypeDescription
unidentifiedNumberUsers without profile info (hasInfo != true)
totalNumberTotal estimated users in app users collection

Error Responses

  • HTTP 401 - Invalid auth:
{
"result": "User does not exist"
}

Behavior/Processing

  • Requires Read permission on the User Profiles feature.
  • Reads from app_users{app_id}.
  • total is returned from MongoDB estimatedDocumentCount(), so it is intended as a fast estimate of total user documents.
  • unidentified is returned from count({"hasInfo": {"$ne": true}}), so it counts users where hasInfo is missing or not exactly true.
  • The endpoint does not apply query, segment, cohort, or date filters.
  • The handler returns only {unidentified, total}.

Database Collections

CollectionUsed forData touched by this endpoint
countly.app_users{appId}Per-app user profilesStores user-level properties and profile fields affected by this endpoint.

Examples

/o?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&method=user_counts

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions.


Last Updated

2026-04-18