Get user

GET /api/users/{userId}

Get user data for the given ID.

Path parameters

  • userId string Required

    The unique identifier of the user.

Query parameters

  • If it's provided with a truthy value (true, 1, yes), each user in the response will include a ssoIdentities property containing a list of SSO identities associated with the user.

Responses

  • 200 application/json

    User data for the given ID.

    Hide response attributes Show response attributes object
    • id string Required

      Minimum length is 1, maximum length is 12.

    • username string | null Required

      Maximum length is 128.

    • primaryEmail string | null Required

      Maximum length is 128.

    • primaryPhone string | null Required

      Maximum length is 128.

    • name string | null Required

      Maximum length is 128.

    • avatar string | null Required

      Maximum length is 2048.

    • customData object Required

      arbitrary

    • identities object Required
      Hide identities attribute Show identities attribute
    • lastSignInAt number | null Required
    • createdAt number Required
    • applicationId string | null Required

      Maximum length is 21.

    • isSuspended boolean Required
    • ssoIdentities array[object]

      List of SSO identities associated with the user. Only available when the includeSsoIdentities query parameter is provided with a truthy value.

      Hide ssoIdentities attributes Show ssoIdentities attributes object
      • id string Required

        Minimum length is 1, maximum length is 21.

      • userId string Required

        Minimum length is 1, maximum length is 12.

      • issuer string Required

        Minimum length is 1, maximum length is 256.

      • identityId string Required

        Minimum length is 1, maximum length is 128.

      • detail object Required

        arbitrary

      • createdAt number Required
      • ssoConnectorId string Required

        Minimum length is 1, maximum length is 128.

  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

  • 404

    Not Found

GET /api/users/{userId}
curl \
 -X GET https://[tenant_id].logto.app/api/users/{userId}
Response examples (200)
{
  "id": "string",
  "username": "string",
  "primaryEmail": "string",
  "primaryPhone": "string",
  "name": "string",
  "avatar": "string",
  "customData": {},
  "identities": {},
  "lastSignInAt": 42.0,
  "createdAt": 42.0,
  "applicationId": "string",
  "isSuspended": true,
  "hasPassword": true,
  "ssoIdentities": [
    {
      "id": "string",
      "userId": "string",
      "issuer": "string",
      "identityId": "string",
      "detail": {},
      "createdAt": 42.0,
      "ssoConnectorId": "string"
    }
  ]
}