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

  • includeSsoIdentities string

    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 attributes Show identities attributes object
      • Additional properties
      • userId string Required
      • details object

        arbitrary

    • lastSignInAt number | null Required
    • createdAt number Required
    • updatedAt number Required
    • profile object Required
      Hide profile attributes Show profile attributes object
      • familyName string
      • givenName string
      • middleName string
      • nickname string
      • preferredUsername string
      • profile string
      • website string
      • gender string
      • birthdate string
      • zoneinfo string
      • locale string
      • address object
        Hide address attributes Show address attributes object
        • formatted string
        • streetAddress string
        • locality string
        • region string
        • postalCode string
        • country string
    • applicationId string | null Required

      Maximum length is 21.

    • isSuspended boolean Required
    • hasPassword boolean
    • 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
      • tenantId string Required

        Maximum length is 21.

      • 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 \
 --request GET 'https://[tenant_id].logto.app/api/users/{userId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "id": "string",
  "username": "string",
  "primaryEmail": "string",
  "primaryPhone": "string",
  "name": "string",
  "avatar": "string",
  "customData": {},
  "identities": {
    "userId": "string",
    "details": {}
  },
  "lastSignInAt": 42.0,
  "createdAt": 42.0,
  "updatedAt": 42.0,
  "profile": {
    "familyName": "string",
    "givenName": "string",
    "middleName": "string",
    "nickname": "string",
    "preferredUsername": "string",
    "profile": "string",
    "website": "string",
    "gender": "string",
    "birthdate": "string",
    "zoneinfo": "string",
    "locale": "string",
    "address": {
      "formatted": "string",
      "streetAddress": "string",
      "locality": "string",
      "region": "string",
      "postalCode": "string",
      "country": "string"
    }
  },
  "applicationId": "string",
  "isSuspended": true,
  "hasPassword": true,
  "ssoIdentities": [
    {
      "tenantId": "string",
      "id": "string",
      "userId": "string",
      "issuer": "string",
      "identityId": "string",
      "detail": {},
      "createdAt": 42.0,
      "ssoConnectorId": "string"
    }
  ]
}