Create a branch of a project
POST
/api/v1/projects/{projectId}/branches
const url = 'https://app.avera.io/api/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","sourceBranchId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”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"}Responses
Section titled “Responses”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
sourceBranchId
string | null format: uuid
headCommitId
string | null format: uuid
createdAt
required
string format: date-time
createdBy
required
string format: uuid