cURL
curl -X POST https://reygrid.com/api/v1/agents/{AgentId}/sources/qa \
-H "Authorization: Bearer $REYGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "Do you ship abroad?",
"answer": "Yes, we ship to 40 countries. Delivery takes 5 to 10 business days."
}'from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
client.add_qa_source(
"{AgentId}",
"Do you ship abroad?",
"Yes, we ship to 40 countries. Delivery takes 5 to 10 business days.",
)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
await client.addQaSource("{AgentId}", {
question: "Do you ship abroad?",
answer: "Yes, we ship to 40 countries. Delivery takes 5 to 10 business days.",
});{
"success": true,
"source": {
"id": "4c2e8b1a-9f7d-4a3e-b5c6-1d8e2f4a6b9c",
"type": "qa",
"title": "Do you ship abroad?"
}
}{
"success": false,
"error": {
"code": "INVALID_BODY",
"message": "Invalid body",
"list": {
"title": [
"Title too short"
]
}
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "PLAN_LIMIT_REACHED",
"message": "You need to upgrade your plan"
}
}{
"success": false,
"error": {
"code": "SOURCE_NOT_FOUND",
"message": "This source does not exist"
}
}Knowledge
Add a Q&A source
Adds a question and its exact answer to the agent’s knowledge.
POST
/
agents
/
{agentId}
/
sources
/
qa
cURL
curl -X POST https://reygrid.com/api/v1/agents/{AgentId}/sources/qa \
-H "Authorization: Bearer $REYGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "Do you ship abroad?",
"answer": "Yes, we ship to 40 countries. Delivery takes 5 to 10 business days."
}'from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
client.add_qa_source(
"{AgentId}",
"Do you ship abroad?",
"Yes, we ship to 40 countries. Delivery takes 5 to 10 business days.",
)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
await client.addQaSource("{AgentId}", {
question: "Do you ship abroad?",
answer: "Yes, we ship to 40 countries. Delivery takes 5 to 10 business days.",
});{
"success": true,
"source": {
"id": "4c2e8b1a-9f7d-4a3e-b5c6-1d8e2f4a6b9c",
"type": "qa",
"title": "Do you ship abroad?"
}
}{
"success": false,
"error": {
"code": "INVALID_BODY",
"message": "Invalid body",
"list": {
"title": [
"Title too short"
]
}
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "PLAN_LIMIT_REACHED",
"message": "You need to upgrade your plan"
}
}{
"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.
Body
application/json