v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
Users

Find users

Use contexts instead

After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Search for context instances instead of this endpoint.

Search users in LaunchDarkly based on their last active date, a user attribute filter set, or a search query.

An example user attribute filter set is filter=firstName:Anna,activeTrial:false. This matches users that have the user attribute firstName set to Anna, that also have the attribute activeTrial set to false.

To paginate through results, follow the next link in the _links object. To learn more, read Representations.

get/api/v2/user-search/{projectKey}/{environmentKey}

Path parameters

projectKeystring string required

The project key

The project key

environmentKeystring string required

The environment key

The environment key

Query parameters

qstring string

Full-text search for users based on name, first name, last name, e-mail address, or key

Full-text search for users based on name, first name, last name, e-mail address, or key

limitinteger

Specifies the maximum number of items in the collection to return (max: 50, default: 20)

Specifies the maximum number of items in the collection to return (max: 50, default: 20)

offsetinteger

Deprecated, use searchAfter instead. Specifies the first item to return in the collection.

Deprecated, use searchAfter instead. Specifies the first item to return in the collection.

afterinteger

A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly

A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly

sortstring string

Specifies a field by which to sort. LaunchDarkly supports the userKey and lastSeen fields. Fields prefixed by a dash ( - ) sort in descending order.

Specifies a field by which to sort. LaunchDarkly supports the userKey and lastSeen fields. Fields prefixed by a dash ( - ) sort in descending order.

searchAfterstring string

Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the next link we provide instead.

Limits results to users with sort values after the value you specify. You can use this for pagination, but we recommend using the next link we provide instead.

filterstring string

A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue

A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue

Response

Users collection response

_linksobject

The location and content type of related resources

totalCountinteger required

The total number of users in the environment

Example response

{
  "_links": {
    "next": {
      "href": "/api/v2/user-search/my-project/my-environment?after=1647993600000&limit=20&searchAfter=my-user&sort=userKey",
      "type": "application/json"
    },
    "self": {
      "href": "/api/v2/user-search/my-project/my-environment?after=1647993600000&limit=20&sort=userKey",
      "type": "application/json"
    }
  },
  "totalCount": 245,
  "items": [
    {
      "lastPing": "2022-06-28T23:21:29.176609596Z",
      "user": {
        "key": "user-key-123abc",
        "secondary": "2398127",
        "ip": "10.10.10.10",
        "country": "United States",
        "email": "sandy@example.com",
        "firstName": "Sandy",
        "lastName": "Smith",
        "avatar": "http://example.com/avatar.png",
        "name": "Sandy Smith"
      },
      "sortValue": "user-key-123abc",
      "_links": {
        "parent": {
          "href": "/api/v2/users/my-project/my-environment",
          "type": "application/json"
        },
        "self": {
          "href": "/api/v2/users/my-project/my-environment/my-user",
          "type": "application/json"
        },
        "settings": {
          "href": "/api/v2/users/my-project/my-environment/my-user/flags",
          "type": "text/html"
        },
        "site": {
          "href": "/my-project/my-environment/users/my-user",
          "type": "text/html"
        }
      },
      "_access": {
        "denied": [
          {
            "reason": {
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "actions": [
                "*"
              ],
              "effect": "allow"
            }
          }
        ],
        "allowed": [
          {
            "reason": {
              "resources": [
                "proj/*:env/*;qa_*:/flag/*"
              ],
              "actions": [
                "*"
              ],
              "effect": "allow"
            }
          }
        ]
      }
    }
  ]
}