Skip to content

Create a branch of a project

POST
/api/v1/projects/{projectId}/branches
curl --request POST \
--url https://app.avera.io/api/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "sourceBranchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Creates a branch from the source branch’s current head. A branch materializes nothing at creation: reads resolve through its lineage, so the new branch sees its source as it stood at the branch point until its own commits diverge from it. The branch key is derived from the name once, made unique within the project, and never revised, so links built from it stay citable across renames.

projectId
required
string format: uuid
Media typeapplication/json
object
name
required
string
description
string | null
sourceBranchId
required
string format: uuid

Example generated

{
"name": "example",
"description": "example",
"sourceBranchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

OK

Media type*/*
object
id
required
string format: uuid
projectId
required
string format: uuid
key
required
string
name
required
string
description
string | null
isMain
required
boolean
status
required
string
Allowed values: ACTIVE MERGED CLOSED
sourceBranchId
string | null format: uuid
headCommitId
string | null format: uuid
createdAt
required
string format: date-time
createdBy
required
string format: uuid