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

# Import Question-Answer Pairs

> Learn how to effortlessly import question-answer pairs with the ChatFly API.

## API Endpoint

The API endpoint for obtaining a streaming response is:

<CodeGroup>
  ```text One theme={null}
  https://backend.chatfly.co/api/scraping/question-answer/{bot_id}
  ```

  ```text Many theme={null}
  https://backend.chatfly.co/api/scraping/question-answer/{bot_id}/many
  ```
</CodeGroup>

## Request Body

To import question-answer pairs, send a POST request to the API endpoint with a JSON request. Here's an example JSON request:

<CodeGroup>
  ```json Single Import theme={null}
  {
      "bot_id": "your_bot_id",
      "question": "string",
      "answer": "string"
  }
  ```

  ```json Bulk Import theme={null}
  {
    "bot_id": "your_bot_id",
    "question_answers": [
      {
        "question": "string",
        "answer": "string"
      },
      {
        "question": "string",
        "answer": "string"
      }
      // Add more Q-A pairs as needed
    ]
  }
  ```
</CodeGroup>

* bot\_id (string): ID of your bot.
* question (string): Question.
* answer (string): Answer.

## Example Request

Explore [here](/api-reference/endpoint/scraping/add-one-question-answer) for example commands to import a single Q-A pair and [here](/api-reference/endpoint/scraping/add-many-question-answer) for bulk import using the ChatFly API.

## Response Body

The streaming response is as follows:

<CodeGroup>
  ```json Single Import theme={null}
  {
      "id": "string",
      "bot_id": "string",
      "question": "string",
      "answer": "string",
      "num_token": "int",
      "created_at": "datetime"
  }
  ```

  ```json Bulk Import theme={null}
  [
      {
          "id": "string",
          "bot_id": "string",
          "question": "string",
          "answer": "string",
          "num_token": "int",
          "created_at": "datetime"
      }
      // Additional Q-A pairs
  ]
  ```
</CodeGroup>

* id (string): ID of each question-answer pair.
* bot\_id (string): ID of your bot.
* question (string): Question
* answer (string): Answer
* num\_token (int): Number of tokens consumed
