---
title: "Delete a database branch"
method: DELETE
path: "/api/v1/databases/{databaseId}/branches/{branchId}"
tags: ["Databases"]
---

# Delete a database branch

`DELETE /api/v1/databases/{databaseId}/branches/{branchId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/databases/{databaseId}/branches/{branchId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Tears down the provider branch and its compute, then soft-deletes the record. Deletion is permanent. Returns 409 branch_has_children when the branch still has child branches; delete the descendants first.

## Path parameters

- `databaseId` string, required
- `branchId` string, required

## Response `200`

The branch was deleted.

- object
  - `deleted` true, required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `409`: The branch still has child branches (code branch_has_children). Delete the descendants first.
- `429`: Too many requests; retry after the indicated delay.
- `502`: Response.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
