provider Users GET /api/v2/user-search/{projectKey}/{environmentKey}
@utdk/launchdarkly /api/v2/user-search/{projectKey}/{environmentKey}
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](https://launchdarkly.com/docs/api/contexts/search-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](https://launchdarkly.com/docs/api#representations).
projectKey path required
The project key
string
environmentKey path required
The environment key
string
q query
Full-text search for users based on name, first name, last name, e-mail address, or key
string
limit query
Specifies the maximum number of items in the collection to return (max: 50, default: 20)
integer
offset query
Deprecated, use `searchAfter` instead. Specifies the first item to return in the collection.
integer
after query
A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly
integer
sort query
Specifies a field by which to sort. LaunchDarkly supports the `userKey` and `lastSeen` fields. Fields prefixed by a dash ( - ) sort in descending order.
string
searchAfter query
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.
string
filter query
A comma-separated list of user attribute filters. Each filter is in the form of attributeKey:attributeValue
string

Try it

Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

getsearchusers
GET/api/v2/user-search/{projectKey}/{environmentKey}
> ### Use contexts instead > > After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Search for context instances](https://launchdarkly.com/docs/api/contexts/search-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](https://launchdarkly.com/docs/api#representations).

Parameters

required

The project key

required

The environment key

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

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

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

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

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

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.

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

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import launchdarkly from '@utdk/launchdarkly';

await launchdarkly.getsearchusers()