> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gnani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add FAQ Entries

> Add one or more FAQ entries to an agent's knowledge base

## Overview

Add FAQ (Frequently Asked Question) entries to a voice agent's knowledge base. During a conversation, the agent uses these entries to recognize caller questions and respond with accurate, predefined answers — reducing reliance on the LLM for common queries.

A successful request automatically sets `faqEnabled = true` on the agent, enabling FAQ matching for all future conversations.

## 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.                     |

## Example cURL

```bash theme={null}
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)

```json theme={null}
{
  "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.                               |

### Error Responses

**400 Bad Request** - Validation error

```json theme={null}
{
  "status": "failure",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "FAQ limit reached. Each agent supports a maximum of 100 FAQ entries."
}
```

**404 Not Found** - Agent does not exist

```json theme={null}
{
  "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    |

<Note>
  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.
</Note>

<Tip>
  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.
</Tip>

<Info>
  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**.
</Info>

<Note>
  Save the `requestId` from every response. You will need it if you contact Inya support to trace a specific request.
</Note>


## OpenAPI

````yaml POST /v1/agents/{botId}/faqs
openapi: 3.0.3
info:
  title: Platform Agents API
  description: API endpoints for creating, managing, and interacting with voice agents
  version: 2.1.0
servers:
  - url: https://api.inya.ai/platform
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management operations
  - name: AgentFAQ
    description: Agent FAQ management
  - name: AgentCallTriggers
    description: Outbound call triggers
  - name: ChatSDK
    description: Chat Widget configuration
  - name: Conversations
    description: Conversation logs, statistics, and audio
paths:
  /v1/agents/{botId}/faqs:
    post:
      tags:
        - AgentFAQ
      summary: Add FAQ entries
      description: >-
        Add one or more FAQ entries to an agent. A successful request
        automatically sets faqEnabled = true on the agent.
      operationId: addFaqs
      parameters:
        - $ref: '#/components/parameters/AgentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddFaqRequest'
            examples:
              addFaq:
                value:
                  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
      responses:
        '200':
          description: FAQs added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardResponse'
              examples:
                success:
                  value:
                    status: success
                    requestId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    message: Successfully created 1 FAQ(s)
                    response:
                      createdCount: 1
                      faqIds:
                        - faq_xyz001
                      totalFaqs: 1
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    AgentId:
      name: botId
      in: path
      required: true
      description: Unique identifier of the agent
      schema:
        type: string
  schemas:
    AddFaqRequest:
      type: object
      required:
        - botId
        - environment
        - faq
      properties:
        botId:
          type: string
          example: fb79920229d144608ebf665a10e50275
        environment:
          type: string
          enum:
            - development
            - staging
            - production
        faq:
          type: array
          items:
            type: object
            required:
              - questions
              - answer
              - language
            properties:
              questions:
                type: array
                items:
                  type: string
                maxItems: 10
              answer:
                type: string
              language:
                type: string
                example: en-IN
              signal:
                type: string
    StandardResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
        response:
          type: object
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        requestId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        message:
          type: string
  responses:
    BadRequest:
      description: Validation error or malformed request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key with 'agents' permission

````