> ## 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 Domain

> Get a domain by ID or fully qualified name

# Retrieve a Domain

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

## Get by ID

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

<ParamField query="fields" type="string">
  Comma-separated list of fields to include (e.g., `owners,children,experts`).
</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/domains/name/{fqn}` to retrieve by fully qualified name.

<ParamField path="fqn" type="string" required>
  Fully qualified name of the domain (e.g., `TestDomain` or `Engineering.DataPlatform`).
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include: `owners`, `children`, `experts`.
</ParamField>

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

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

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

  # Get by ID
  domain = Domains.retrieve("a0729e98-e946-4e25-acde-10e8a2294ba1")
  print(f"{domain.fullyQualifiedName}: {domain.domainType}")

  # Get by ID with fields
  domain = Domains.retrieve(
      "a0729e98-e946-4e25-acde-10e8a2294ba1",
      fields=["owners", "children", "experts"]
  )

  # Get by fully qualified name
  domain = Domains.retrieve_by_name("TestDomain")

  # Get by name with fields
  domain = Domains.retrieve_by_name(
      "TestDomain",
      fields=["owners", "children", "experts"]
  )
  ```

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

  // Get by ID
  var domain = Domains.retrieve("a0729e98-e946-4e25-acde-10e8a2294ba1");

  // Get by ID with fields
  var domain = Domains.retrieve(
      "a0729e98-e946-4e25-acde-10e8a2294ba1",
      "owners,children,experts"
  );

  // Get by fully qualified name
  var domain = Domains.retrieveByName("TestDomain");

  // Get by name with fields
  var domain = Domains.retrieveByName("TestDomain", "owners,children,experts");
  ```

  ```bash GET /v1/domains/{id} theme={null}
  # Get by ID
  curl "{base_url}/api/v1/domains/a0729e98-e946-4e25-acde-10e8a2294ba1" \
    -H "Authorization: Bearer {access_token}"

  # Get by ID with fields
  curl "{base_url}/api/v1/domains/a0729e98-e946-4e25-acde-10e8a2294ba1?fields=owners,children,experts" \
    -H "Authorization: Bearer {access_token}"

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

  # Get by name with fields
  curl "{base_url}/api/v1/domains/name/TestDomain?fields=owners,children,experts" \
    -H "Authorization: Bearer {access_token}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "a0729e98-e946-4e25-acde-10e8a2294ba1",
    "domainType": "Aggregate",
    "name": "TestDomain",
    "fullyQualifiedName": "TestDomain",
    "description": "Lorem ipsum...",
    "version": 0.1,
    "updatedAt": 1769984330261,
    "updatedBy": "admin",
    "href": "http://localhost:8585/api/v1/domains/a0729e98-e946-4e25-acde-10e8a2294ba1",
    "deleted": false,
    "owners": [],
    "children": []
  }
  ```
</ResponseExample>

***

## Returns

Returns a domain object with all requested fields populated.

## Response

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

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

<ResponseField name="fullyQualifiedName" type="string">
  Fully qualified name of the domain.
</ResponseField>

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

<ResponseField name="description" type="string">
  Description of the domain in Markdown format.
</ResponseField>

<ResponseField name="domainType" type="string">
  Type of domain: `Source-aligned`, `Consumer-aligned`, or `Aggregate`.
</ResponseField>

<ResponseField name="owners" type="array" optional>
  List of owners. Only included when `fields` contains `owners`.
</ResponseField>

<ResponseField name="children" type="array" optional>
  Child domain references. Only included when `fields` contains `children`.
</ResponseField>

<ResponseField name="experts" type="array" optional>
  Subject matter experts. Only included when `fields` contains `experts`.
</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 domain  |
| `404` | `NOT_FOUND`    | Domain with given ID or FQN does not exist |
