Skip to main content

Populator - Environment List

Endpoint

/o/populator/environment/list

Overview

Returns all saved environments for the selected app.

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 whose environments are returned.
api_keyStringConditionalRequired when auth_token is not provided.
auth_tokenStringConditionalRequired when api_key is not provided.

Response

Success Response

[
{
"_id": "3c7ffdf5b8200ee192968ad89dd4e180d5386c01",
"name": "Production Seed",
"templateId": "65f0cbf8bca6b8e8fbf7f901",
"appId": "6991c75b024cb89cdc04efd2",
"createdAt": 1709900000000
},
{
"_id": "a5503f74ae6b7e3d686addfd23c87617f3890bfe",
"name": "Staging EU",
"templateId": "65f0cbf8bca6b8e8fbf7f901",
"appId": "6991c75b024cb89cdc04efd2",
"createdAt": 1709900500000
}
]

Response Fields

FieldTypeDescription
_idStringEnvironment ID (SHA-1 hash derived from app + environment name).
nameStringEnvironment display name.
templateIdStringTemplate ID associated with this environment.
appIdStringApp ID for the environment.
createdAtNumberEnvironment creation timestamp (ms).

Error Responses

400 Bad Request

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

401 Unauthorized

{
"result": "No app_id provided"
}

500 Internal Server Error

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

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Environment listValid auth and app accessReads all environments where appId equals request app_id.Raw root array: [ ... ]

Database Collections

CollectionUsed forData touched by this endpoint
countly.populator_environmentsEnvironment metadataReads all matching documents for appId.
countly.membersAuthentication and authorizationReads member context for permission checks.
countly.appsApp rights validationReads app access context from app_id.

Examples

List all environments for one app

https://your-server.com/o/populator/environment/list?
app_id=6991c75b024cb89cdc04efd2&
api_key=YOUR_API_KEY

Limitations

  • Response is not paginated; large numbers of environments are returned in one array.
  • Ordering depends on MongoDB natural order because no explicit sort is applied.

Last Updated

2026-02-17