/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Retrain the AI

Retrain the AI

Rebuild the AI assistant's knowledge index from the latest deployed docs.

POST/v1/projects/{projectId}/ai/retrainTry it
Session token

Rebuilds the AI assistant's knowledge index. Every page from your latest deployed docs is re-read, so answers immediately reflect current content.

Note

Retraining happens automatically on every deploy — you normally never need this endpoint. Use it only to force a rebuild (e.g. after a partial index or unexpected answer quality issues).

Note

Session JWT and org membership required (any role). API keys get 401.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.

Response

Returns 202 Accepted — retraining runs in the background.

Errors

StatusCodeMeaning
409already_runningA retrain is already in progress for this project.
400no_deployed_buildNo deployed build with source available — deploy your docs first. For a project deployed with stx deploy, only the newest production upload counts: preview uploads are never used to retrain.

Poll Retrain Status

GET/v1/projects/{projectId}/ai/retrain
bash
curl "https://api.syntext.dev/v1/projects/$PROJECT_ID/ai/retrain" \
-H "Authorization: Bearer $SYNTEXT_JWT"

Response

pageCount is how many pages were read; chunkCount is how many sections of them the assistant can answer from.

status is one of idle, running, completed, or failed (failures include an error message).

Was this page helpful? Yes No
Request
bashJavaScriptPythonGoRubyPHPJavaC#bash
curl -X POST "https://api.syntext.dev/v1/projects/$PROJECT_ID/ai/retrain" \
-H "Authorization: Bearer $SYNTEXT_JWT"
Responseapplication/json
json
{
"data": {
"status": "running",
"startedAt": "2025-01-15T10:30:00.000Z"
}
}
Responseapplication/json
json
{
"data": {
"status": "completed",
"startedAt": "2025-01-15T10:30:00.000Z",
"finishedAt": "2025-01-15T10:30:42.000Z",
"pageCount": 38,
"chunkCount": 214
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext