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

## Changes

- **2026-02-03** `9757c1b9bd72` — 1 info
  - endpoint added
- **2025-10-01** `dd4e48196663` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/netlify/apis/netlify-s-api-documentation/changes/sites/:site_id/database/post.md)

---

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