Discard a draft
POST
/api/orgs/{org}/projects/{project}/drafts/discard
const url = 'https://api-dev.wrktr.com/api/orgs/example/projects/example/drafts/discard';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"example","path":"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-dev.wrktr.com/api/orgs/example/projects/example/drafts/discard \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "example", "path": "example" }'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
path
required
string
Examplegenerated
{ "branch": "example", "path": "example"}Responses
Section titled “Responses”Success
Media typeapplication/json
object
discarded
required
boolean
Examplegenerated
{ "discarded": true}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}ProjectNotFound | BranchNotFound