Skip to main content
POST
Merge a Trail (repo_id addressing)

Authorizations

Authorization
string
header
required

OAuth 2.0 authorization code flow.

Path Parameters

repo_id
string
required

Repo id: placement ULID or public repo_

number
string
required

Trail number

Body

application/json
bypass
boolean
deleteBranch
boolean

Delete the native Trail's working branch after the merge, first moving the open and draft Trails based on it to the merged Trail's base, as the merger. Omitted uses the repository's deleteBranchOnMerge setting. Ignored for GitHub-backed Trails.

expectedHeadSha
string

Response

OK

branchDeleted
boolean
required

The Trail's working branch no longer exists after the merge. Always false for a GitHub-backed Trail, whose branch GitHub manages.

mergeCommitSha
string
required

Merge commit SHA; empty when the merge fast-forwarded or was already up to date

ok
boolean
required
$schema
string<uri>
read-only

A URL to the JSON Schema for this object.

Example:

"/api/v1/schemas/TrailMergeSubmitResponse.json"

branchKeptReason
enum<string>

Why the native Trail's working branch was kept. Set only when branchDeleted is false; omitted for a GitHub-backed Trail. not_requested: the request sent deleteBranch false. disabled: deleteBranch was omitted and the repository's deleteBranchOnMerge setting is off. base: the branch is the Trail's base. stacked: an open or draft Trail based on the branch could not be moved to the merged Trail's base. claimed: another Trail took the branch name after the merge. moved: the branch moved past the merged head. protected: branch protection refused the delete. default_branch: the branch is the repository's default branch. failed: the delete, or moving the Trails based on the branch, could not run or did not succeed.

Available options:
not_requested,
disabled,
base,
stacked,
claimed,
moved,
protected,
default_branch,
failed