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

> Get a database service by ID or fully qualified name

# Retrieve a Database Service

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

## Get by ID

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

<ParamField query="fields" type="string">
  Comma-separated list of fields to include. Valid fields: `pipelines`, `owners`, `tags`, `domains`, `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/services/databaseServices/name/{fqn}` to retrieve by fully qualified name.

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

<ParamField query="fields" type="string">
  Comma-separated list of fields to include. Valid fields: `pipelines`, `owners`, `tags`, `domains`, `followers`.
</ParamField>

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

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

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

  # Get by ID
  service = DatabaseServices.retrieve("a1b2c3d4-e5f6-7890-abcd-ef1234567890")
  print(f"{service.fullyQualifiedName}: {service.serviceType}")

  # Get by ID with fields
  service = DatabaseServices.retrieve(
      "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      fields=["owners", "tags"]
  )

  # Get by fully qualified name
  service = DatabaseServices.retrieve_by_name("snowflake_prod")

  # Get by name with fields
  service = DatabaseServices.retrieve_by_name(
      "snowflake_prod",
      fields=["owners", "tags", "domain"]
  )
  ```

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

  // Get by ID
  DatabaseService service = DatabaseServices.retrieve("a1b2c3d4-e5f6-7890-abcd-ef1234567890");

  // Get by fully qualified name
  DatabaseService service = DatabaseServices.retrieveByName("snowflake_prod");
  ```

  ```bash GET /v1/services/databaseServices/{id} theme={null}
  # Get by ID
  curl "{base_url}/api/v1/services/databaseServices/fd2193af-fe09-4366-92b7-1e0d01cd8c09" \
    -H "Authorization: Bearer {access_token}"

  # Get by ID with fields
  curl "{base_url}/api/v1/services/databaseServices/fd2193af-fe09-4366-92b7-1e0d01cd8c09?fields=owners,tags" \
    -H "Authorization: Bearer {access_token}"

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

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

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "fd2193af-fe09-4366-92b7-1e0d01cd8c09",
    "name": "sample_data",
    "fullyQualifiedName": "sample_data",
    "serviceType": "BigQuery",
    "description": "Sample data service for BigQuery",
    "version": 0.1,
    "updatedAt": 1769982650000,
    "updatedBy": "admin",
    "href": "http://localhost:8585/api/v1/services/databaseServices/fd2193af-fe09-4366-92b7-1e0d01cd8c09",
    "connection": {
      "config": {
        "type": "BigQuery",
        "scheme": "bigquery",
        "hostPort": "bigquery.googleapis.com",
        "taxonomyProjectID": [],
        "taxonomyLocation": "us",
        "usageLocation": "us",
        "supportsMetadataExtraction": true,
        "supportsUsageExtraction": true,
        "supportsLineageExtraction": true,
        "supportsDBTExtraction": true,
        "supportsProfiler": true,
        "supportsQueryComment": true
      }
    },
    "owners": [],
    "tags": [],
    "deleted": false,
    "domains": [],
    "entityStatus": "Unprocessed"
  }
  ```
</ResponseExample>

***

## Returns

Returns a database service object with all requested fields populated.

## Response

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

<ResponseField name="name" type="string">
  Database service name.
</ResponseField>

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

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

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

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

<ResponseField name="connection" type="object">
  Connection configuration for the service.

  <Expandable title="properties">
    <ResponseField name="config" type="object">
      Service-specific connection configuration.
    </ResponseField>
  </Expandable>
</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>

<ResponseField name="followers" type="array" optional>
  Users following this service. Only included when `fields` contains `followers`.
</ResponseField>

<ResponseField name="pipelines" type="array" optional>
  Ingestion pipelines associated with this service. Only included when `fields` contains `pipelines`.
</ResponseField>

***

## Error Handling

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