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

# POST /sites/{site_id}/database/branch

`POST /sites/{site_id}/database/branch`

Creates a new database branch. If a branch already exists for the specified branch ID, returns the existing connection string.

## Request body

- CreateDatabaseBranchRequest — Request body for creating a database branch
  - `parent_branch_id` string — The ID of the parent branch to create the new branch from. Defaults to the production branch if not specified.
  - `branch_id` string, required — The branch identifier
  - `metadata` object — Arbitrary metadata to associate with the branch

## Response `200`

Branch already exists

- DatabaseBranchResponse — Response containing the database branch connection string
  - `connection_string` string — The connection string for the database branch
  - `metadata` object — Metadata associated with the branch

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