Skip to main content

User Profiles - Counts

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/o?method=user_counts

Overview

Returns total user count and unidentified user count.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

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

Examples

/o?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&method=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

  • 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}.
Implementation details

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.