---
title: "Create a database connection"
method: POST
path: "/v1/users/{userId}/database-connections"
tags: ["Database connections"]
---

# Create a database connection

`POST /v1/users/{userId}/database-connections`

## Request body

- object
  - `databaseConnection` object, required
    - `connectionName` string, required — The name of the connection, for display purposes.
    - `databaseType` 'POSTGRESQL' | 'MYSQL' | 'SQLSERVER' | 'ORACLE', required — The SQL flavour of the database.
    - `host` string, required — The host name or address of the database.
    - `port` integer, required — The port number of the database.
    - `databaseName` string, required — The name of the database.
    - `username` string, required — The name of the user to connect to the database as.
    - `password` string, required — The password of the user to connect to the database as.

## Response `201`

Success

- object
  - `databaseConnection` DatabaseConnectionResponse, required
    - `id` string, required — The ID of the connection.
    - `connectionName` string, required — The name of the connection, for display purposes.
    - `databaseType` 'POSTGRESQL' | 'MYSQL' | 'SQLSERVER' | 'ORACLE', required — The SQL flavour of the database.
    - `host` string, required — The host name or address of the database.
    - `port` integer, required — The port number of the database.
    - `databaseName` string, required — The name of the database.
    - `username` string, required — The name of the user to connect to the database as.
    - `links` object, required
      - `self` string, required

## Other responses

- `400` — 400 Bad Request response
- `401` — 401 Unauthenticated response
- `403` — 403 Unauthorized response
- `422` — 422 Bad Entity response

---

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