Create a new branch from an existing branch or ref. This is useful for agent workflows, ephemeral previews, or server-side automation where you do not want to clone the repo first.
Deprecated: Use /api/repos/{repo_name}/branches/create instead.
Documentation Index
Fetch the complete documentation index at: https://code.storage/docs/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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.
Destination branch name.
"feature/new-onboarding"
Preferred source branch name. Use base_ref when you need an exact ref.
"main"
Whether the base branch should be resolved from the ephemeral namespace.
false
Optional source ref or revision. This supersedes base_branch when provided.
Allow non-fast-forward updates when recreating an existing branch.
Optional fallback base branch name used by the backend when it needs another starting point.
Whether the new branch should be created in the ephemeral namespace.
false
Branch creation result.
Result of creating a branch, including the resulting ref state.
Human-readable result message.
"branch created"
Destination branch name.
"feature/new-onboarding"
Whether the created branch is ephemeral.
false
Resolved commit SHA at the new branch tip.
"abc123def4567890abc123def4567890abc123de"