---
title: "Create database connection"
method: POST
path: "/database/connections"
tags: ["DatabaseConnection"]
---

# Create database connection

`POST /database/connections`

Create a new database connection

## Request body

- DatabaseConnection — Entity containing the connection details for a configured database
  - `id` string — Database connection ID
  - `workspace_id` string — Workspace ID
  - `name` string — Database name
  - `description` string — Databaes description
  - `database_type` 'mariadb' | 'mongodb' | 'mssql' | 'mysql' | 'oracle' | 'postgres'
  - `connection_properties` DatabaseConnectionProperties — Database connection details
    - `host` string — Host address of database connection
    - `port` integer — Port number of database connection
    - `database` string — Database name
    - `credentials_id` string — Credential ID to use when connecting to database
    - `link_agent_label` string — DEPRECATED - use link_agent_labels
    - `link_agent_labels` string[] — Link agent override to use when connecting to database (optional)
    - `driver_properties` object — Additional database connection properties
  - `connection_overrides` DatabaseConnectionPropertiesOverride[] — Set of connection_property overrides that apply to this database connection
    - `environment_id` string — Environment ID associated with override
    - `connection_properties` DatabaseConnectionProperties — Database connection details
      - `host` string — Host address of database connection
      - `port` integer — Port number of database connection
      - `database` string — Database name
      - `credentials_id` string — Credential ID to use when connecting to database
      - `link_agent_label` string — DEPRECATED - use link_agent_labels
      - `link_agent_labels` string[] — Link agent override to use when connecting to database (optional)
      - `driver_properties` object — Additional database connection properties
  - `created_by_id` string
  - `created_time` integer
  - `last_updated_by_id` string
  - `last_updated_time` integer
  - `deleted_by_id` string
  - `deleted_time` integer

## Response `201`

Database connection created

- DatabaseConnection — Entity containing the connection details for a configured database
  - `id` string — Database connection ID
  - `workspace_id` string — Workspace ID
  - `name` string — Database name
  - `description` string — Databaes description
  - `database_type` 'mariadb' | 'mongodb' | 'mssql' | 'mysql' | 'oracle' | 'postgres'
  - `connection_properties` DatabaseConnectionProperties — Database connection details
    - `host` string — Host address of database connection
    - `port` integer — Port number of database connection
    - `database` string — Database name
    - `credentials_id` string — Credential ID to use when connecting to database
    - `link_agent_label` string — DEPRECATED - use link_agent_labels
    - `link_agent_labels` string[] — Link agent override to use when connecting to database (optional)
    - `driver_properties` object — Additional database connection properties
  - `connection_overrides` DatabaseConnectionPropertiesOverride[] — Set of connection_property overrides that apply to this database connection
    - `environment_id` string — Environment ID associated with override
    - `connection_properties` DatabaseConnectionProperties — Database connection details
      - `host` string — Host address of database connection
      - `port` integer — Port number of database connection
      - `database` string — Database name
      - `credentials_id` string — Credential ID to use when connecting to database
      - `link_agent_label` string — DEPRECATED - use link_agent_labels
      - `link_agent_labels` string[] — Link agent override to use when connecting to database (optional)
      - `driver_properties` object — Additional database connection properties
  - `created_by_id` string
  - `created_time` integer
  - `last_updated_by_id` string
  - `last_updated_time` integer
  - `deleted_by_id` string
  - `deleted_time` integer

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
