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

Get user

Deprecated
GET
/api/v2/users/:projectKey/:environmentKey/:userKey
GET
/api/v2/users/:projectKey/:environmentKey/:userKey
$curl https://app.launchdarkly.com/api/v2/users/projectKey/environmentKey/userKey \
> -H "Authorization: <apiKey>"
1{
2 "lastPing": "2022-06-28T23:21:29.176609596Z",
3 "environmentId": "1234a56b7c89d012345e678f",
4 "ownerId": "12ab3c45de678910abc12345",
5 "user": {
6 "key": "user-key-123abc",
7 "secondary": "2398127",
8 "ip": "10.10.10.10",
9 "country": "United States",
10 "email": "sandy@example.com",
11 "firstName": "Sandy",
12 "lastName": "Smith",
13 "avatar": "http://example.com/avatar.png",
14 "name": "Sandy Smith",
15 "anonymous": false,
16 "custom": {},
17 "privateAttrs": [
18 "string"
19 ]
20 },
21 "sortValue": null,
22 "_links": {
23 "parent": {
24 "href": "/api/v2/users/my-project/my-environment",
25 "type": "application/json"
26 },
27 "self": {
28 "href": "/api/v2/users/my-project/my-environment/my-user",
29 "type": "application/json"
30 },
31 "settings": {
32 "href": "/api/v2/users/my-project/my-environment/my-user/flags",
33 "type": "text/html"
34 },
35 "site": {
36 "href": "/my-project/my-environment/users/my-user",
37 "type": "text/html"
38 }
39 },
40 "_access": {
41 "denied": [
42 {
43 "action": "string",
44 "reason": {
45 "effect": "allow",
46 "resources": [
47 "proj/*:env/*;qa_*:/flag/*"
48 ],
49 "notResources": [
50 "string"
51 ],
52 "actions": [
53 "*"
54 ],
55 "notActions": [
56 "string"
57 ],
58 "role_name": "string"
59 }
60 }
61 ],
62 "allowed": [
63 {
64 "action": "string",
65 "reason": {
66 "effect": "allow",
67 "resources": [
68 "proj/*:env/*;qa_*:/flag/*"
69 ],
70 "notResources": [
71 "string"
72 ],
73 "actions": [
74 "*"
75 ],
76 "notActions": [
77 "string"
78 ],
79 "role_name": "string"
80 }
81 }
82 ]
83 }
84}
> ### Use contexts instead > > After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use [Get context instances](https://launchdarkly.com/docs/api/contexts/get-context-instances) instead of this endpoint. Get a user by key. The `user` object contains all attributes sent in `variation` calls for that key.
Was this page helpful?
Previous

List users

Next
Built with

Use contexts instead

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

Get a user by key. The user object contains all attributes sent in variation calls for that key.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

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

Response

User response
lastPingdatetime
Timestamp of the last time this user was seen
environmentIdstring
The environment ID
ownerIdstring
The ID of the member who is the owner for this account
userobject
Details on the user
sortValueany

If this record is returned as part of a list, the value used to sort the list. This is only included when the sort query parameter is specified. It is a time, in Unix milliseconds, if the sort is by lastSeen. It is a user key if the sort is by userKey.

_linksmap from strings to objects
The location and content type of related resources
_accessobject
Details on the allowed and denied actions for this user

Errors

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