Skip to main content

Populator - Environment Read

Endpoint

/o/populator/environment/get

Overview

Returns generated users for a specific environment in a DataTables-compatible payload with optional pagination and search.

Authentication

Countly API supports three authentication methods:

  1. API key query parameter: api_key=YOUR_API_KEY
  2. Auth token query parameter: auth_token=YOUR_AUTH_TOKEN
  3. Auth token header: countly-token: YOUR_AUTH_TOKEN

Permissions

Requires Read permission for the Populator feature.

Request Parameters

ParameterTypeRequiredDescription
app_idStringYesApp ID used in environment-user ID prefix matching.
template_idStringYesTemplate ID used in environment-user ID prefix matching.
environment_idStringYesEnvironment ID used in environment-user ID prefix matching.
api_keyStringConditionalRequired when auth_token is not provided.
auth_tokenStringConditionalRequired when api_key is not provided.
sEchoString/NumberNoEcho value returned as-is in the response.
iDisplayStartNumberNoOffset. Default is 0.
iDisplayLengthNumberNoLimit. -1 means no limit.
sSearchStringNoCase-insensitive substring filter for userName.

Response

Success Response

{
"sEcho": 1,
"iTotalRecords": 2,
"iTotalDisplayRecords": 2,
"aaData": [
{
"_id": "6991c75b024cb89cdc04efd2_65f0cbf8bca6b8e8fbf7f901_3c7ffdf5b8200ee192968ad89dd4e180d5386c01_device-ios-001",
"userName": "qa_user_001",
"platform": "iOS",
"device": "iPhone 15",
"appVersion": "3.2.1",
"custom": {
"plan": "premium"
},
"createdAt": 1709900000000
}
]
}

Response Fields

FieldTypeDescription
sEchoString/NumberEcho value from request.
iTotalRecordsNumberTotal matching users for the environment filter.
iTotalDisplayRecordsNumberSame value as iTotalRecords in this response.
aaDataArray (Object)Page of matching environment-user records.
aaData[]. _idStringComposite generated-user ID (appId_templateId_environmentId_deviceId).
aaData[].userNameStringGenerated user name.
aaData[].platformStringGenerated user platform.
aaData[].deviceStringGenerated user device.
aaData[].appVersionStringGenerated user app version.
aaData[].customObjectGenerated user custom properties.
aaData[].createdAtNumberRecord creation timestamp (ms).

Error Responses

401 Unauthorized

{
"result": "Missing parameter environment_id"
}

401 Unauthorized

{
"result": "Missing parameter template_id"
}

401 Unauthorized

{
"result": "Missing parameter app_id"
}

400 Bad Request

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

500 Internal Server Error

{
"result": "Database error: operation failed"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Full list modeiDisplayLength missing or -1Counts matching users and returns all rows after optional skip.Raw root object with aaData array
Paginated modeiDisplayLength provided and not -1Counts matching users, applies skip + limit.Raw root object with aaData page
Search modesSearch providedAdds case-insensitive userName regex filter before count/query.Raw root object with filtered aaData

Database Collections

CollectionUsed forData touched by this endpoint
countly.populator_environment_usersGenerated environment usersCounts and aggregates users matching _id prefix and optional userName regex.
countly.membersAuthentication and authorizationReads member context for permission checks.
countly.appsApp rights validationReads app access context from app_id.

Examples

Read first page of users

https://your-server.com/o/populator/environment/get?
app_id=6991c75b024cb89cdc04efd2&
template_id=65f0cbf8bca6b8e8fbf7f901&
environment_id=3c7ffdf5b8200ee192968ad89dd4e180d5386c01&
api_key=YOUR_API_KEY&
iDisplayStart=0&
iDisplayLength=50&
sEcho=1

Search users by name in environment

https://your-server.com/o/populator/environment/get?
app_id=6991c75b024cb89cdc04efd2&
template_id=65f0cbf8bca6b8e8fbf7f901&
environment_id=3c7ffdf5b8200ee192968ad89dd4e180d5386c01&
api_key=YOUR_API_KEY&
sSearch=qa_user

Read full environment user list

https://your-server.com/o/populator/environment/get?
app_id=6991c75b024cb89cdc04efd2&
template_id=65f0cbf8bca6b8e8fbf7f901&
environment_id=3c7ffdf5b8200ee192968ad89dd4e180d5386c01&
api_key=YOUR_API_KEY&
iDisplayLength=-1

Operational Considerations

  • For large environments, this endpoint executes both a count query and an aggregation query.
  • Filtering is regex-based (sSearch), which may be expensive on large datasets.
  • No sort is applied, so returned order follows database natural order.

Limitations

  • Requires all three identifiers (app_id, template_id, environment_id) before auth/permission checks continue.
  • iTotalRecords and iTotalDisplayRecords are the same value.

Last Updated

2026-02-17