Commit a branch's drafts
POST
/api/orgs/{org}/projects/{project}/drafts/commit
const url = 'https://api.wrktr.com/api/orgs/example/projects/example/drafts/commit';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"example","message":"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/drafts/commit \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "example", "message": "example" }'One commit with every draft. BranchMoved: the head kept moving while committing (the drafts are kept; try again).
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
message
required
string
Examplegenerated
{ "branch": "example", "message": "example"}Responses
Section titled “Responses”CommitResult
Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}ProjectNotFound | BranchNotFound
BranchMoved | DraftConflicts | NoDrafts