Skip to main content
POST
Create Branch

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

repo_name
string
required

Repository name. Names that contain / or any other character that is not safe in a URL path segment must be URL encoded so the value occupies a single path segment. For example pierre/example is sent as pierre%2Fexample. Plain names such as example can be sent as-is. The server URL-decodes the value before resolving the repository.

Body

application/json

Create a branch from another branch or ref. The source and destination can live in the default namespace or the ephemeral namespace.

Create-branch request body describing the new branch and its base ref.

target_branch
string
required

Destination branch name.

Example:

"feature/new-onboarding"

base_branch
string

Preferred source branch name. Use base_ref when you need an exact ref.

Example:

"main"

base_is_ephemeral
boolean

Whether the base branch should be resolved from the ephemeral namespace.

Example:

false

base_ref
string

Optional source ref or revision. This supersedes base_branch when provided.

force
boolean

Allow non-fast-forward updates when recreating an existing branch.

preferred_base
string

Optional fallback base branch name used by the backend when it needs another starting point.

target_is_ephemeral
boolean

Whether the new branch should be created in the ephemeral namespace.

Example:

false

Response

Branch creation result.

Result of creating a branch, including the resulting ref state.

message
string
required

Human-readable result message.

Example:

"branch created"

target_branch
string
required

Destination branch name.

Example:

"feature/new-onboarding"

target_is_ephemeral
boolean
required

Whether the created branch is ephemeral.

Example:

false

commit_sha
string

Resolved commit SHA at the new branch tip.

Example:

"abc123def4567890abc123def4567890abc123de"