ai-search

3 endpoints.

GET/api/ai-search/index/tick Bearer token

Tick the AI search index (cron)

Called hourly by the deployment's cron (`vercel.json`). Resumes a run a previous tick left unfinished; otherwise starts an incremental pass over the sources changed since the last completed run, within one invocation's time budget. Answers `disabled` while no embedding provider is configured. Authenticated by the deployment's `CRON_SECRET` as a bearer token, not by an OIDC access token.

Responses

StatusDescriptionBody
200What the tick did.SearchIndexTickResult
401The cron secret is missing or wrong.ErrorResponse
500The tick failed part-way; the next tick resumes the run.ErrorResponse
POST/api/ai-search/index/run Bearer token

Index now, or rebuild the index

Starts an indexing run outside the schedule and processes as much of it as one invocation's time budget allows; a larger index is finished by the hourly tick. `incremental` (the default) embeds the sources changed since the last completed run; `full` walks every source — what to do after switching embedding model, since it also drops the previous model's chunks. An unfinished earlier run is resumed instead of starting another, and while another invocation is still working on one the answer is `busy` with nothing started. Superusers only.

Request body

application/jsonoptionalStartSearchIndexRunRequest
FieldTypeRequiredDescription
modestringno

`incremental` (the default) or `full`.

one of "incremental" | "full" · defaults to "incremental"

Responses

StatusDescriptionBody
200The run, with how far it got.SearchIndexTickResult
400The mode is not `incremental` or `full`.ErrorResponse
401The access token is missing or invalid.ErrorResponse
403The caller is not a superuser.ErrorResponse
500The run failed part-way; the next tick resumes it.ErrorResponse