Land a branch
POST
/api/orgs/{org}/projects/{project}/branches/land
const url = 'https://api.wrktr.com/api/orgs/example/projects/example/branches/land';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"example","force":true,"expectedHead":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wrktr.com/api/orgs/example/projects/example/branches/land \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "example", "force": true, "expectedHead": "example" }'Merges the branch into the default branch with a merge commit, made by the server. Only when the branch already contains the default branch’s head, so the merge can’t conflict (BranchBehind otherwise), and only once it’s ready: checks pass, the review approves the head and no blocking thread is open (LandBlocked says what’s missing). force lands it anyway.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org
required
string
project
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”LandResult
Media typeapplication/json
object
branch
required
string
into
required
string
sha
required
string
Examplegenerated
{ "branch": "example", "into": "example", "sha": "example"}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}ProjectNotFound | BranchNotFound
BranchBehind | NothingToLand | BranchMoved | BranchIsExperiment | BranchClosed | LandBlocked
Media typeapplication/json
Any of:
object
_tag
required
string
branch
required
string
base
required
string
object
_tag
required
string
branch
required
string
object
_tag
required
string
branch
required
string
expectedHead
required
string
currentHead
required
string
object
_tag
required
string
branch
required
string
object
_tag
required
string
branch
required
string
Example
{ "_tag": "BranchBehind"}