---
title: "POST /sites/{site_id}/database"
method: POST
path: "/sites/{site_id}/database"
tags: ["database"]
---

# POST /sites/{site_id}/database

`POST /sites/{site_id}/database`

Creates a new database for the specified site. If a database already exists, returns the existing connection string. The database region defaults to the site's functions region if not specified.

## Request body

- CreateDatabaseRequest — Request body for creating a database
  - `region` string — The region where the database should be created. Defaults to the site's functions region if not specified.

## Response `200`

Database already exists

- DatabaseResponse — Response containing the database connection string
  - `connection_string` string — The connection string for the database

## Other responses

- `201` — Created
- `default` — error

---

[API](https://skmtc.net/netlify/apis/netlify-s-api-documentation.md) · [All operations](https://skmtc.net/netlify/apis/netlify-s-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/netlify/netlify-s-api-documentation/versions/71540d1b5d9d/schema)
