Training Items
Learn how to train your AI with the Support AI training items API endpoints.
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
idintegerUnique identifier for the training item.
sourcestringThe source of the training item.
typestringThe type of training item. (URL, File, Text, etc.)
datestringThe date which the training item was created.
contentstringFor text type training items, this will contain the training text.
GET /listLinks/:chatbot_id
List all links
Get the list of all training links of a specific chatbot.
Required attributes
chatbot_idstringThe Chatbot ID that you want to get the training links for.
Request
GET /listLinks/:chatbot_id
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"
}
...
]
}
POST /addLink/:chatbot_id
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
chatbot_idstringThe Chatbot ID that you want to get the training links for.
Request
POST /addLink/:chatbot_id
curl https://api.supportai.com/addLink/:chatbot_id \
-H "Authorization: Bearer IDZFdfiD..."
Response
{
"success": true,
"id": 123456
}
POST /addLinks/:chatbot_id
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
chatbot_idstringThe Chatbot ID that you want to get the training links for.
linksstringAn array of the links you want to get trained.
Request
POST /addLinks/:chatbot_id
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
}
POST /updateLink/:chatbot_id
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
chatbot_idstringThe Chatbot ID that you want to get the training links for.
link or idstringThe link url or the ID of the training item.
Request
POST /updateLink/:chatbot_id
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
}
GET /listTexts/:chatbot_id
List all texts
Get the list of all training texts of a specific chatbot of your account.
Required attributes
chatbot_idstringThe Chatbot ID that you want to get the training texts for.
Request
GET /listTexts/:chatbot_id
curl -G https://api.supportai.com/listTexts/:chatbot_id \
-H "Authorization: Bearer IDZFdfiD..." \
button: Copy Copied!
Response
{
"success": true,
"data": [
{
"id": 123456,
"content": "Hello world...",
"type": "text",
"date": "2023-12-22T16:01:26"
}
...
]
}
POST /addText/:chatbot_id
Add text
Add a new training text to a specific chatbot of your account.
Required attributes
chatbot_idstringThe Chatbot ID that you want to get the training links for.
textstringThe text you want to add to be trained.
Request
POST /addText/:chatbot_id
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
}
GET /listFiles/:chatbot_id
List all files
Get the list of all training files of a specific chatbot of your account.
Required attributes
chatbot_idstringThe Chatbot ID that you want to get the training texts for.
Request
GET /listFiles/:chatbot_id
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"
}
...
]
}
POST /deleteItem/:chatbot_id
Delete training item
Training items include links, texts, and files. You can delete any training item using this endpoint.
Required attributes
chatbot_idstringThe Chatbot ID that you want to get the training links for.
idstringThe ID of the training item that you want to delete.
Request
POST /deleteItem/:chatbot_id
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
}

