Delete branch

Deletes the specified branch from a project and places all compute endpoints into an idle state, breaking existing client connections.

The deletion completes after all operations finish. You cannot delete a project's root or default branch, or a branch that has a child branch. A project must have at least one branch.

By default, deleted branches can be recovered within a 7-day grace period. Use the hard_delete parameter to permanently delete the branch immediately. For related information, see Manage branches.

Path Params
string
required

The Neon project ID

string
required

The branch ID

Query Params
boolean
Defaults to false

If true, the branch is permanently deleted immediately without a recovery window. If false (default), the branch can be recovered within 7 days via the recover endpoint.

This parameter is part of the Branch Recovery feature, which is in preview and not available to all users.

Responses

204

Returned if the branch doesn't exist or has already been deleted

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json