---
title: "Delete branch"
method: DELETE
path: "/api/apps/{app_id}/branches/{branch_id}"
---

# Delete branch

`DELETE /api/apps/{app_id}/branches/{branch_id}`

## Request

- Base URL: `https://app.base44.com`
- URL: `https://app.base44.com/api/apps/{app_id}/branches/{branch_id}`
- Auth: HTTP bearer

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Deletes an active branch and discards its changes. Its code, its preview, and the entity and backend function changes made on it are removed, along with comments left on its preview. A deleted branch can't be restored.

After deletion, [List branches](/api-reference/list-branches) no longer returns the branch, but [Get branch](/api-reference/get-branch) still does, with `status` set to `deleted`. Its name is free to use again. Merged and already deleted branches can't be deleted.

This endpoint is limited to 30 requests per minute, shared with Create branch, Delete branch and Merge branch.

<Tip>A 409 response carries an `extra_data.reason` code that says why the request was refused.</Tip>

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>

## Path parameters

- `branch_id` string, required: ID of the branch, as returned by [List branches](/api-reference/list-branches).
- `app_id` string, required: ID of the app the branch belongs to.

## Response `200`

The branch was deleted.

- DeletedBranch: Confirms the deletion.
  - `success` boolean, required: Always `true`.

## Other responses

- `400`: The branch isn't active: it was already merged or deleted.
- `401`: Missing or invalid credentials.
- `403`: You don't have editor access to this app, the app is blocked, your API key is read-only, or you used a workspace API key.
- `404`: App not found, or the app has no branch with this ID.
- `409`: The AI is working on the branch, the branch is being updated from main, or its latest changes are still being saved.
- `429`: Rate limit exceeded. The base limit is 30 requests per minute. See [Rate limits](/developers/references/apps-api/get-started/rate-limits) for the multiplier your plan gets.

## Changes

- **2026-10-11** `80287813ab84`: 1 info
  - the endpoint scheme security `PersonalAccessTokenAuth` was added to the API
- **2026-10-08** `16acfcde4e33`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/base44/apis/base44-app-management-api/changes/api/apps/:app_id/branches/:branch_id/delete.md)

---

[API](https://skmtc.dev/base44/apis/base44-app-management-api.md) - [All operations](https://skmtc.dev/base44/apis/base44-app-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/base44/apis/base44-app-management-api/revisions/c534f09cf314?raw)
