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

# Create Knowledge Base (FAQ Mode)

> Creates a knowledge base from question/answer pairs — the FAQ Mode tab in the application.

Knowledge bases can be created in three ways, matching the tabs in the application:

<Tabs>
  <Tab title="FAQ Mode">
    Add question/answer pairs manually or upload a CSV with `Questions` and `Answers` columns, then call <code>POST /knowledgeBase/create</code> (this endpoint).
  </Tab>

  <Tab title="Document Upload">
    Upload a PDF, DOC, DOCX, ODT or MD file (max 30MB) via <code>POST /knowledgeBase/upload-embed</code>. The document is chunked and embedded directly — no FAQ conversion.
  </Tab>

  <Tab title="Website Scrape">
    Provide page URLs (optionally discovered from a sitemap via <code>POST /knowledgeBase/list-sitemap</code>) and call <code>POST /knowledgeBase/embed-urls</code>.
  </Tab>
</Tabs>

Embeddings are built in the background after creation. Poll `GET /knowledgeBase/build-status` until the build is `ready`.


## OpenAPI

````yaml POST /knowledgeBase/create
openapi: 3.0.1
info:
  title: QCall Ai API
  description: >-
    A sample API that uses a campaign store as an example to demonstrate
    features in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.qcall.ai/api/v1
security:
  - apiKeyAuth: []
paths:
  /knowledgeBase/create:
    post:
      description: >-
        Creates a new knowledge base from FAQs (the **FAQ Mode** tab in the
        application). Send a title, a language code and a list of
        question/answer pairs — added manually or parsed from a CSV with
        `Questions` and `Answers` columns. Embeddings are built in the
        background; poll `GET /knowledgeBase/build-status` to track progress.
        For the **Document Upload** flow use `POST /knowledgeBase/upload-embed`,
        and for the **Website Scrape** flow use `POST
        /knowledgeBase/embed-urls`.
      requestBody:
        description: Knowledge base to create (FAQ Mode)
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewKnowledgeBase'
        required: true
      responses:
        '200':
          description: Knowledge base created; embedding is building in the background
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Whether the request succeeded
                  message:
                    type: string
                    description: Response message
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewKnowledgeBase:
      required:
        - title
        - language
        - data
      type: object
      properties:
        title:
          description: The title of the knowledge base
          type: string
        language:
          description: Language code (e.g. `en`)
          type: string
        data:
          description: The question/answer pairs of the knowledge base
          type: array
          items:
            $ref: '#/components/schemas/QuestionAnswer'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    QuestionAnswer:
      required:
        - question
        - answer
      type: object
      properties:
        question:
          description: The question
          type: string
        answer:
          description: The answer to the question
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header

````