User populations

User populations API operations

The user populations endpoints support the following operations:

For hands-on experience with the users API endpoints, click the Run in Postman button below to download a Postman collection that you can import and open in your local Postman application.

Users data model

Property Description
id A string that specifies the population ID associated with the user resource ID identified in the request URL.

Response codes

Code Message
200 Successful operation.
201 Successfully created.
204 Successfully removed. No content.
400 The request could not be completed.
401 You do not have access to this resource.
404 The requested resource was not found.

Endpoint examples

Get user population setting

To get the population ID associated with a single user resource, the GET /environments/{environmentId}/users/{userId}/population operation returns the population setting for the user resource with the ID specified in the request URL.

curl -X GET "{environmentId}/users/{userId}/population" \
-H "Authorization: Bearer jwtToken"

The response data looks like this:

    "_links": {
        "self": {
            "href": ""
        "environment": {
            "href": ""
    "id": "a701eb22-849d-4168-b756-6c20fc087c2f",

Update user population setting

To move a user from one population to another, you need to know the ID of the new population resource to associate with the user. To retrieve the list of all population IDs for a specified environment, you can call the GET /environments/{environmentId}/populations method.

The following sample shows the PUT /environments/{environmentId}/users/{userId}/population operation to associate the user with the different population.

curl -X "PUT" "{environmentId}/users/{userId}/population" \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer jwtToken' \
-d $'{
  "id": "21731b50-6b54-41b0-8454-9cd9de62a7a1"

In the request body, the id attribute value is the population ID for the new population to associate with the user.