> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turnkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get user

> Get details about a user.

export const EndpointPath = ({type, path}) => {
  return <div class="flex w-full flex-col bg-background-light dark:bg-background-dark border-standard rounded-2xl p-1.5">
      <div class="flex items-center space-x-1.5">
        <div class="relative flex-1 flex gap-2 min-w-0 rounded-xl items-center cursor-pointer p-1.5 border-standard">
          <div class="rounded-lg font-bold px-1.5 py-0.5 text-sm leading-5 bg-blue-400/20 dark:bg-blue-400/20 text-blue-700 dark:text-blue-400">
            POST
          </div>
          <div class="flex items-center space-x-2 overflow-x-auto flex-1 no-scrollbar">
            <div class="group flex items-center flex-1 gap-0.5 font-mono">
              <div class="absolute right-0 p-2 bg-background-light dark:bg-background-dark rounded-lg hidden group-hover:block">
                <svg class="w-4 h-4 bg-gray-400 dark:bg-white/30"></svg>
              </div>
              <div class="text-sm text-gray-400">/</div>
              <div class="text-sm font-medium text-gray-800 dark:text-white min-w-max">
                public
              </div>
              <div class="text-sm text-gray-400">/</div>
              <div class="text-sm font-medium text-gray-800 dark:text-white min-w-max">
                v1
              </div>
              <div class="text-sm text-gray-400">/</div>
              <div class="text-sm font-medium text-gray-800 dark:text-white min-w-max">
                {type}
              </div>
              <div class="text-sm text-gray-400">/</div>
              <div class="text-sm font-medium text-gray-800 dark:text-white min-w-max">
                {path}
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>;
};

export const NestedParam = ({parentKey, childKey, type, required, description, children}) => {
  const fullKey = `${parentKey}.${childKey}`;
  const anchorId = `body-${fullKey.replace(/\./g, '-')}`;
  return <div className="py-6 border-gray-100 dark:border-gray-800 border-b last:border-b-0">
  <div className="flex font-mono text-sm group/param-head param-head break-all relative" id={anchorId}>
    <div className="flex-1 flex content-start py-0.5 mr-5">
      <div className="flex items-center flex-wrap gap-2">
        <div className="absolute -top-1.5">
          <a href={`#${anchorId}`} className="-ml-[2.1rem] flex items-center opacity-0 border-0 group-hover/param-head:opacity-100 py-2 [.expandable-content_&]:-ml-[2.1rem]" aria-label="Navigate to header">
            <div className="w-6 h-6 text-gray-400 rounded-md flex items-center justify-center zinc-box bg-white ring-1 ring-gray-400/30 dark:ring-gray-700/25 hover:ring-gray-400/60 dark:hover:ring-white/20">
              <svg xmlns="http://www.w3.org/2000/svg" fill="gray" height="12px" viewBox="0 0 576 512">
                <path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z"></path>
              </svg>
            </div>
          </a>
        </div>
        <div className="font-semibold text-primary dark:text-primary-light cursor-pointer overflow-wrap-anywhere">
          <span className="text-gray-500 dark:text-gray-400">{parentKey}.</span>
          {childKey}
        </div>
        <div className="inline items-center gap-2 text-xs font-medium [&_div]:inline [&_div]:mr-2 [&_div]:leading-5">
          <div className="flex items-center px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium break-all">
            <span>{type}</span>
          </div>
          {required && <span className="px-2 py-0.5 rounded-md bg-red-100/50 dark:bg-red-400/10 text-red-600 dark:text-red-300 font-medium whitespace-nowrap">
              required
            </span>}
        </div>
      </div>
    </div>
  </div>
  {children && <div className="mt-4">
      <div className="prose prose-sm prose-gray dark:prose-invert">
        {children}
      </div>
    </div>}
</div>;
};

export const H3Bordered = ({text}) => <h3 id={text.toLowerCase()} className="border-b pb-2.5 border-gray-100 dark:border-gray-800">
    {text}
  </h3>;

