Skip to content

Commit file edits

POST
/api/orgs/{org}/projects/{project}/commits
curl --request POST \
--url https://api.wrktr.com/api/orgs/example/projects/example/commits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "example", "expectedHead": "example", "edits": [ { "path": "example", "content": "example" } ], "message": "example" }'

Commits edits to a branch without a clone. Give expectedHead to fail with BranchMoved if the branch moved.

org
required
string
project
required
string
Media typeapplication/json
object
branch
required
string
expectedHead
Any of:
string
edits
required
Array<object>
>= 1 items
object
path
required
string
>= 1 characters
content
required
Any of:
string
message
required
string
Examplegenerated
{
"branch": "example",
"expectedHead": "example",
"edits": [
{
"path": "example",
"content": "example"
}
],
"message": "example"
}

CommitResult

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

BadRequest

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

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"
}