Get user

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://openapi.logto.io/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Logto API references MCP server": {
    "url": "https://openapi.logto.io/mcp"
  }
}

Close
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.

  • includePasswordHash string

    If it's provided with a truthy value (true, 1, yes), the response will include the passwordDigest and passwordAlgorithm fields. These fields are omitted by default for security reasons, and always omitted when the request carries the logto-read-only-access: true header.

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 128.

    • 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

      Additional properties are allowed.

    • identities object Required
      Hide identities attribute Show identities attribute object
      • * object Additional properties
        Hide * attributes Show * attributes object
        • userId string Required
        • details object

          arbitrary

          Additional properties are allowed.

    • 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.

    • cimdClientId string | null Required

      The identifier of the CIMD (client ID metadata document) client from the user's first consent. null unless the user's first consent was granted to a CIMD client. Mutually exclusive with applicationId.

      Maximum length is 2048.

    • isSuspended boolean Required
    • hasPassword boolean
    • hasSecurityVerificationMethod 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 128.

      • 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

        Additional properties are allowed.

      • createdAt number Required
      • updatedAt number Required
      • ssoConnectorId string Required

        Minimum length is 1, maximum length is 128.

    • passwordDigest string | null

      The hashed password of the user. Only present when includePasswordHash is provided with a truthy value. null if the user has no password set.

      Maximum length is 256.

    • passwordAlgorithm string | null

      The algorithm used to hash the password. Only present when includePasswordHash is provided with a truthy value. null if the user has no password set.

      Values are Argon2i, Argon2id, Argon2d, SHA1, SHA256, MD5, Bcrypt, or Legacy.

  • 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": {
    "additionalProperty1": {
      "userId": "string",
      "details": {}
    },
    "additionalProperty2": {
      "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",
  "cimdClientId": "string",
  "isSuspended": true,
  "hasPassword": true,
  "hasSecurityVerificationMethod": true,
  "ssoIdentities": [
    {
      "tenantId": "string",
      "id": "string",
      "userId": "string",
      "issuer": "string",
      "identityId": "string",
      "detail": {},
      "createdAt": 42.0,
      "updatedAt": 42.0,
      "ssoConnectorId": "string"
    }
  ],
  "passwordDigest": "string",
  "passwordAlgorithm": "Argon2i"
}