curl --request POST \
--url https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"thread_id": "<string>",
"file_path": "<string>",
"start_line": 123,
"end_line": 123
}
'import requests
url = "https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments"
payload = {
"content": "<string>",
"thread_id": "<string>",
"file_path": "<string>",
"start_line": 123,
"end_line": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
thread_id: '<string>',
file_path: '<string>',
start_line: 123,
end_line: 123
})
};
fetch('https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'thread_id' => '<string>',
'file_path' => '<string>',
'start_line' => 123,
'end_line' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"file_path\": \"<string>\",\n \"start_line\": 123,\n \"end_line\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"file_path\": \"<string>\",\n \"start_line\": 123,\n \"end_line\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"file_path\": \"<string>\",\n \"start_line\": 123,\n \"end_line\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"review_id": "<string>",
"thread_id": "<string>",
"author": {
"id": "<string>",
"image": "<string>",
"email": "jsmith@example.com",
"full_name": "<string>",
"name": "<string>",
"tier": "EDUCATION"
},
"content": "<string>",
"created_at": 123,
"updated_at": 123,
"file_path": "<string>",
"start_line": 123,
"end_line": 123,
"start_side": "left",
"end_side": "left"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}Add review comment
Add a comment to a review with optional file reference
curl --request POST \
--url https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"thread_id": "<string>",
"file_path": "<string>",
"start_line": 123,
"end_line": 123
}
'import requests
url = "https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments"
payload = {
"content": "<string>",
"thread_id": "<string>",
"file_path": "<string>",
"start_line": 123,
"end_line": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
thread_id: '<string>',
file_path: '<string>',
start_line: 123,
end_line: 123
})
};
fetch('https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'thread_id' => '<string>',
'file_path' => '<string>',
'start_line' => 123,
'end_line' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"file_path\": \"<string>\",\n \"start_line\": 123,\n \"end_line\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"file_path\": \"<string>\",\n \"start_line\": 123,\n \"end_line\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diversion.dev/v0/repos/{repo_id}/reviews/{review_id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"thread_id\": \"<string>\",\n \"file_path\": \"<string>\",\n \"start_line\": 123,\n \"end_line\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"review_id": "<string>",
"thread_id": "<string>",
"author": {
"id": "<string>",
"image": "<string>",
"email": "jsmith@example.com",
"full_name": "<string>",
"name": "<string>",
"tier": "EDUCATION"
},
"content": "<string>",
"created_at": 123,
"updated_at": 123,
"file_path": "<string>",
"start_line": 123,
"end_line": 123,
"start_side": "left",
"end_side": "left"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}Authorizations
This API uses OAuth 2 with the implicit grant flow
Path Parameters
The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.
3 - 128"example_id"
Review ID
128Body
Payload for adding a comment to a review
Comment content
65536Thread ID for the comment (optional, will be generated if not provided)
128File path for inline comments
4096Starting line number for inline comments
Ending line number for inline comments
Side of a diff view (left = base/original, right = compare/modified)
left, right Side of a diff view (left = base/original, right = compare/modified)
left, right Response
Comment added successfully
Review comment details
Comment ID
Review ID this comment belongs to
Thread ID this comment belongs to
User details
Show child attributes
Show child attributes
Comment content
Unix timestamp when the comment was created
Unix timestamp when the comment was last updated
File path for inline comments
Starting line number for inline comments
Ending line number for inline comments
Side of a diff view (left = base/original, right = compare/modified)
left, right Side of a diff view (left = base/original, right = compare/modified)
left, right 
