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

List users

Deprecated
GET
/api/v2/users/:projectKey/:environmentKey
GET
/api/v2/users/:projectKey/:environmentKey
$curl https://app.launchdarkly.com/api/v2/users/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/users/my-project/my-environment?after=1647993600000&limit=20&searchAfter=my-user",
92 "type": "application/json"
93 },
94 "self": {
95 "href": "/api/v2/users/my-project/my-environment?after=1647993600000&limit=20",
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 contexts](https://launchdarkly.com/docs/api/contexts/search-contexts) instead of this endpoint. List all users in the environment. Includes the total count of users. This is useful for exporting all users in the system for further analysis. Each page displays users up to a set `limit`. The default is 20. To page through, follow the `next` link in the `_links` object. To learn more, read [Representations](https://launchdarkly.com/docs/api#representations).
Was this page helpful?
Previous

Users Beta

Next
Built with

Use contexts instead

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

List all users in the environment. Includes the total count of users. This is useful for exporting all users in the system for further analysis.

Each page displays users up to a set limit. The default is 20. To page through, 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

limitlongOptional
The number of elements to return per page
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.

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