Skip to content

Retrain an existing chatbot

post/retrain-chatbot
Any key

The Chatbot Retrain API enables you to retrain an existing chatbot. This API is applicable for chatbots with the custom-data-upload model. It allows you to update the chatbot's knowledge base with new information or remove existing data.

You can provide new training data through various methods:

  • Text data via sourceText
  • URLs to scrape via urlsToScrape
  • Product information via products
  • Q&A pairs via qAndAs

You can also remove specific knowledge chunks using the deletes array.

Note: The amount of new data you can add is subject to character limits based on your plan.

Request body

Sending 1 of 7 fields
Required
chatbotIdstring
The unique identifier allocated to the chatbot.

Only these fields are sent (application/json).

Try it · POST /retrain-chatbot
curl 'https://api.chat-data.com/api/v2/retrain-chatbot' \  -H "Authorization: Bearer $CHAT_DATA_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "chatbotId": "6650f1c2a9e4b83d2c7a1f05"}'
Loading…

Responses

The new data was accepted. Training runs in the background; poll GET /chatbot/status/{chatbotId} for progress.

Content type: application/json

FieldDescription
chatbotIdstringThe unique identifier allocated to the chatbot. Use this ID in API calls about this chatbot.
consumedCharactersnumberThe number of training characters charged by this call. Websites are not counted here; they are charged when they are crawled.
remainingCharactersnumberThe number of training characters that remain available in your account. As long as the balance is positive, even by a single character, a training run proceeds and is limited only by the per-chatbot training character limit.
dataSourcesarray of objectAll data sources of the chatbot after this call. Newly added websites show 0 characters until they have been crawled. In the retrain-chatbot response, Q&A sources are listed with their question, answer and folder instead of a character count.
dataSources[].namestringThe name of the document, the product ID or the URL of the website. Absent for plain text and Q&As.
dataSources[].charactersnumberThe total number of characters in this data source.
dataSources[].questionstringThe question of a q&a source. Only in the retrain-chatbot response.
dataSources[].answerstringThe answer of a q&a source. Only in the retrain-chatbot response.
dataSources[].folderstringThe folder of a q&a source, when it has one. Only in the retrain-chatbot response.
dataSources[].typestringThe type of the data source (for example website, text, product or q&a).
statusstringOne of: success.

Example

{  "chatbotId": "6650f1c2a9e4b83d2c7a1f05",  "consumedCharacters": 156,  "remainingCharacters": 999844,  "dataSources": [    {      "characters": 156,      "type": "text"    },    {      "name": "https://www.example.com/help/shipping",      "characters": 0,      "type": "website"    }  ],  "status": "success"}

Last updated October 14, 2026