Skip to main content
Create a new branch from an existing branch, optionally across the ephemeral namespace.
POST /api/v1/repos/branches/create
Authorization: Bearer YOUR_JWT_TOKEN
Content-Type: application/json

{
  "base_branch": "main",
  "target_branch": "feature/new-onboarding",
  "base_is_ephemeral": false,
  "target_is_ephemeral": false
}

Request Body

base_branch
string
required
Source branch name.
target_branch
string
required
Destination branch name.
base_is_ephemeral
string
When true, treat base_branch as ephemeral.
target_is_ephemeral
string
When true, create the target in the ephemeral namespace.
force
string
When true, allow non-fast-forward updates.
preferred_base
string
Optional fallback base branch name used by the backend.

JWT Requirements

  • The JWT must include the repository in the repo claim
  • Requires git:write scope

Response

{
  "message": "branch created",
  "target_branch": "feature/new-onboarding",
  "target_is_ephemeral": false,
  "commit_sha": "abc123..."
}

Error Responses

400 Bad Request
string
Invalid branch name or request body
401 Unauthorized
string
Invalid JWT or missing authorization header
403 Forbidden
string
Missing git:write scope
404 Not Found
string
Repository not found