Delete a branch
POST
/api/orgs/{org}/projects/{project}/branches/delete
const url = 'https://api.wrktr.com/api/orgs/example/projects/example/branches/delete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"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/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.
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”Media typeapplication/json
object
branch
required
string
Examplegenerated
{ "branch": "example"}Responses
Section titled “Responses”Success
Media typeapplication/json
object
ok
required
boolean
Examplegenerated
{ "ok": true}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}ProjectNotFound | BranchNotFound
BranchMoved
Media typeapplication/json
object
_tag
required
string
branch
required
string
expectedHead
required
string
currentHead
required
string
Example
{ "_tag": "BranchMoved"}InvalidInput
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "InvalidInput"}