# Create branch

```http
POST /projects/{project_reference}/branches
```

Create a branch from the project root or from another branch, snapshotting its files. Requires project.files.write.

## Parameters

| Name                | In   | Required | Description |
| ------------------- | ---- | -------- | ----------- |
| `project_reference` | path | Yes      |             |

## Request body

| Field                  | Type        | Required | Description                                                                                                                                                                                       |
| ---------------------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                 | string      | Yes      | Branch name. Branch name may only contain letters, numbers, ".", "\_", "/" and "-", and cannot start with "-".                                                                                    |
| `base_branch_id`       | string,null |          | Omit to branch from the project root (created automatically if missing). Use null to create a root branch; rejected if a root already exists. A UUID must identify a base branch in this project. |
| `description`          | string      |          | Branch description.                                                                                                                                                                               |
| `auto_delete_on_merge` | boolean     |          | Delete the branch after it merges. Defaults to false.                                                                                                                                             |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 201    | Branch created successfully.                                                                                |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 409    | Conflict                                                                                                    |
| 413    | Payload too large                                                                                           |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
