Comment on a branch
POST
/api/orgs/{org}/projects/{project}/comments
const url = 'https://api.wrktr.com/api/orgs/example/projects/example/comments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"example","body":"example","headSha":"example","path":"example","line":"Infinity","parentId":"example","authorKind":"human"}'};
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/comments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "example", "body": "example", "headSha": "example", "path": "example", "line": "Infinity", "parentId": "example", "authorKind": "human" }'Start a thread on a line (path, line, and the headSha the line number refers to), or reply to one (parentId).
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”Responses
Section titled “Responses”Comment
Media typeapplication/json
object
id
required
string
branch
required
string
path
required
string
anchorSha
required
string
lineText
required
string
body
required
string
author
required
string
authorKind
required
string
status
required
string
Example
{ "line": "Infinity", "authorKind": "human", "status": "open", "createdAt": "Infinity", "updatedAt": "Infinity", "severity": "blocker"}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 | CommentNotFound
LineNotFound