Bulk import FAQ entries
curl --request POST \
--url https://api.inya.ai/platform/v1/agents/{botId}/faqs/import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"botId": "fb79920229d144608ebf665a10e50275",
"faq": [
{
"questions": [
"<string>"
],
"answer": "<string>",
"language": "en-IN",
"signal": "<string>"
}
]
}
'import requests
url = "https://api.inya.ai/platform/v1/agents/{botId}/faqs/import"
payload = {
"botId": "fb79920229d144608ebf665a10e50275",
"faq": [
{
"questions": ["<string>"],
"answer": "<string>",
"language": "en-IN",
"signal": "<string>"
}
]
}
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',
faq: [
{
questions: ['<string>'],
answer: '<string>',
language: 'en-IN',
signal: '<string>'
}
]
})
};
fetch('https://api.inya.ai/platform/v1/agents/{botId}/faqs/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "FAQs imported successfully",
"response": {
"importedCount": 1,
"totalFaqs": 1,
"trimmed": false,
"trimWarning": null,
"faqIds": [
"faq_xyz001"
]
}
}{
"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
Bulk Import FAQs
Bulk-import FAQ entries into an agent from a JSON payload
POST
/
v1
/
agents
/
{botId}
/
faqs
/
import
Bulk import FAQ entries
curl --request POST \
--url https://api.inya.ai/platform/v1/agents/{botId}/faqs/import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"botId": "fb79920229d144608ebf665a10e50275",
"faq": [
{
"questions": [
"<string>"
],
"answer": "<string>",
"language": "en-IN",
"signal": "<string>"
}
]
}
'import requests
url = "https://api.inya.ai/platform/v1/agents/{botId}/faqs/import"
payload = {
"botId": "fb79920229d144608ebf665a10e50275",
"faq": [
{
"questions": ["<string>"],
"answer": "<string>",
"language": "en-IN",
"signal": "<string>"
}
]
}
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',
faq: [
{
questions: ['<string>'],
answer: '<string>',
language: 'en-IN',
signal: '<string>'
}
]
})
};
fetch('https://api.inya.ai/platform/v1/agents/{botId}/faqs/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "FAQs imported successfully",
"response": {
"importedCount": 1,
"totalFaqs": 1,
"trimmed": false,
"trimWarning": null,
"faqIds": [
"faq_xyz001"
]
}
}{
"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: Import multiple FAQ entries into an agent in a single request. A successful import automatically sets
404 Not Found - Agent not found
faqEnabled = true on the agent. Entries exceeding the 100-FAQ limit are automatically trimmed — check the trimmed field in the response.
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 import. |
FAQ Entry Object
| Field | Type | Required | Description |
|---|---|---|---|
questions | string[] | Yes | Question phrasings. Maximum 10 per entry (extras are silently trimmed). |
answer | string | Yes | The spoken answer when a match is detected. |
language | string | Yes | BCP-47 language code (e.g. en-IN). |
signal | string | No | Optional analytics label. |
Import Limits
| Limit | Behaviour |
|---|---|
| Max 100 FAQs per agent per environment | Entries beyond 100 are auto-trimmed. Response includes trimmed: true and trimWarning. |
| Max 10 question phrasings per entry | Entries with more than 10 questions are silently trimmed to 10. |
Minimum working example
curl -X POST "https://api.inya.ai/platform/v1/agents/fb79920229d144608ebf665a10e50275/faqs/import" \
-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?"],
"answer": "We are open Monday to Friday, 9am to 6pm IST.",
"language": "en-IN"
},
{
"questions": ["How do I cancel my subscription?"],
"answer": "To cancel, visit our website or contact billing@example.com.",
"language": "en-IN",
"signal": "CANCELLATION_INTENT"
}
]
}'
Response
Success (200)
{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "FAQs imported successfully",
"response": {
"importedCount": 2,
"totalFaqs": 2,
"trimmed": false,
"trimWarning": null,
"faqIds": ["faq_xyz001", "faq_xyz002"]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
importedCount | integer | Number of FAQ entries successfully imported. |
totalFaqs | integer | Total FAQs now stored for this agent in the specified environment. |
trimmed | boolean | true if some entries were removed because the 100-entry limit was reached. |
trimWarning | string | Description of the trim applied. null when no trimming occurred. |
faqIds | string[] | Identifiers for all imported FAQ entries. |
Errors
400 Bad Request{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "FAQ import failed. Invalid data format."
}
{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Agent not found"
}
Use Cases
- Loading a large FAQ dataset into an agent at once
- Migrating FAQ content from another system or CMS
- Replacing an entire FAQ knowledge base after a content review
Always check the
trimmed and importedCount fields in the response. Entries beyond the 100-FAQ limit are silently removed — you will not receive an error, only the warning in the response body.Get a sample payload using the GET FAQ Sample endpoint to ensure your JSON is correctly structured before a large import.
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?