export const Authorizations = () => {
  return <div>
      <H3Bordered text="Authorizations" />

      <Tabs>
        <Tab title="API Key">
          <div className="flex text-sm group/param-head param-head break-all relative" id="authorization-x-stamp">
            <ParamField header="X-Stamp" type="string" required={true}>
              Cryptographically signed (stamped) request to be passed in as a header. For more info, see <a href="https://docs.turnkey.com/developer-reference/api-overview/stamps">here</a>.
            </ParamField>
          </div>
        </Tab>

        <Tab title="WebAuthn (Passkey)">
         <div className="flex text-sm group/param-head param-head break-all relative" id="authorization-x-stamp-webauthn">
            <ParamField body="X-Stamp-WebAuthn" type="string" required={true}>
              Cryptographically signed (stamped) request to be passed in as a header. For more info, see <a href="https://docs.turnkey.com/developer-reference/api-overview/stamps">here</a>.
            </ParamField>
          </div>
        </Tab>
      </Tabs>
    </div>;
};

<EndpointPath type="query" path="get_user" />

<Authorizations />

<H3Bordered text="Body" />

<ParamField body="organizationId" type="string" required={true}>
  Unique identifier for a given organization.
</ParamField>

<ParamField body="userId" type="string" required={true}>
  Unique identifier for a given user.
</ParamField>

<H3Bordered text="Response" />

A successful response returns the following fields:

