Core
API v2.x
2

getCurrentUser #

Returns information about the currently logged in user.


Query Syntax #

HTTP #

Available since 2.4.0
Copied to clipboard!
URL: http://kuzzle:7512/_me
Method: GET
Headers: Authorization: "Bearer <authentication token>"
Deprecated since 2.4.0
Copied to clipboard!
URL: http://kuzzle:7512/users/_me
Method: GET
Headers: Authorization: "Bearer <authentication token>"

Other protocols #

Copied to clipboard!
{
  "controller": "auth",
  "action": "getCurrentUser",
  "jwt": "<authentication token>"
}

Arguments #

  • jwt: valid authentication token (for the HTTP protocol, the token is to be passed to the Authorization header instead)

Response #

The result contains the following properties:

  • _id: current user's kuid
  • _source: user information
    • profileIds: list of profile names associated to the user
    • any other properties: additional (and optional) user information
  • strategies: available authentication strategies for that user
Copied to clipboard!
{
  "status": 200,
  "error": null,
  "controller": "auth",
  "action": "getCurrentUser",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<kuid>",
    "_source": {
      "profileIds": ["customProfile1", "customProfile2"],
      "name": {
        "first": "Steve",
        "last": "Wozniak"
      }
    },
    "strategies": ["local"]
  }
}