For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
      • DELDelete user
      • GETFind users
      • GETGet user
      • GETList users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewUsers

Find users

Deprecated
GET
/api/v2/user-search/:projectKey/:environmentKey
GET
/api/v2/user-search/:projectKey/:environmentKey
$curl https://app.launchdarkly.com/api/v2/user-search/projectKey/environmentKey \
> -H "Authorization: <apiKey>"
1{
2 "totalCount": 245,
3 "items": [
4 {
5 "lastPing": "2022-06-28T23:21:29.176609596Z",
6 "environmentId": "1234a56b7c89d012345e678f",
7 "ownerId": "12ab3c45de678910abc12345",
8 "user": {
9 "key": "user-key-123abc",
10 "secondary": "2398127",
11 "ip": "10.10.10.10",
12 "country": "United States",
13 "email": "sandy@example.com",
14 "firstName": "Sandy",
15 "lastName": "Smith",
16 "avatar": "http://example.com/avatar.png",
17 "name": "Sandy Smith",
18 "anonymous": false,
19 "custom": {},
20 "privateAttrs": [
21 "string"
22 ]
23 },
24 "sortValue": null,
25 "_links": {
26 "parent": {
27 "href": "/api/v2/users/my-project/my-environment",
28 "type": "application/json"
29 },
30 "self": {
31 "href": "/api/v2/users/my-project/my-environment/my-user",
32 "type": "application/json"
33 },
34 "settings": {
35 "href": "/api/v2/users/my-project/my-environment/my-user/flags",
36 "type": "text/html"
37 },
38 "site": {
39 "href": "/my-project/my-environment/users/my-user",
40 "type": "text/html"
41 }
42 },
43 "_access": {
44 "denied": [
45 {
46 "action": "string",
47 "reason": {
48 "effect": "allow",
49 "resources": [
50 "proj/*:env/*;qa_*:/flag/*"
51 ],
52 "notResources": [
53 "string"
54 ],
55 "actions": [
56 "*"
57 ],
58 "notActions": [
59 "string"
60 ],
61 "role_name": "string"
62 }
63 }
64 ],
65 "allowed": [
66 {
67 "action": "string",
68 "reason": {
69 "effect": "allow",
70 "resources": [
71 "proj/*:env/*;qa_*:/flag/*"
72 ],
73 "notResources": [
74 "string"
75 ],
76 "actions": [
77 "*"
78 ],
79 "notActions": [
80 "string"
81 ],
82 "role_name": "string"
83 }
84 }
85 ]
86 }
87 }
88 ],
89 "_links": {
90 "next": {
91 "href": "/api/v2/user-search/my-project/my-environment?after=1647993600000&limit=20&searchAfter=my-user&sort=userKey",
92 "type": "application/json"
93 },
94 "self": {
95 "href": "/api/v2/user-search/my-project/my-environment?after=1647993600000&limit=20&sort=userKey",
96 "type": "application/json"
97 }
98 }
99}
> ### 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).
Was this page helpful?
Previous

Get user

Next
Built with

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.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key
environmentKeystringRequiredformat: "string"
The environment key

Query parameters

qstringOptionalformat: "string"

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

limitlongOptional

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

offsetlongOptionalDeprecated

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

afterlongOptional
A Unix epoch time in milliseconds specifying the maximum last time a user requested a feature flag from LaunchDarkly
sortstringOptionalformat: "string"

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

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

filterstringOptionalformat: "string"

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

Response

Users collection response
totalCountinteger
The total number of users in the environment
itemslist of objects
Details on the users
_linksmap from strings to objects
The location and content type of related resources

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error