Add FAQ entries
curl --request POST \
--url https://api.inya.ai/platform/v1/agents/{botId}/faqs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"botId": "fb79920229d144608ebf665a10e50275",
"environment": "development",
"faq": [
{
"questions": [
"What are your business hours?",
"When are you open?"
],
"answer": "We are open Monday to Friday, 9am to 6pm IST.",
"language": "en-IN"
}
]
}
'import requests
url = "https://api.inya.ai/platform/v1/agents/{botId}/faqs"
payload = {
"botId": "fb79920229d144608ebf665a10e50275",
"environment": "development",
"faq": [
{
"questions": ["What are your business hours?", "When are you open?"],
"answer": "We are open Monday to Friday, 9am to 6pm IST.",
"language": "en-IN"
}
]
}
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({
botId: 'fb79920229d144608ebf665a10e50275',
environment: 'development',
faq: [
{
questions: ['What are your business hours?', 'When are you open?'],
answer: 'We are open Monday to Friday, 9am to 6pm IST.',
language: 'en-IN'
}
]
})
};
fetch('https://api.inya.ai/platform/v1/agents/{botId}/faqs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Successfully created 1 FAQ(s)",
"response": {
"createdCount": 1,
"faqIds": [
"faq_xyz001"
],
"totalFaqs": 1
}
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}Agent FAQ API
Add FAQ Entries
Add one or more FAQ entries to an agent’s knowledge base
POST
/
v1
/
agents
/
{botId}
/
faqs
Add FAQ entries
curl --request POST \
--url https://api.inya.ai/platform/v1/agents/{botId}/faqs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"botId": "fb79920229d144608ebf665a10e50275",
"environment": "development",
"faq": [
{
"questions": [
"What are your business hours?",
"When are you open?"
],
"answer": "We are open Monday to Friday, 9am to 6pm IST.",
"language": "en-IN"
}
]
}
'import requests
url = "https://api.inya.ai/platform/v1/agents/{botId}/faqs"
payload = {
"botId": "fb79920229d144608ebf665a10e50275",
"environment": "development",
"faq": [
{
"questions": ["What are your business hours?", "When are you open?"],
"answer": "We are open Monday to Friday, 9am to 6pm IST.",
"language": "en-IN"
}
]
}
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({
botId: 'fb79920229d144608ebf665a10e50275',
environment: 'development',
faq: [
{
questions: ['What are your business hours?', 'When are you open?'],
answer: 'We are open Monday to Friday, 9am to 6pm IST.',
language: 'en-IN'
}
]
})
};
fetch('https://api.inya.ai/platform/v1/agents/{botId}/faqs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Successfully created 1 FAQ(s)",
"response": {
"createdCount": 1,
"faqIds": [
"faq_xyz001"
],
"totalFaqs": 1
}
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}What it does: Add FAQ entries to a voice agent’s knowledge base so the agent can recognize caller questions and respond with predefined answers. A successful request automatically sets
404 Not Found - Agent not found
faqEnabled = true on the agent.
Required Permission
agents
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
botId | string | Yes | Unique agent identifier. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
botId | string | Yes | Must match the botId path parameter. |
environment | string | Yes | Target environment: development, staging, or production. |
faq | array | Yes | Array of FAQ entry objects to add. |
FAQ Entry Object
| Field | Type | Required | Description |
|---|---|---|---|
questions | string[] | Yes | One or more question phrasings that map to this answer. Maximum 10 questions per entry. |
answer | string | Yes | The answer the agent will speak when a matching question is detected. |
language | string | Yes | BCP-47 language code for this FAQ entry (e.g. en-IN, hi-IN). |
signal | string | No | Optional label used for downstream analytics or post-call triggers. |
Minimum working example
curl -X POST "https://api.inya.ai/platform/v1/agents/fb79920229d144608ebf665a10e50275/faqs" \
-H "x-api-key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"botId": "fb79920229d144608ebf665a10e50275",
"environment": "development",
"faq": [
{
"questions": [
"What are your business hours?",
"When are you open?",
"What time do you close?"
],
"answer": "We are open Monday to Friday, 9am to 6pm IST.",
"language": "en-IN"
},
{
"questions": [
"How do I cancel my subscription?",
"I want to cancel"
],
"answer": "To cancel your subscription, please visit our website or contact our billing team at billing@example.com.",
"language": "en-IN",
"signal": "CANCELLATION_INTENT"
}
]
}'
Response
Success (200)
{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Successfully created 2 FAQ(s)",
"response": {
"createdCount": 2,
"faqIds": ["faq_xyz001", "faq_xyz002"],
"totalFaqs": 5
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
createdCount | integer | Number of FAQ entries successfully created in this request. |
faqIds | string[] | Array of identifiers for the newly created FAQ entries. Store these to update or delete individual entries later. |
totalFaqs | integer | Total number of FAQ entries now stored for this agent in the specified environment. |
Errors
400 Bad Request - Validation error{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "FAQ limit reached. Each agent supports a maximum of 100 FAQ entries."
}
{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Agent not found"
}
Limits
| Limit | Value |
|---|---|
| Maximum FAQs per agent (per environment) | 100 |
| Maximum question phrasings per FAQ entry | 10 |
An agent can hold a maximum of 100 FAQ entries per environment. Attempting to add more will return HTTP 400. Use List FAQs to check the current count before adding new entries.
Add multiple question phrasings per entry (up to 10) to increase the likelihood of a match. For example, “What are your hours?”, “When do you open?”, and “Are you open on weekends?” can all map to the same answer.
Adding FAQ entries automatically enables FAQ matching on the agent (
faqEnabled = true). To disable FAQ matching without deleting entries, update the agent with faqEnabled: false via Update Agent.Save the
requestId from every response. You will need it if you contact Gnani support to trace a specific request.Authorizations
API key with 'agents' permission
Path Parameters
Unique identifier of the agent
Body
application/json
Was this page helpful?