Rest API
Ingest a training data source
POST /api/v1/ai/training/data
Create a new training data source, or update an existing one by passing its trainingDataId. Creating a source of type url starts a website ingestion: Unless crawls the site and trains the AI on its content.
Use cases
- Ingest a website: Create a
urlsource pointing at the website you want the AI to learn from - Rescan: Update an existing source to change its URL filters or schedule and trigger a retrain
Notes
- Omit
trainingData.trainingDataIdto create a new source, pass it to update that source trainingData.accountIdandtrainingData.websiteIdmust match thex-account-idandx-website-idheaders- For website ingestion use
type: urlwithmethodset toall(crawl the whole site),single(one page) orsitemap - Ingestion runs asynchronously, poll the get training data endpoint to follow progress
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Your API key from account settings.
The email address of your user.
The ID of your account. You can find this in the account settings.
The ID of the workspace you want to use.
Request Body required
Section titled “Request Body required ”object
object
ID of an existing source to update. Omit to create a new source.
Must match the x-account-id header.
Must match the x-website-id header.
Kind of source. Use url for website ingestion, other values include faq, pdf, docx, md and csv.
How to crawl a url source. all follows links from the entry point, single ingests one page, sitemap reads the sitemap.
Entry point URL for a url source.
Display name of the source.
Whether content from this source may be shown to anonymous visitors.
Path prefixes to include while crawling.
Path prefixes to exclude while crawling.
How often the source is rescanned.
Skip retraining after saving, only store the source configuration.
Responses
Section titled “ Responses ”The source was saved and ingestion was started.
object
Example
{ "message": "Training data upserted"}Unauthorized - invalid API key.