Get Source Location
curl --request POST \
--url https://api.velt.dev/v2/agents/checks/source-location/get \
--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>",
"pageUrl": "<string>",
"versionId": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/agents/checks/source-location/get"
payload = { "data": {
"organizationId": "<string>",
"documentId": "<string>",
"annotationId": "<string>",
"pageUrl": "<string>",
"versionId": "<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>',
pageUrl: '<string>',
versionId: '<string>'
}
})
};
fetch('https://api.velt.dev/v2/agents/checks/source-location/get', 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/source-location/get",
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>',
'pageUrl' => '<string>',
'versionId' => '<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/source-location/get"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"pageUrl\": \"<string>\",\n \"versionId\": \"<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/source-location/get")
.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 \"pageUrl\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/agents/checks/source-location/get")
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 \"pageUrl\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "Source location retrieved",
"data": {
"versionId": null,
"urlHash": "a41c9e07",
"pageUrl": "https://www.example.com/",
"lineNumber": null,
"line": "<meta name=\"robots\" content=\"noindex\">",
"lineOffset": 0,
"matchStart": null,
"matchEnd": null
}
}
}
Checks
Get Source Location
POST
/
v2
/
agents
/
checks
/
source-location
/
get
Get Source Location
curl --request POST \
--url https://api.velt.dev/v2/agents/checks/source-location/get \
--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>",
"pageUrl": "<string>",
"versionId": "<string>"
}
}
'import requests
url = "https://api.velt.dev/v2/agents/checks/source-location/get"
payload = { "data": {
"organizationId": "<string>",
"documentId": "<string>",
"annotationId": "<string>",
"pageUrl": "<string>",
"versionId": "<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>',
pageUrl: '<string>',
versionId: '<string>'
}
})
};
fetch('https://api.velt.dev/v2/agents/checks/source-location/get', 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/source-location/get",
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>',
'pageUrl' => '<string>',
'versionId' => '<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/source-location/get"
payload := strings.NewReader("{\n \"data\": {\n \"organizationId\": \"<string>\",\n \"documentId\": \"<string>\",\n \"annotationId\": \"<string>\",\n \"pageUrl\": \"<string>\",\n \"versionId\": \"<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/source-location/get")
.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 \"pageUrl\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velt.dev/v2/agents/checks/source-location/get")
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 \"pageUrl\": \"<string>\",\n \"versionId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"status": "success",
"message": "Source location retrieved",
"data": {
"versionId": null,
"urlHash": "a41c9e07",
"pageUrl": "https://www.example.com/",
"lineNumber": null,
"line": "<meta name=\"robots\" content=\"noindex\">",
"lineOffset": 0,
"matchStart": null,
"matchEnd": null
}
}
}
Use this API to find where a
The schema uses
Errors:
source comment’s evidence sits in a page’s stored HTML: the line number, the line, and the evidence’s offsets in it. Use it for a “Show in source” view. Render the answer as it comes: do not repeat the matching.
The comment must be a source comment (its locationType is "source"). The HTML is the page’s capture in the site version asked for. See Checks Overview.
Endpoint
POST https://api.velt.dev/v2/agents/checks/source-location/get
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
One of the comment’s pages: an absolute
http(s) URL on the comment’s site, at most 2,048 characters. Default: the comment’s own page.string
A version of that page.
[A-Za-z0-9_-], 1 to 200 characters. Default: the version the comment last saw the page on..strict(): unknown fields are rejected.
Example Requests
1. The comment’s own page
{
"data": {
"organizationId": "org_acme",
"documentId": "acme-marketing-site",
"annotationId": "R5tB1nM8wQ3xKzL7cVdF"
}
}
2. Another page and version of a site comment
{
"data": {
"organizationId": "org_acme",
"documentId": "acme-marketing-site",
"annotationId": "R5tB1nM8wQ3xKzL7cVdF",
"pageUrl": "https://www.example.com/about",
"versionId": "ver_20261025b"
}
}
Response
Success Response
{
"result": {
"status": "success",
"message": "Source location retrieved",
"data": {
"versionId": "ver_20261026a",
"urlHash": "a41c9e07",
"pageUrl": "https://www.example.com/",
"lineNumber": 42,
"line": " <meta name=\"robots\" content=\"noindex\">",
"lineOffset": 0,
"matchStart": 4,
"matchEnd": 43
}
}
}
| Field | Type | Description |
|---|---|---|
data.versionId | string | null | The version read. |
data.urlHash | string | null | Hash of the page read. |
data.pageUrl | string | null | The page read, or null when none could be. |
data.lineNumber | number | null | 1-based line of the stored HTML that holds the evidence, or null when it was not found. |
data.line | string | The line that holds the evidence. A very long line (minified HTML) is cut around the match. When the stored HTML could not be read, the evidence itself. |
data.lineOffset | number | Where line starts in the stored line. 0 unless a long line was cut. |
data.matchStart | number | null | Where the evidence starts in line, or null when it was not found there. |
data.matchEnd | number | null | Where the evidence ends in line (exclusive), or null. |
The stored HTML is read up to 8 MB and within about 8 seconds. When the page has no capture for the version, or the read does not finish in time, the answer is the evidence with no offsets.
Failure Response
{
"error": {
"message": "This comment has no line in the stored page",
"status": "FAILED_PRECONDITION",
"details": {
"reason": "CHECKS_SOURCE_LOCATION_UNAVAILABLE"
}
}
}
INVALID_ARGUMENTfor a body outside the schema (a missing or malformedannotationId, apageUrlthat is not a URL, a malformedversionId, or an unknown field), or withCHECKS_INVALID_PAGE_URLfor apageUrlthat is nothttp(s), not on the comment’s site, or not one of its pages;NOT_FOUNDwithCHECKS_COMMENT_NOT_FOUND(no such comment in the project) orCHECKS_WORKSPACE_NOT_FOUND(the workspace has no store database);FAILED_PRECONDITIONwithCHECKS_NOT_A_CHECK_COMMENT(the comment carries no check) orCHECKS_SOURCE_LOCATION_UNAVAILABLE(the comment is not asourcecomment).
{
"result": {
"status": "success",
"message": "Source location retrieved",
"data": {
"versionId": null,
"urlHash": "a41c9e07",
"pageUrl": "https://www.example.com/",
"lineNumber": null,
"line": "<meta name=\"robots\" content=\"noindex\">",
"lineOffset": 0,
"matchStart": null,
"matchEnd": null
}
}
}
Was this page helpful?

