cURL
curl https://api.aiql.io/queries/qry_5e7f/sources \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "AiQL-Workspace: $AIQL_WORKSPACE_ID"import os
from aiql import AiQL
client = AiQL(api_key=os.environ["AIQL_API_KEY"])
sources = client.queries.sources("qry_5e7f")import { AiQL } from "@aiql.io/sdk";
const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });
const sources = await client.queries.sources("qry_5e7f");[
{
"id": "<string>",
"reference_count": 123,
"documentId": "<string>",
"filename": "<string>",
"title": "<string>",
"summary": "<string>",
"metadata": {},
"url": "",
"page": 123,
"chunkId": "<string>",
"snippet": "<string>",
"cited": false
}
]{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Queries
Get Query Sources
GET
/
queries
/
{id}
/
sources
cURL
curl https://api.aiql.io/queries/qry_5e7f/sources \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "AiQL-Workspace: $AIQL_WORKSPACE_ID"import os
from aiql import AiQL
client = AiQL(api_key=os.environ["AIQL_API_KEY"])
sources = client.queries.sources("qry_5e7f")import { AiQL } from "@aiql.io/sdk";
const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });
const sources = await client.queries.sources("qry_5e7f");[
{
"id": "<string>",
"reference_count": 123,
"documentId": "<string>",
"filename": "<string>",
"title": "<string>",
"summary": "<string>",
"metadata": {},
"url": "",
"page": 123,
"chunkId": "<string>",
"snippet": "<string>",
"cited": false
}
]{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API key or UI session JWT passed as a Bearer token.
Headers
ID of the workspace the request operates on.
Path Parameters
Response
Successful Response
Unique identifier of the referenced source document.
Number of times the source was referenced in the query's output.
Document id, same as id when present.
Original filename of the source, if available.
Title of the source, if available.
Summary of the source, if available.
Additional metadata of the source, if available.
URL to preview the source.
1-based page number when known.
Chunk id when known.
Retrieved passage snippet.
True when the assistant answer cited this source.