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:
Readpermission.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or auth_token) | API key authentication |
auth_token | String | Yes (or api_key) | Auth token authentication |
app_id | String | Yes | App ID |
method | String | Yes | Must 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
| Field | Type | Description |
|---|---|---|
unidentified | Number | Users without profile info (hasInfo != true) |
total | Number | Total estimated users in app users collection |
Error Responses
- HTTP 401 - Invalid auth:
{
"result": "User does not exist"
}
Behavior
- Requires
Readpermission on the User Profiles feature. - Reads from
app_users{app_id}. totalis returned from MongoDBestimatedDocumentCount(), so it is intended as a fast estimate of total user documents.unidentifiedis returned fromcount({"hasInfo": {"$ne": true}}), so it counts users wherehasInfois missing or not exactlytrue.- The endpoint does not apply query, segment, cohort, or date filters.
- The handler returns only
{unidentified, total}.
Related Endpoints
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.app_users{appId} | Per-app user profiles | Stores user-level properties and profile fields affected by this endpoint. |