AI Chatbot Hub
HomepageAPI docsDiscordLog inSign up
API docs
API docs
  • API usage guides
    • Getting an API key
    • Create a chatbot
    • Chat with chatbot
    • Uploading data sources
  • Chatbots
    • Chatbot properties
    • Create chatbot
    • Update chatbot
    • Fetch a chatbot
    • Fetch all chatbots
    • Delete chatbot
  • Agents
    • Agent properties
    • Create agent
    • Update agent
    • Fetch all agents
    • Delete agent
  • Chatbot sessions
    • Session properties
    • Create session
    • Fetch a session
    • Fetch all sessions
    • Delete session
  • Session messages
    • Message properties
    • Create message
    • Fetch all messages
    • Delete message
    • Delete multiple messages
  • Data sources
    • Source properties
    • Upload a file
    • Create QA source
    • Create URL source
    • Update source
    • Fetch list of sources
    • Retrain sources
    • Delete source
    • Delete multiple sources
  • Data source tags
    • Create source tag
    • Fetch all source tags
    • Update source tag
    • Delete source tag
Powered by GitBook
On this page
  • Endpoint
  • Authorization
  • Path
  • ​Body
  • Request example
  • ​Response
  • Response example
  1. Data sources

Create QA source

Create a QA source for a chatbot specified by chatbot uuid

PreviousUpload a fileNextCreate URL source

Last updated 6 months ago

Endpoint

POST / api / v1 / chatbot / {uuid} / data-source / qa

Authorization

Authorization string Bearer <your_token>

Path

uuid string required

Body

question string required

answer string required

reference_source_link string

Request example

curl --location --request POST 'https://app.aichatbothub.com/api/v1/chatbot/{uuid}/data-source/qa' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "question": "string",
  "answer": "string"
}'
import requests

uuid = '<chatbot-uuid>'
url = f'https://app.aichatbothub.com/api/v1/chatbot/{uuid}/data-source/qa'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <token>'
}

data = {
    "question": "string",
    "answer": "string"
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Request successful!")
    print(response.json())
else:
    print("Request failed with status code:", response.status_code)
    print(response.text)
const axios = require("axios");

const uuid = "<chatbot-uuid>";
const url = `https://app.aichatbothub.com/api/v1/chatbot/${uuid}/data-source/qa`;
const headers = {
  "Content-Type": "application/json",
  Authorization: "Bearer <token>",
};

const data = {
  question: "string",
  answer: "string",
};

axios
  .post(url, data, { headers })
  .then((response) => {
    console.log("Request successful!");
    console.log(response.data);
  })
  .catch((error) => {
    console.error("Request failed:", error);
  });

created_at string

file_name string

file_size number

meta_json string

modified_at string

status string

title string

type string

tokens number

uuid string

Response example

{
  "created_at": "string",
  "file_name": "string",
  "file_size": 0,
  "meta_json": "string",
  "modified_at": "string",
  "status": "string",
  "title": "string",
  "tokens": 0,
  "type": "string",
  "uuid": "string"
}

Response

​
​