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​

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

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.

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

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​

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": "..." }

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

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.