Reject Comment
curl --request POST \
--url https://api.velt.dev/v2/agents/checks/comments/reject \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"organizationId": "<string>",
"documentId": "<string>",
"annotationId": "<string>",
"reason": "<string>",
"userId": "<string>",
"feedbackReason": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/agents/checks/comments/reject"
payload = { "data": {
"organizationId": "<string>",
"documentId": "<string>",
"annotationId": "<string>",
"reason": "<string>",
"userId": "<string>",
"feedbackReason": "<string>"
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
organizationId: '<string>',
documentId: '<string>',
annotationId: '<string>',
reason: '<string>',
userId: '<string>',
feedbackReason: '<string>'
}
})
};
fetch('https://api.velt.dev/v2/agents/checks/comments/reject', 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.velt.dev/v2/agents/checks/comments/reject",
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([
'data' => [
'organizationId' => '<string>',
'documentId' => '<string>',
'annotationId' => '<string>',
'reason' => '<string>',
'userId' => '<string>',
'feedbackReason' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$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.velt.dev/v2/agents/checks/comments/reject"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"reason\": \"<string>\",\n \"userId\": \"<string>\",\n \"feedbackReason\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-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.velt.dev/v2/agents/checks/comments/reject")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"reason\": \"<string>\",\n \"userId\": \"<string>\",\n \"feedbackReason\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/agents/checks/comments/reject")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"reason\": \"<string>\",\n \"userId\": \"<string>\",\n \"feedbackReason\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "Comment rejected",
"data": {
"rejected": true
}
}
}
Checks
Reject Comment
POST
/
v2
/
agents
/
checks
/
comments
/
reject
Reject Comment
curl --request POST \
--url https://api.velt.dev/v2/agents/checks/comments/reject \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"organizationId": "<string>",
"documentId": "<string>",
"annotationId": "<string>",
"reason": "<string>",
"userId": "<string>",
"feedbackReason": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/agents/checks/comments/reject"
payload = { "data": {
"organizationId": "<string>",
"documentId": "<string>",
"annotationId": "<string>",
"reason": "<string>",
"userId": "<string>",
"feedbackReason": "<string>"
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
organizationId: '<string>',
documentId: '<string>',
annotationId: '<string>',
reason: '<string>',
userId: '<string>',
feedbackReason: '<string>'
}
})
};
fetch('https://api.velt.dev/v2/agents/checks/comments/reject', 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.velt.dev/v2/agents/checks/comments/reject",
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([
'data' => [
'organizationId' => '<string>',
'documentId' => '<string>',
'annotationId' => '<string>',
'reason' => '<string>',
'userId' => '<string>',
'feedbackReason' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);
$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.velt.dev/v2/agents/checks/comments/reject"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"reason\": \"<string>\",\n \"userId\": \"<string>\",\n \"feedbackReason\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-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.velt.dev/v2/agents/checks/comments/reject")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"reason\": \"<string>\",\n \"userId\": \"<string>\",\n \"feedbackReason\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/agents/checks/comments/reject")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"reason\": \"<string>\",\n \"userId\": \"<string>\",\n \"feedbackReason\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "Comment rejected",
"data": {
"rejected": true
}
}
}
Use this API to reject one comment of a check, with one of the four reject reasons. It writes the same shape as the Velt SDK’s
The schema uses
Errors:
rejectSuggestion(): the comment’s suggestion.status becomes rejected, with suggestion.rejectReason (the person’s words when given, else the reason), suggestion.resolvedBy and suggestion.resolvedAt, and the annotation becomes a regular comment.
The comment’s status does not change: an Open comment stays Open, with its pin, and a Resolved one stays Resolved. A resolve that was waiting for its verify rescan stops waiting. Like the SDK, it rejects only a suggestion that is still pending (or a comment with no suggestion) that no scan verified: an accepted suggestion is refused with CHECKS_SUGGESTION_SETTLED, a verified comment with CHECKS_ALREADY_VERIFIED. A comment rejected only by Exclude Check takes the person’s reject instead. A rejected comment counts nowhere: not in the check’s open count, never makes a check failing, and not in the score. When an agent finds the same problem again, the comment stays rejected as it is: no scan reopens, resolves, verifies or rewrites it.
Reject is idempotent: a comment that is already rejected is left as it is.
The comment must be an agent comment. A person’s comment is refused, attached to a check or not: detach it instead.
Endpoint
POST https://api.velt.dev/v2/agents/checks/comments/reject
Headers
string
required
Your API key.
string
required
Your Auth Token.
Body
Params
object
required
Show properties
Show properties
string
required
1 to 512 characters. The organization of the project.
string
required
1 to 512 characters. The document of the project.
string
required
The comment annotation id. 1 to 512 characters, no
/, and not . or ...string
required
"wrong", "not_important", "not_applicable" or "cannot_tell".string
required
1 to 512 characters. Recorded as the person who rejected the comment.
string
At most 2,000 characters. The person’s own words, stored as
suggestion.rejectReason and sent with the reason to the agent’s feedback..strict(): unknown fields are rejected.
Example Requests
{
"data": {
"organizationId": "org_acme",
"documentId": "acme-marketing-site",
"annotationId": "K7mQ2xR9vB4wLdT1sYpN",
"reason": "not_applicable",
"userId": "user_sam",
"feedbackReason": "This link is behind a login on purpose."
}
}
Response
Success Response
{
"result": {
"status": "success",
"message": "Comment rejected",
"data": {
"rejected": true
}
}
}
Failure Response
{
"error": {
"message": "Only an agent comment can be resolved, rejected or reopened here",
"status": "FAILED_PRECONDITION",
"details": {
"reason": "CHECKS_NOT_AGENT_COMMENT"
}
}
}
INVALID_ARGUMENT (a body outside the schema: a missing annotationId or userId, a reason outside the four (excluded, which a row can show, is the engine’s own and refused here), a feedbackReason over 2,000 characters, or an unknown field) / NOT_FOUND with CHECKS_COMMENT_NOT_FOUND (no such comment in the project) / FAILED_PRECONDITION with CHECKS_NOT_AGENT_COMMENT (a person’s comment), CHECKS_SUGGESTION_SETTLED (an accepted suggestion) or CHECKS_ALREADY_VERIFIED (a comment a scan verified).
{
"result": {
"status": "success",
"message": "Comment rejected",
"data": {
"rejected": true
}
}
}
Was this page helpful?

