Skip to content

Delete a branch

POST
/api/orgs/{org}/projects/{project}/branches/delete
curl --request POST \
--url https://api.wrktr.com/api/orgs/example/projects/example/branches/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "example" }'

Deletes the branch on the remote if it hasn’t moved since you looked. Never the default branch. Its review history stays.

org
required
string
project
required
string
Media typeapplication/json
object
branch
required
string
Examplegenerated
{
"branch": "example"
}

Success

Media typeapplication/json
object
ok
required
boolean
Examplegenerated
{
"ok": true
}

Unauthorized

Media typeapplication/json
object
_tag
required
string
Allowed values: Unauthorized
message
required
string
Example
{
"_tag": "Unauthorized"
}

ProjectNotFound | BranchNotFound

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ProjectNotFound
project
required
string
Example
{
"_tag": "ProjectNotFound"
}

BranchMoved

Media typeapplication/json
object
_tag
required
string
Allowed values: BranchMoved
branch
required
string
expectedHead
required
string
currentHead
required
string
Example
{
"_tag": "BranchMoved"
}

InvalidInput

Media typeapplication/json
object
_tag
required
string
Allowed values: InvalidInput
message
required
string
Example
{
"_tag": "InvalidInput"
}