Get agent response (v2)
curl --request POST \
--url https://rest-api.captide.co/api/v2/rag/agent-response \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "<string>",
"documentIds": "<string>"
}
'import requests
url = "https://rest-api.captide.co/api/v2/rag/agent-response"
payload = {
"query": "<string>",
"documentIds": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', documentIds: '<string>'})
};
fetch('https://rest-api.captide.co/api/v2/rag/agent-response', 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://rest-api.captide.co/api/v2/rag/agent-response",
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([
'query' => '<string>',
'documentIds' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://rest-api.captide.co/api/v2/rag/agent-response"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"documentIds\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://rest-api.captide.co/api/v2/rag/agent-response")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"documentIds\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest-api.captide.co/api/v2/rag/agent-response")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"documentIds\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"content": "Zscaler's net dollar retention rates for the last two quarters are as follows:\n\n- Q3 2025 (trailing 12 months ended April 30, 2025): **114%** \n- Q2 2025 (trailing 12 months ended January 31, 2025): **115%** \n\nThese figures reflect Zscaler's ability to retain and expand recurring revenue from existing customers over the respective periods [#eaf60040].",
"sourceMap": {
"#eaf60040": {
"pageNumber": 41,
"excerpt": "For the trailing 12 months ended January 31, 2025 and 2024, the dollar-based net retention rate was 115% and 117%, respectively.",
"documentMetadata": {
"id": "eaf63939-0da6-4fc7-ba06-adbd46e546a9",
"title": "Zscaler Q2 2025 Form 10-Q",
"documentCategory": "interim-financial-report",
"date": "2025-03-10",
"fiscalQuarter": 2,
"fiscalYear": 2025,
"companyName": "Zscaler, Inc.",
"tickers": [
"ZS"
]
}
}
}
}Agentic RAG
Agent Response
Returns cited Markdown responses, sourced exclusively from corporate disclosures, in response to natural language queries. This endpoint provides AI-generated answers with proper citations to source documents, making it ideal for building Q&A interfaces or research tools.
Response Behavior:
- When relevant documents are found: Returns an AI-generated response with citations in the
sourceMapfield - When no relevant documents are found: Returns an informative message explaining why no documents were found, with an empty
sourceMapfield (HTTP 200 status)
This v2 endpoint supports newer document categories in source mappings (e.g., earnings-presentation, investor-event-presentation, shareholder-meeting-circular, etc.). Agent response quality is exactly the same compared to v1.
POST
/
api
/
v2
/
rag
/
agent-response
Get agent response (v2)
curl --request POST \
--url https://rest-api.captide.co/api/v2/rag/agent-response \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "<string>",
"documentIds": "<string>"
}
'import requests
url = "https://rest-api.captide.co/api/v2/rag/agent-response"
payload = {
"query": "<string>",
"documentIds": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', documentIds: '<string>'})
};
fetch('https://rest-api.captide.co/api/v2/rag/agent-response', 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://rest-api.captide.co/api/v2/rag/agent-response",
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([
'query' => '<string>',
'documentIds' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://rest-api.captide.co/api/v2/rag/agent-response"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"documentIds\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://rest-api.captide.co/api/v2/rag/agent-response")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"documentIds\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest-api.captide.co/api/v2/rag/agent-response")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"documentIds\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"content": "Zscaler's net dollar retention rates for the last two quarters are as follows:\n\n- Q3 2025 (trailing 12 months ended April 30, 2025): **114%** \n- Q2 2025 (trailing 12 months ended January 31, 2025): **115%** \n\nThese figures reflect Zscaler's ability to retain and expand recurring revenue from existing customers over the respective periods [#eaf60040].",
"sourceMap": {
"#eaf60040": {
"pageNumber": 41,
"excerpt": "For the trailing 12 months ended January 31, 2025 and 2024, the dollar-based net retention rate was 115% and 117%, respectively.",
"documentMetadata": {
"id": "eaf63939-0da6-4fc7-ba06-adbd46e546a9",
"title": "Zscaler Q2 2025 Form 10-Q",
"documentCategory": "interim-financial-report",
"date": "2025-03-10",
"fiscalQuarter": 2,
"fiscalYear": 2025,
"companyName": "Zscaler, Inc.",
"tickers": [
"ZS"
]
}
}
}
}Authorizations
Body
application/json
Was this page helpful?