References
curl --request GET \
--url https://api.linqalpha.com/v1/references \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.linqalpha.com/v1/references"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.linqalpha.com/v1/references', 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.linqalpha.com/v1/references",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.linqalpha.com/v1/references"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.linqalpha.com/v1/references")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linqalpha.com/v1/references")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"references": [
{
"id": "12",
"citation_idx": "12",
"search_type": "rms",
"chunk_id": "123e4567-e89b-12d3-a456-426614174000",
"text": "For fiscal year 2024, Tesla expects EBIT to grow between 15% and 20%...",
"text_type": "paragraph",
"document_id": "123e4567-e89b-12d3-a456-426614174000",
"document_name": "Tesla 10-K 2023",
"s3_file_key": "tesla/filings/2023/10k.pdf",
"external_url": "https://www.sec.gov/ix?doc=/Archives/edgar/data/1318605/000095017024002308/tsla-20231231.htm",
"metadata": {
"source": "filing",
"ticker": "TSLA",
"published_at": "2024-02-14"
},
"custom_metadata": null
}
]
}{
"error": {
"code": "CHAT_MESSAGE_ID_MISSING",
"msg": "chat_message_id is required",
"message": "chat_message_id is required"
},
"payload": null
}{
"error": {
"code": "API_KEY_MISSING",
"msg": "header does not contain api key",
"message": "header does not contain api key"
},
"payload": null
}{
"error": {
"code": "FORBIDDEN",
"message": "Access denied: insufficient permissions."
},
"payload": null
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
},
"payload": null
}{
"error": {
"code": "SERVER_ERROR",
"message": "An unexpected error occurred on the server."
},
"payload": null
}Basic
References
Retrieves evidence references for a specific chat message. Each reference corresponds to an exact chunk used in the final answer generated by the LinqAlpha engine. These chunks represent the precise portions of documents (e.g., filings, transcripts, or news) that were retrieved and cited by the model to construct the final response..
How to find chat_message_id:
Look for the event with event_name set to search_results in the Chat API response data. For detailed instructions, see search_results event response.
How to view original documents:
- Via Viewer:
https://chat.linqalpha.com/rms/viewer?chat_message_id={chat_message_id}&citation_idx={citation_idx} - Direct Download: If the reference contains a
document_id, you can access the original document directly through the presigned_url endpoint.
GET
/
v1
/
references
References
curl --request GET \
--url https://api.linqalpha.com/v1/references \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.linqalpha.com/v1/references"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.linqalpha.com/v1/references', 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.linqalpha.com/v1/references",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.linqalpha.com/v1/references"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.linqalpha.com/v1/references")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linqalpha.com/v1/references")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"references": [
{
"id": "12",
"citation_idx": "12",
"search_type": "rms",
"chunk_id": "123e4567-e89b-12d3-a456-426614174000",
"text": "For fiscal year 2024, Tesla expects EBIT to grow between 15% and 20%...",
"text_type": "paragraph",
"document_id": "123e4567-e89b-12d3-a456-426614174000",
"document_name": "Tesla 10-K 2023",
"s3_file_key": "tesla/filings/2023/10k.pdf",
"external_url": "https://www.sec.gov/ix?doc=/Archives/edgar/data/1318605/000095017024002308/tsla-20231231.htm",
"metadata": {
"source": "filing",
"ticker": "TSLA",
"published_at": "2024-02-14"
},
"custom_metadata": null
}
]
}{
"error": {
"code": "CHAT_MESSAGE_ID_MISSING",
"msg": "chat_message_id is required",
"message": "chat_message_id is required"
},
"payload": null
}{
"error": {
"code": "API_KEY_MISSING",
"msg": "header does not contain api key",
"message": "header does not contain api key"
},
"payload": null
}{
"error": {
"code": "FORBIDDEN",
"message": "Access denied: insufficient permissions."
},
"payload": null
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
},
"payload": null
}{
"error": {
"code": "SERVER_ERROR",
"message": "An unexpected error occurred on the server."
},
"payload": null
}Was this page helpful?
⌘I