Skip to content

Commit a branch's drafts

POST
/api/orgs/{org}/projects/{project}/drafts/commit
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).

org
required
string
project
required
string
Media typeapplication/json
object
branch
required
string
message
required
string
>= 1 characters
Examplegenerated
{
"branch": "example",
"message": "example"
}

CommitResult

Media typeapplication/json
object
sha
required
string
parent
required
string
objects
required
Any of:
number
Example
{
"objects": "Infinity"
}

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 | DraftConflicts | NoDrafts

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