Skip to main content

Populator - Environment Check

Endpoint

/o/populator/environment/check

Overview

Checks whether an environment name is already used in the app. Matching is case-insensitive.

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 context used for duplicate check scope.
api_keyStringConditionalRequired when auth_token is not provided.
auth_tokenStringConditionalRequired when api_key is not provided.
environment_nameStringYesName candidate to validate.

Response

Success Response

Name available:

{
"result": true
}

Duplicate detected:

{
"errorMsg": "Duplicated environment name detected for this application! Please try with an another name"
}

Response Fields

FieldTypeDescription
resultBooleanReturned as true when no matching name exists.
errorMsgStringReturned when a duplicate name exists.

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
Name availableNo environment matched by app/name regexReturns availability result.Raw root object: { "result": true }
Duplicate nameAt least one environment matches app/name regexReturns duplicate message.Raw root object: { "errorMsg": "..." }

Database Collections

CollectionUsed forData touched by this endpoint
countly.populator_environmentsEnvironment metadata lookupReads by appId and case-insensitive regex on name, with limit(1).
countly.membersAuthentication and authorizationReads member context for permission checks.
countly.appsApp rights validationReads app access context from app_id.

Examples

Check if a new environment name is available

https://your-server.com/o/populator/environment/check?
app_id=6991c75b024cb89cdc04efd2&
api_key=YOUR_API_KEY&
environment_name=Staging EU

Detect duplicate environment name

https://your-server.com/o/populator/environment/check?
app_id=6991c75b024cb89cdc04efd2&
api_key=YOUR_API_KEY&
environment_name=production seed

Limitations

  • environment_name is matched via regex, so special regex characters can change matching behavior.
  • Endpoint does not normalize whitespace; provide the intended final display name when checking.

Last Updated

2026-02-17