> ## 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 Database Schema

> Get a database schema by ID or fully qualified name

# Retrieve a Database Schema

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

## Get by ID

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

<ParamField query="fields" type="string">
  Comma-separated list of fields to include: `owners`, `tables`, `usageSummary`, `tags`, `certification`, `extension`, `domains`, `sourceHash`, `followers`.
</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/databaseSchemas/name/{fqn}` to retrieve by fully qualified name.

<ParamField path="fqn" type="string" required>
  Fully qualified name of the schema (e.g., `Glue.default.information_schema`).
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include: `owners`, `tables`, `usageSummary`, `tags`, `certification`, `extension`, `domains`, `sourceHash`, `followers`.
</ParamField>

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

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

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

  # Get by ID
  schema = DatabaseSchemas.retrieve("770e8400-e29b-41d4-a716-446655440000")
  print(f"{schema.fullyQualifiedName}: {schema.description}")

  # Get by ID with fields
  schema = DatabaseSchemas.retrieve(
      "770e8400-e29b-41d4-a716-446655440000",
      fields=["owners", "tags", "usageSummary"]
  )

  # Get by fully qualified name
  schema = DatabaseSchemas.retrieve_by_name("snowflake_prod.analytics.public")

  # Get by name with fields
  schema = DatabaseSchemas.retrieve_by_name(
      "snowflake_prod.analytics.public",
      fields=["owners", "tags", "domain"]
  )
  ```

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

  // Get by ID
  DatabaseSchema schema = DatabaseSchemas.retrieve("770e8400-e29b-41d4-a716-446655440000");

  // Get by fully qualified name
  DatabaseSchema schema = DatabaseSchemas.retrieveByName("snowflake_prod.analytics.public");
  ```

  ```bash GET /v1/databaseSchemas/{id} theme={null}
  # Get by ID
  curl "{base_url}/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323" \
    -H "Authorization: Bearer {access_token}"

  # Get by ID with fields
  curl "{base_url}/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323?fields=owners,tables,tags,usageSummary" \
    -H "Authorization: Bearer {access_token}"

  # Get by fully qualified name
  curl "{base_url}/api/v1/databaseSchemas/name/Glue.default.information_schema" \
    -H "Authorization: Bearer {access_token}"

  # Get by name with fields
  curl "{base_url}/api/v1/databaseSchemas/name/Glue.default.information_schema?fields=owners,tables,tags,domains" \
    -H "Authorization: Bearer {access_token}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "f681432b-e66c-4096-a1cd-7771358c5323",
    "name": "information_schema",
    "fullyQualifiedName": "Glue.default.information_schema",
    "description": "This **mock** database contains tables related to the Glue service",
    "version": 0.1,
    "updatedAt": 1769982658171,
    "updatedBy": "admin",
    "href": "http://localhost:8585/api/v1/databaseSchemas/f681432b-e66c-4096-a1cd-7771358c5323",
    "owners": [],
    "service": {
      "id": "0fab117a-4c58-4ebb-9d42-beab0768fa8e",
      "type": "databaseService",
      "name": "Glue",
      "fullyQualifiedName": "Glue",
      "displayName": "Glue",
      "deleted": false,
      "href": "http://localhost:8585/api/v1/services/databaseServices/0fab117a-4c58-4ebb-9d42-beab0768fa8e"
    },
    "serviceType": "Glue",
    "database": {
      "id": "9655ba5b-b8d7-419c-98f4-16b976692ad8",
      "type": "database",
      "name": "default",
      "fullyQualifiedName": "Glue.default",
      "description": "This **mock** database contains tables related to the Glue service",
      "displayName": "default",
      "deleted": false,
      "href": "http://localhost:8585/api/v1/databases/9655ba5b-b8d7-419c-98f4-16b976692ad8"
    },
    "tables": [
      {
        "id": "49cae725-62e6-48b4-b604-7ea915659d9a",
        "type": "table",
        "name": "sales",
        "fullyQualifiedName": "Glue.default.information_schema.sales",
        "description": "Sales data",
        "displayName": "sales",
        "deleted": false,
        "href": "http://localhost:8585/api/v1/tables/49cae725-62e6-48b4-b604-7ea915659d9a"
      },
      {
        "id": "b9988329-cb3e-469b-8d10-d6a21de8b0b9",
        "type": "table",
        "name": "marketing",
        "fullyQualifiedName": "Glue.default.information_schema.marketing",
        "description": "Marketing data",
        "displayName": "marketing",
        "deleted": false,
        "href": "http://localhost:8585/api/v1/tables/b9988329-cb3e-469b-8d10-d6a21de8b0b9"
      }
    ],
    "tags": [],
    "deleted": false,
    "sourceUrl": "https://www.glue.com/information_schema",
    "domains": [],
    "entityStatus": "Unprocessed"
  }
  ```
</ResponseExample>

***

## Returns

Returns a database schema object with all requested fields populated.

## Response

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

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

<ResponseField name="fullyQualifiedName" type="string">
  Fully qualified name in format `service.database.schema`.
</ResponseField>

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

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

<ResponseField name="database" type="object">
  Reference to the parent database.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      UUID of the database.
    </ResponseField>

    <ResponseField name="type" type="string">
      Type of entity (always `database`).
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the database.
    </ResponseField>

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

<ResponseField name="service" type="object">
  Reference to the parent database service.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      UUID of the database service.
    </ResponseField>

    <ResponseField name="type" type="string">
      Type of entity (always `databaseService`).
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the database service.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="serviceType" type="string">
  Type of database service (e.g., Snowflake, BigQuery, PostgreSQL).
</ResponseField>

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

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

<ResponseField name="tags" type="array" optional>
  Classification tags. Only included when `fields` contains `tags`.
</ResponseField>

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

***

## Error Handling

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