Skip to content
  • Auto
  • Light
  • Dark
Get Started

Create

Create
post/v2/vals/{val_id}/branches

Create a new branch

Path Parameters
val_idstring
formatuuid
Body Parameters
namestring
minLength1
maxLength48
branchIdstring
optional

The branch ID to fork from. If this is not specified, the new branch will be forked from main.

formatuuid
Returns
idstring

The id of the branch

formatuuid
createdAtstring
formatdate-time
forkedBranchIdstring

The id of the branch this branch was forked from

namestring
updatedAtstring
formatdate-time
versionnumber
minimum0
curl https://api.val.town/v2/vals/$VAL_ID/branches \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "my-branch"
    }'
200 Example
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "forkedBranchId": "forkedBranchId",
  "links": {
    "html": "https://example.com",
    "self": "https://example.com"
  },
  "name": "name",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "version": 0
}