Skip to main content
POST
/
branches
Create branch
curl --request POST \
  --url https://api.specular.dev/branches/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "projectId": "<string>",
  "git": {
    "branch": "<string>"
  }
}
'
{
  "branch": {
    "id": "<string>",
    "projectId": "<string>",
    "name": "<string>",
    "state": "idle",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "mcpUrl": "<string>",
    "appUrl": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication with API key (format: Bearer sk_xxx)

Body

application/json
name
string
required

Branch name

projectId
string
required

Project ID

git
object

Git configuration (required if project has custom git)

Response

Branch created successfully

Branch created successfully

branch
object