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

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

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

Resets a non-production database branch by re-forking it from a source branch (defaults to the production branch). If the target branch is already in sync with the source, returns the existing connection string without performing a reset, unless `force=true` is passed. The production branch cannot be reset.

## Query parameters

- `force` boolean
- `role` 'netlifydb_owner' | 'netlifydb_readonly'

## Request body

- ResetDatabaseBranchRequest — Request body for resetting a database branch
  - `source_branch_id` string — The ID of the branch to re-fork the target branch from. Defaults to "production" if not specified.

## Response `200`

OK

- ResetDatabaseBranchResponse — Response for a database branch reset
  - `reset` boolean — Whether the branch was actually re-forked. False when the target was already in sync with the source and `force=true` was not set.
  - `connection_string` string — The connection string for the reset (or unchanged) branch
  - `metadata` object — Metadata associated with the branch

## Other responses

- `400` — Invalid request — for example, the target is the production branch or the source branch is the same as the target.
- `404` — Database or branch not found
- `default` — error

## Changes

- **2026-04-23** `2df88f8cf134` — 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/branch/:branch_id/reset/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/ba3311f9d27d/schema)
