Training Items
Your training items are at the heart of a good AI chatbot. Leverage the training items API to keep your AI chatbot informed of the latest information about your business.
Properties
- Name
id
- Type
- integer
- Description
Unique identifier for the training item.
- Name
source
- Type
- string
- Description
The source of the training item.
- Name
type
- Type
- string
- Description
The type of training item. (URL, File, Text, etc.)
- Name
date
- Type
- string
- Description
The date which the training item was created.
- Name
content
- Type
- string
- Description
For text type training items, this will contain the training text.
List all links
Get the list of all training links of a specific chatbot.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training links for.
Request
curl -G https://api.supportai.com/listLinks/:chatbot_id \
-H "Authorization: Bearer IDZFdfiD..." \
Response
{
"success": true,
"data": [
{
"id": 123456,
"source": "https://...",
"type": "url",
"date": "2023-12-22T16:01:26"
}
...
]
}
Add link
Add a new training link to a specific chatbot of your account. The advantage of using this request over adding multiple links is that you will get the document ID in the response.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training links for.
Request
curl https://api.supportai.com/addLink/:chatbot_id \
-H "Authorization: Bearer IDZFdfiD..."
Response
{
"success": true,
"id": 123456
}
Add multiple links
Add new training links to a specific chatbot of your account. Send the links as a JSON string in the request body.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training links for.
- Name
links
- Type
- string
- Description
An array of the links you want to get trained.
Request
curl --request POST \
--url https://api.supportai.com/addLinks/:chatbot_id \
--header 'Authorization: Bearer IDZFdfiD...' \
--header 'Content-Type: application/json' \
--data '{"links":["https://...","https://...",...]}'
Response
{
"success": true
}
Update a link
Update a training link of a specific chatbot of your account. You can either update a link using a URL or a link ID (received when adding a new link).
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training links for.
- Name
link or id
- Type
- string
- Description
The link url or the ID of the training item.
Request
curl --request POST \
--url https://api.supportai.com/updateLink/:chatbot_id \
--header 'Authorization: Bearer IDZFdfiD...' \
--header 'Content-Type: application/json' \
--data '{"link":"https://..."}' or '{"id":123456}'
Response
{
"success": true,
"id": 123456
}
List all texts
Get the list of all training texts of a specific chatbot of your account.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training texts for.
Request
curl -G https://api.supportai.com/listTexts/:chatbot_id \
-H "Authorization: Bearer IDZFdfiD..." \
Response
{
"success": true,
"data": [
{
"id": 123456,
"content": "Hello world...",
"type": "text",
"date": "2023-12-22T16:01:26"
}
...
]
}
Add text
Add a new training text to a specific chatbot of your account.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training links for.
- Name
text
- Type
- string
- Description
The text you want to add to be trained.
Request
curl --request POST \
--url https://api.supportai.com/addText/:chatbot_id \
--header 'Authorization: Bearer IDZFdfiD...' \
--header 'Content-Type: application/json' \
--data '{"text":"Hello world"}'
Response
{
"success": true,
"id": 123456
}
List all files
Get the list of all training files of a specific chatbot of your account.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training texts for.
Request
curl -G https://api.supportai.com/listFiles/:chatbot_id \
-H "Authorization: Bearer IDZFdfiD..." \
Response
{
"success": true,
"data": [
{
"id": 123456,
"source": "hello_world.pdf",
"type": "file",
"date": "2023-12-22T16:01:26"
}
...
]
}
Delete training item
Training items include links, texts, and files. You can delete any training item using this endpoint.
Required attributes
- Name
chatbot_id
- Type
- string
- Description
The Chatbot ID that you want to get the training links for.
- Name
id
- Type
- string
- Description
The ID of the training item that you want to delete.
Request
curl --request POST \
--url https://api.supportai.com/deleteItem/:chatbot_id \
--header 'Authorization: Bearer IDZFdfiD...' \
--header 'Content-Type: application/json' \
--data '{"id":123456}'
Response
{
"success": true
}