---
title: "POST /v2/vals/{val_id}/branches"
method: POST
path: "/v2/vals/{val_id}/branches"
tags: ["vals"]
---

# POST /v2/vals/{val_id}/branches

`POST /v2/vals/{val_id}/branches`

Create a new branch

## Path parameters

- `val_id` string, uuid, required

## Request body

- object — Branch information provided to create a new project
  - `name` string, required
  - `branchId` string, uuid — The branch ID to fork from. If this is not specified, the new branch will be forked from main.

## Response `201`

A Branch

- Branch — A Branch
  - `name` string, required
  - `id` string, uuid, required — The id of the branch
  - `version` integer, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `forkedBranchId` string, nullable, required — The id of the branch this branch was forked from
  - `links` object, required
    - `self` string, uri, required — The URL of this resource on this API
    - `html` string, uri, required — The URL of this resource on Val Town

## Other responses

- `409` — Conflict: Branch name already exists in this project

---

[API](https://skmtc.net/val-town/apis/val-town-api.md) · [All operations](https://skmtc.net/val-town/apis/val-town-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/val-town/val-town-api/versions/4d8b6d2e6db3/schema)
