Commit file edits
POST
/api/orgs/{org}/projects/{project}/commits
const url = 'https://api.wrktr.com/api/orgs/example/projects/example/commits';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"example","expectedHead":"example","edits":[{"path":"example","content":"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/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.
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
Examplegenerated
{ "branch": "example", "expectedHead": "example", "edits": [ { "path": "example", "content": "example" } ], "message": "example"}Responses
Section titled “Responses”CommitResult
BadRequest
Media typeapplication/json
object
_tag
required
string
Example
{ "_tag": "BadRequest"}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"}