v5

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

Get user

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.

get/api/v2/users/{projectKey}/{environmentKey}/{userKey}

Path parameters

projectKeystring string required

The project key

The project key

environmentKeystring string required

The environment key

The environment key

userKeystring string required

The user key

The user key

Response

User response

lastPingstring date-time

Timestamp of the last time this user was seen

environmentIdstring
ownerIdstring
sortValuestring

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

_linksobject

The location and content type of related resources

Example response

{
  "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"
        }
      }
    ]
  }
}