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

ParameterTypeDescription
base_branchRequiredSource branch name.
target_branchRequiredDestination branch name.
base_is_ephemeralOptionalWhen true, treat base_branch as ephemeral.
target_is_ephemeralOptionalWhen true, create the target in the ephemeral namespace.
forceOptionalWhen true, allow non-fast-forward updates.
preferred_baseOptionalOptional 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

StatusDescription
400 Bad RequestInvalid branch name or request body
401 UnauthorizedInvalid JWT or missing authorization header
403 ForbiddenMissing git:write scope
404 Not FoundRepository not found