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

# Retrieve a User

> Get a user by ID or fully qualified name

# Retrieve a User

Get a single user by its unique ID or fully qualified name.

## Get by ID

<ParamField path="id" type="string" required>
  UUID of the user to retrieve.
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include (e.g., `teams,roles,personas,domains,follows,owns`).
</ParamField>

<ParamField query="include" type="string" default="non-deleted">
  Include `all`, `deleted`, or `non-deleted` entities.
</ParamField>

## Get by Fully Qualified Name

Use `GET /v1/users/name/{fqn}` to retrieve by fully qualified name.

<ParamField path="fqn" type="string" required>
  Fully qualified name of the user (e.g., `aaron_johnson0`).
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include: `teams`, `roles`, `personas`, `domains`, `follows`, `owns`.
</ParamField>

<ParamField query="include" type="string" default="non-deleted">
  Include `all`, `deleted`, or `non-deleted` entities.
</ParamField>

<RequestExample dropdown>
  ```python GET /v1/users/{id} theme={null}
  from metadata.sdk import configure
  from metadata.sdk.entities import Users

  configure(
      host="https://your-company.open-metadata.org/api",
      jwt_token="your-jwt-token"
  )

  # Get by ID
  user = Users.retrieve("77655e6e-ad33-49da-bbca-db4ba4d4e2cd")
  print(f"{user.fullyQualifiedName}: {user.email}")

  # Get by ID with fields
  user = Users.retrieve(
      "77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
      fields=["teams", "roles", "domains"]
  )

  # Get by fully qualified name
  user = Users.retrieve_by_name("aaron_johnson0")

  # Get by name with fields
  user = Users.retrieve_by_name(
      "aaron_johnson0",
      fields=["teams", "roles", "domains"]
  )
  ```

  ```java GET /v1/users/{id} theme={null}
  import static org.openmetadata.sdk.fluent.Users.*;

  // Get by ID
  var user = Users.retrieve("77655e6e-ad33-49da-bbca-db4ba4d4e2cd");

  // Get by ID with fields
  var user = Users.retrieve(
      "77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
      "teams,roles,domains"
  );

  // Get by fully qualified name
  var user = Users.retrieveByName("aaron_johnson0");

  // Get by name with fields
  var user = Users.retrieveByName(
      "aaron_johnson0",
      "teams,roles,domains"
  );
  ```

  ```bash GET /v1/users/{id} theme={null}
  # Get by ID
  curl "{base_url}/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd" \
    -H "Authorization: Bearer {access_token}"

  # Get by ID with fields
  curl "{base_url}/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd?fields=teams,roles,domains" \
    -H "Authorization: Bearer {access_token}"

  # Get by fully qualified name
  curl "{base_url}/api/v1/users/name/aaron_johnson0" \
    -H "Authorization: Bearer {access_token}"

  # Get by name with fields
  curl "{base_url}/api/v1/users/name/aaron_johnson0?fields=teams,roles,domains" \
    -H "Authorization: Bearer {access_token}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
    "name": "aaron_johnson0",
    "fullyQualifiedName": "aaron_johnson0",
    "displayName": "Aaron Johnson",
    "version": 0.1,
    "updatedAt": 1769982624214,
    "updatedBy": "admin",
    "email": "aaron_johnson0@gmail.com",
    "href": "http://localhost:8585/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
    "isBot": false,
    "isAdmin": false,
    "allowImpersonation": false,
    "teams": [
      {
        "id": "7a2b921b-f623-4eb5-9736-649788ad842c",
        "type": "team",
        "name": "Sales",
        "fullyQualifiedName": "Sales",
        "displayName": "Sales",
        "deleted": false
      }
    ],
    "personas": [],
    "deleted": false,
    "roles": [
      {
        "id": "761c2bb2-0b77-4bc5-9af9-cf89536d6a12",
        "type": "role",
        "name": "DataSteward",
        "fullyQualifiedName": "DataSteward",
        "displayName": "Data Steward",
        "deleted": false
      }
    ],
    "domains": []
  }
  ```
</ResponseExample>

***

## Returns

Returns a user object with all requested fields populated.

## Response

<ResponseField name="id" type="string">
  Unique identifier for the user (UUID format).
</ResponseField>

<ResponseField name="name" type="string">
  Username.
</ResponseField>

<ResponseField name="fullyQualifiedName" type="string">
  Fully qualified name (same as `name` for users).
</ResponseField>

<ResponseField name="displayName" type="string">
  Human-readable display name.
</ResponseField>

<ResponseField name="email" type="string">
  Email address of the user.
</ResponseField>

<ResponseField name="isBot" type="boolean">
  Whether this user is a bot account.
</ResponseField>

<ResponseField name="isAdmin" type="boolean">
  Whether this user has admin privileges.
</ResponseField>

<ResponseField name="teams" type="array" optional>
  Teams the user belongs to. Only included when `fields` contains `teams`.
</ResponseField>

<ResponseField name="roles" type="array" optional>
  Roles assigned to the user. Only included when `fields` contains `roles`.
</ResponseField>

<ResponseField name="personas" type="array" optional>
  Personas assigned. Only included when `fields` contains `personas`.
</ResponseField>

<ResponseField name="domains" type="array" optional>
  Domain assignments. Only included when `fields` contains `domains`.
</ResponseField>

<ResponseField name="follows" type="array" optional>
  Entities the user follows. Only included when `fields` contains `follows`.
</ResponseField>

<ResponseField name="owns" type="array" optional>
  Entities owned by the user. Only included when `fields` contains `owns`.
</ResponseField>

<ResponseField name="version" type="number">
  Version number for the entity.
</ResponseField>

***

## Error Handling

| Code  | Error Type     | Description                              |
| ----- | -------------- | ---------------------------------------- |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token  |
| `403` | `FORBIDDEN`    | User lacks permission to view this user  |
| `404` | `NOT_FOUND`    | User with given ID or FQN does not exist |
