---
title: "Delete a branch"
method: DELETE
path: "/spaces/{spaceId}/branches/{branchId}"
tags: ["Manage Branches"]
---

# Delete a branch

`DELETE /spaces/{spaceId}/branches/{branchId}`

Deletes a branch.

## Path parameters

- `spaceId` string, required
- `branchId` string, required

## Response `200`

A branch response.

- Branch — A branch is like a separate space, which is based on a specific version of the space or on a specific version of some other branch of the space. Reading & writing features to a branch does not have an effect on the main branch or any other branch of the space. A branch can be created by pointing to a base ref. A base ref consists of the base branch (e.g, "main") and the base version of that base branch. New write transactions to the created branch will continue to increase the version counter starting from the base version. Versions in that branch are independent from the versions of the base branch.
  - `id` string — The branch ID. It must be unique per space.
  - `baseRef` string — The reference onto which the branch has been created. A reference describes a target branch and a version within that target branch. References have the following syntax: `[<branchName (optional, default: main)>:][<version (optional, default: HEAD)>]` The "main"-branch is the space itself as it has been created in the first place. Defining the branch as part of the reference only becomes necessary if further branches have been created for the space, which should be addressed by the ref. Samples: - `main:42` points to version 42 of the "main"-branch - `myBranch:37` Points to version 37 of the branch with ID "myBranch" - `42` points to version 42 of the "main"-branch - `myBranch:HEAD` points to the latest version of the branch with ID "myBranch" - `HEAD` points to the latest version of the "main"-branch - `myBranch` points to the latest version of the branch with ID "myBranch"

## Other responses

- `400` — Malformed or Bad Request.
- `401` — Unauthorized to perform the request.
- `403` — Forbidden request. Insufficient rights to perform the request.
- `404` — Not found.

---

[API](https://skmtc.net/here/apis/here-xyz-hub.md) · [All operations](https://skmtc.net/here/apis/here-xyz-hub/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/here/here-xyz-hub/revisions/1c6c6a2bcac9/schema)