<ResponseField name="user" type="object" required={true}>
  user field

  <Expandable title="user details">
    <NestedParam parentKey="user" childKey="userId" type="string" required={true}>
      Unique identifier for a given User.
    </NestedParam>

    <NestedParam parentKey="user" childKey="userName" type="string" required={true}>
      Human-readable name for a User.
    </NestedParam>

    <NestedParam parentKey="user" childKey="userEmail" type="string" required={false}>
      The user's email address.
    </NestedParam>

    <NestedParam parentKey="user" childKey="userPhoneNumber" type="string" required={false}>
      The user's phone number in E.164 format e.g. +13214567890
    </NestedParam>

    <NestedParam parentKey="user" childKey="authenticators" type="array" required={true}>
      A list of Authenticator parameters.

      <Expandable title="authenticators details">
        <NestedParam parentKey="user.authenticators" childKey="transports" type="array" required={true}>
          Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE).

          <Expandable title="transports details">
            <NestedParam parentKey="user.authenticators.transports" childKey="item" type="enum" required={true}>
              item field

              Enum options: `AUTHENTICATOR_TRANSPORT_BLE`, `AUTHENTICATOR_TRANSPORT_INTERNAL`, `AUTHENTICATOR_TRANSPORT_NFC`, `AUTHENTICATOR_TRANSPORT_USB`, `AUTHENTICATOR_TRANSPORT_HYBRID`
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="attestationType" type="string" required={true}>
          attestationType field
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="aaguid" type="string" required={true}>
          Identifier indicating the type of the Security Key.
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="credentialId" type="string" required={true}>
          Unique identifier for a WebAuthn credential.
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="model" type="string" required={true}>
          The type of Authenticator device.
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="credential" type="object" required={true}>
          credential field

          <Expandable title="credential details">
            <NestedParam parentKey="user.authenticators.credential" childKey="publicKey" type="string" required={true}>
              The public component of a cryptographic key pair used to sign messages and transactions.
            </NestedParam>

            <NestedParam parentKey="user.authenticators.credential" childKey="type" type="enum" required={true}>
              type field

              Enum options: `CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR`, `CREDENTIAL_TYPE_API_KEY_P256`, `CREDENTIAL_TYPE_RECOVER_USER_KEY_P256`, `CREDENTIAL_TYPE_API_KEY_SECP256K1`, `CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256`, `CREDENTIAL_TYPE_API_KEY_ED25519`, `CREDENTIAL_TYPE_OTP_AUTH_KEY_P256`, `CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256`, `CREDENTIAL_TYPE_OAUTH_KEY_P256`, `CREDENTIAL_TYPE_LOGIN`
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="authenticatorId" type="string" required={true}>
          Unique identifier for a given Authenticator.
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="authenticatorName" type="string" required={true}>
          Human-readable name for an Authenticator.
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="createdAt" type="object" required={true}>
          createdAt field

          <Expandable title="createdAt details">
            <NestedParam parentKey="user.authenticators.createdAt" childKey="seconds" type="string" required={true}>
              seconds field
            </NestedParam>

            <NestedParam parentKey="user.authenticators.createdAt" childKey="nanos" type="string" required={true}>
              nanos field
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.authenticators" childKey="updatedAt" type="object" required={true}>
          updatedAt field

          <Expandable title="updatedAt details">
            <NestedParam parentKey="user.authenticators.updatedAt" childKey="seconds" type="string" required={true}>
              seconds field
            </NestedParam>

            <NestedParam parentKey="user.authenticators.updatedAt" childKey="nanos" type="string" required={true}>
              nanos field
            </NestedParam>
          </Expandable>
        </NestedParam>
      </Expandable>
    </NestedParam>

    <NestedParam parentKey="user" childKey="apiKeys" type="array" required={true}>
      A list of API Key parameters. This field, if not needed, should be an empty array in your request body.

      <Expandable title="apiKeys details">
        <NestedParam parentKey="user.apiKeys" childKey="credential" type="object" required={true}>
          credential field

          <Expandable title="credential details">
            <NestedParam parentKey="user.apiKeys.credential" childKey="publicKey" type="string" required={true}>
              The public component of a cryptographic key pair used to sign messages and transactions.
            </NestedParam>

            <NestedParam parentKey="user.apiKeys.credential" childKey="type" type="enum" required={true}>
              type field

              Enum options: `CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR`, `CREDENTIAL_TYPE_API_KEY_P256`, `CREDENTIAL_TYPE_RECOVER_USER_KEY_P256`, `CREDENTIAL_TYPE_API_KEY_SECP256K1`, `CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256`, `CREDENTIAL_TYPE_API_KEY_ED25519`, `CREDENTIAL_TYPE_OTP_AUTH_KEY_P256`, `CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256`, `CREDENTIAL_TYPE_OAUTH_KEY_P256`, `CREDENTIAL_TYPE_LOGIN`
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.apiKeys" childKey="apiKeyId" type="string" required={true}>
          Unique identifier for a given API Key.
        </NestedParam>

        <NestedParam parentKey="user.apiKeys" childKey="apiKeyName" type="string" required={true}>
          Human-readable name for an API Key.
        </NestedParam>

        <NestedParam parentKey="user.apiKeys" childKey="createdAt" type="object" required={true}>
          createdAt field

          <Expandable title="createdAt details">
            <NestedParam parentKey="user.apiKeys.createdAt" childKey="seconds" type="string" required={true}>
              seconds field
            </NestedParam>

            <NestedParam parentKey="user.apiKeys.createdAt" childKey="nanos" type="string" required={true}>
              nanos field
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.apiKeys" childKey="updatedAt" type="object" required={true}>
          updatedAt field

          <Expandable title="updatedAt details">
            <NestedParam parentKey="user.apiKeys.updatedAt" childKey="seconds" type="string" required={true}>
              seconds field
            </NestedParam>

            <NestedParam parentKey="user.apiKeys.updatedAt" childKey="nanos" type="string" required={true}>
              nanos field
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.apiKeys" childKey="expirationSeconds" type="string" required={false}>
          Optional window (in seconds) indicating how long the API Key should last.
        </NestedParam>
      </Expandable>
    </NestedParam>

    <NestedParam parentKey="user" childKey="userTags" type="array" required={true}>
      A list of User Tag IDs.

      <Expandable title="userTags details">
        <NestedParam parentKey="user.userTags" childKey="item" type="string" required={true}>
          item field
        </NestedParam>
      </Expandable>
    </NestedParam>

    <NestedParam parentKey="user" childKey="oauthProviders" type="array" required={true}>
      A list of Oauth Providers.

      <Expandable title="oauthProviders details">
        <NestedParam parentKey="user.oauthProviders" childKey="providerId" type="string" required={true}>
          Unique identifier for an OAuth Provider
        </NestedParam>

        <NestedParam parentKey="user.oauthProviders" childKey="providerName" type="string" required={true}>
          Human-readable name to identify a Provider.
        </NestedParam>

        <NestedParam parentKey="user.oauthProviders" childKey="issuer" type="string" required={true}>
          The issuer of the token, typically a URL indicating the authentication server, e.g [https://accounts.google.com](https://accounts.google.com)
        </NestedParam>

        <NestedParam parentKey="user.oauthProviders" childKey="audience" type="string" required={true}>
          Expected audience ('aud' attribute of the signed token) which represents the app ID
        </NestedParam>

        <NestedParam parentKey="user.oauthProviders" childKey="subject" type="string" required={true}>
          Expected subject ('sub' attribute of the signed token) which represents the user ID
        </NestedParam>

        <NestedParam parentKey="user.oauthProviders" childKey="createdAt" type="object" required={true}>
          createdAt field

          <Expandable title="createdAt details">
            <NestedParam parentKey="user.oauthProviders.createdAt" childKey="seconds" type="string" required={true}>
              seconds field
            </NestedParam>

            <NestedParam parentKey="user.oauthProviders.createdAt" childKey="nanos" type="string" required={true}>
              nanos field
            </NestedParam>
          </Expandable>
        </NestedParam>

        <NestedParam parentKey="user.oauthProviders" childKey="updatedAt" type="object" required={true}>
          updatedAt field

          <Expandable title="updatedAt details">
            <NestedParam parentKey="user.oauthProviders.updatedAt" childKey="seconds" type="string" required={true}>
              seconds field
            </NestedParam>

            <NestedParam parentKey="user.oauthProviders.updatedAt" childKey="nanos" type="string" required={true}>
              nanos field
            </NestedParam>
          </Expandable>
        </NestedParam>
      </Expandable>
    </NestedParam>

    <NestedParam parentKey="user" childKey="createdAt" type="object" required={true}>
      createdAt field

      <Expandable title="createdAt details">
        <NestedParam parentKey="user.createdAt" childKey="seconds" type="string" required={true}>
          seconds field
        </NestedParam>

        <NestedParam parentKey="user.createdAt" childKey="nanos" type="string" required={true}>
          nanos field
        </NestedParam>
      </Expandable>
    </NestedParam>

    <NestedParam parentKey="user" childKey="updatedAt" type="object" required={true}>
      updatedAt field

      <Expandable title="updatedAt details">
        <NestedParam parentKey="user.updatedAt" childKey="seconds" type="string" required={true}>
          seconds field
        </NestedParam>

        <NestedParam parentKey="user.updatedAt" childKey="nanos" type="string" required={true}>
          nanos field
        </NestedParam>
      </Expandable>
    </NestedParam>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash title="cURL" theme={"system"}
  curl --request POST \
    --url https://api.turnkey.com/public/v1/query/get_user \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --header "X-Stamp: <string> (see Authorizations)" \
    --data '{
      "organizationId": "<string>",
      "userId": "<string>"
  }'
  ```

  ```javascript title="JavaScript" theme={"system"}
  import { Turnkey } from "@turnkey/sdk-server";

  const turnkeyClient = new Turnkey({
    apiBaseUrl: "https://api.turnkey.com",
    apiPublicKey: process.env.API_PUBLIC_KEY!,
    apiPrivateKey: process.env.API_PRIVATE_KEY!,
    defaultOrganizationId: process.env.ORGANIZATION_ID!,
  });

  const response = await turnkeyClient.apiClient().getUser({
    organizationId: "<string> (Unique identifier for a given organization.)",
    userId: "<string> (Unique identifier for a given user.)"
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "user": {
      "userId": "<string>",
      "userName": "<string>",
      "userEmail": "<string>",
      "userPhoneNumber": "<string>",
      "authenticators": [
        {
          "transports": [
            "<AUTHENTICATOR_TRANSPORT_BLE>"
          ],
          "attestationType": "<string>",
          "aaguid": "<string>",
          "credentialId": "<string>",
          "model": "<string>",
          "credential": {
            "publicKey": "<string>",
            "type": "<CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR>"
          },
          "authenticatorId": "<string>",
          "authenticatorName": "<string>",
          "createdAt": {
            "seconds": "<string>",
            "nanos": "<string>"
          },
          "updatedAt": {
            "seconds": "<string>",
            "nanos": "<string>"
          }
        }
      ],
      "apiKeys": [
        {
          "credential": {
            "publicKey": "<string>",
            "type": "<CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR>"
          },
          "apiKeyId": "<string>",
          "apiKeyName": "<string>",
          "createdAt": {
            "seconds": "<string>",
            "nanos": "<string>"
          },
          "updatedAt": {
            "seconds": "<string>",
            "nanos": "<string>"
          },
          "expirationSeconds": "<string>"
        }
      ],
      "userTags": [
        "<string>"
      ],
      "oauthProviders": [
        {
          "providerId": "<string>",
          "providerName": "<string>",
          "issuer": "<string>",
          "audience": "<string>",
          "subject": "<string>",
          "createdAt": {
            "seconds": "<string>",
            "nanos": "<string>"
          },
          "updatedAt": {
            "seconds": "<string>",
            "nanos": "<string>"
          }
        }
      ],
      "createdAt": {
        "seconds": "<string>",
        "nanos": "<string>"
      },
      "updatedAt": {
        "seconds": "<string>",
        "nanos": "<string>"
      }
    }
  }
  ```
</ResponseExample>
