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

# Create a Database Service

> Create a new database service connection

# Create a Database Service

Create a new database service connection to a platform such as Snowflake, BigQuery, or PostgreSQL.

## Body Parameters

**name** `string` *required*

Name of the database service. Must be unique across all database services.

**serviceType** `string` *required*

Type of database service, for example `Snowflake`, `BigQuery`, `PostgreSQL`, `MySQL`, `Redshift`, `Databricks`.

**description** `string`

Description of the database service in Markdown format.

**displayName** `string`

Human-readable display name for the database service.

**connection** `object`

Connection configuration specific to the service type.

**properties**

**config** `object`

Service-specific connection configuration, for example account, warehouse, database for Snowflake.

**owners** `array`

Array of owner references (users or teams) to assign to the service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the database service.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

```python POST /v1/services/databaseServices theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import DatabaseServices
from metadata.generated.schema.api.services.createDatabaseService import CreateDatabaseServiceRequest

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

request = CreateDatabaseServiceRequest(
    name="snowflake_prod",
    displayName="Snowflake Production",
    serviceType="Snowflake",
    description="Production Snowflake data warehouse",
    connection={
        "config": {
            "account": "xy12345.us-east-1",
            "username": "ingestion_user",
            "password": "***",
            "warehouse": "COMPUTE_WH",
            "database": "ANALYTICS"
        }
    }
)

service = DatabaseServices.create(request)
print(f"Created: {service.fullyQualifiedName.root}")
```

```java POST /v1/services/databaseServices theme={null}
import org.openmetadata.schema.api.services.CreateDatabaseService;
import org.openmetadata.schema.api.services.CreateDatabaseService.DatabaseServiceType;
import org.openmetadata.schema.api.services.DatabaseConnection;
import org.openmetadata.schema.entity.services.DatabaseService;
import org.openmetadata.schema.services.connections.database.SnowflakeConnection;
import org.openmetadata.sdk.fluent.DatabaseServices;

CreateDatabaseService request = new CreateDatabaseService()
    .withName("snowflake_prod")
    .withServiceType(DatabaseServiceType.Snowflake)
    .withDescription("Production Snowflake data warehouse")
    .withConnection(new DatabaseConnection().withConfig(
        new SnowflakeConnection()
            .withAccount("xy12345.us-east-1")
            .withUsername("ingestion_user")
            .withPassword("***")
            .withWarehouse("COMPUTE_WH")
            .withDatabase("ANALYTICS")));

DatabaseService service = DatabaseServices.create(request);
```

```bash POST /v1/services/databaseServices theme={null}
curl -X POST "{base_url}/api/v1/services/databaseServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "sample_data",
    "serviceType": "BigQuery",
    "description": "Sample data service for BigQuery",
    "connection": {
      "config": {
        "type": "BigQuery",
        "scheme": "bigquery",
        "hostPort": "bigquery.googleapis.com",
        "taxonomyLocation": "us",
        "usageLocation": "us",
        "supportsMetadataExtraction": true,
        "supportsUsageExtraction": true,
        "supportsLineageExtraction": true,
        "supportsDBTExtraction": true,
        "supportsProfiler": true,
        "supportsQueryComment": true
      }
    }
  }'
```

```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"
}
```

***

## Returns

Returns the created database service object with all specified properties and system-generated fields.

## Response

**id** `string`

Unique identifier for the database service (UUID format).

**name** `string`

Database service name.

**fullyQualifiedName** `string`

Fully qualified name of the service.

**displayName** `string`

Human-readable display name.

**description** `string`

Description of the database service in Markdown format.

**serviceType** `string`

Type of database service, for example Snowflake, BigQuery, PostgreSQL.

**connection** `object`

Connection configuration for the service.

**properties**

**config** `object`

Service-specific connection configuration.

**owners** `array`

List of owners assigned to the database service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified name of the assigned domain.

**tags** `array`

Classification tags applied to the database service.

**properties**

**tagFQN** `string`

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**version** `number`

Version number for the entity (starts at 0.1).

***

## Create or Update (PUT)

Use `PUT /v1/services/databaseServices` instead of `POST` to perform an upsert. If a database service with the same `fullyQualifiedName` already exists, it will be updated; otherwise, a new service is created. The request body is the same as `POST`.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/services/databaseServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
```

> [!NOTE]
>
> `PUT` will not return a `409` conflict error if the entity already exists -- it will update the existing entity instead.

***

## Bulk Create or Update (PUT)

Use `PUT /v1/services/databaseServices/bulk` to create or update multiple database services in a single request. The request body is an array of create request objects.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/services/databaseServices/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "service_one", "serviceType": "Snowflake", "connection": { "config": {} } },
    { "name": "service_two", "serviceType": "BigQuery", "connection": { "config": {} } }
  ]'
```

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid request body or missing required fields |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to create database services |
| `409` | `ENTITY_ALREADY_EXISTS` | Database service with same name already exists (POST only) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.