cURL
curl "https://reygrid.com/api/v1/agents/{AgentId}/sources?type=text&search=refund&size=20" \
-H "Authorization: Bearer $REYGRID_API_KEY"from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
res = client.list_sources("{AgentId}", type="text", search="refund")
for source in res.sources:
print(source.id, source.title)
# Or every source, page by page
for page in client.paginate_sources("{AgentId}"):
for source in page.data:
print(source.type, source.title)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
const { sources } = await client.listSources("{AgentId}", { type: "text", search: "refund" });
// Or every source, page by page
const all = await client.paginateSources("{AgentId}").all();{
"success": true,
"sources": [
{
"id": "b7a1e2c4-5d3f-4e8a-9b10-2c4d6e8f0a1b",
"type": "text",
"title": "Refund policy",
"content": "Orders can be refunded within 30 days of delivery.",
"createdAt": "2026-10-04T09:12:00.000Z"
},
{
"id": "661a6da1-181f-43ac-9516-9847b9dd663b",
"type": "file",
"title": "handbook.pdf",
"size": 482113,
"createdAt": "2026-10-02T15:40:21.000Z"
},
{
"id": "0f3c9a7e-2b1d-4c6e-8a5f-7d9b1e3c5a7f",
"type": "website",
"title": "docs.example.com/pricing",
"createdAt": "2026-09-30T11:05:44.000Z"
}
],
"pagination": {
"totalSources": 92,
"totalPages": 31,
"currentPage": 1,
"pagingCounter": 1,
"hasNextPage": true
}
}{
"success": false,
"error": {
"code": "INVALID_BODY",
"message": "Invalid body",
"list": {
"title": [
"Title too short"
]
}
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "SOURCE_NOT_FOUND",
"message": "This source does not exist"
}
}Knowledge
List knowledge sources
Returns the agent’s knowledge sources, newest first.
GET
/
agents
/
{agentId}
/
sources
cURL
curl "https://reygrid.com/api/v1/agents/{AgentId}/sources?type=text&search=refund&size=20" \
-H "Authorization: Bearer $REYGRID_API_KEY"from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
res = client.list_sources("{AgentId}", type="text", search="refund")
for source in res.sources:
print(source.id, source.title)
# Or every source, page by page
for page in client.paginate_sources("{AgentId}"):
for source in page.data:
print(source.type, source.title)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
const { sources } = await client.listSources("{AgentId}", { type: "text", search: "refund" });
// Or every source, page by page
const all = await client.paginateSources("{AgentId}").all();{
"success": true,
"sources": [
{
"id": "b7a1e2c4-5d3f-4e8a-9b10-2c4d6e8f0a1b",
"type": "text",
"title": "Refund policy",
"content": "Orders can be refunded within 30 days of delivery.",
"createdAt": "2026-10-04T09:12:00.000Z"
},
{
"id": "661a6da1-181f-43ac-9516-9847b9dd663b",
"type": "file",
"title": "handbook.pdf",
"size": 482113,
"createdAt": "2026-10-02T15:40:21.000Z"
},
{
"id": "0f3c9a7e-2b1d-4c6e-8a5f-7d9b1e3c5a7f",
"type": "website",
"title": "docs.example.com/pricing",
"createdAt": "2026-09-30T11:05:44.000Z"
}
],
"pagination": {
"totalSources": 92,
"totalPages": 31,
"currentPage": 1,
"pagingCounter": 1,
"hasNextPage": true
}
}{
"success": false,
"error": {
"code": "INVALID_BODY",
"message": "Invalid body",
"list": {
"title": [
"Title too short"
]
}
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "SOURCE_NOT_FOUND",
"message": "This source does not exist"
}
}Authorizations
ReyGrid API key sent as a Bearer token.
Path Parameters
The ID of the agent.
Query Parameters
Only return sources of this type.
Available options:
text, qa, file, website Filter by title or file name (case-insensitive).
Maximum string length:
100Page number.
Required range:
x >= 1Number of items per page.
Required range:
1 <= x <= 100