Reindex a failed context source
/v1/context-sources/{slug}/reindexReindex a failed context source.
Retries indexing of a source in status FAILED (its status_detail says why it failed), optionally with another virtual key or model, checked as at upload. The source goes back to PENDING; sections already summarised keep their summaries, so only the rest are written and paid for. Recorded in the audit log.
Requires an organization admin key, or a workspace admin key for the source's workspace, and a plan that includes context sources (402 otherwise). Returns 409 when the source is not FAILED, 400 for an unusable key or model, 404 when the source does not exist.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Path parameters
slugstringrequiredThe source's identifier (
ctx-...).
Query parameters
organizationstringrequiredThe organization's identifier (slug).
Request body application/json
Optional: another key or model to index with.
index_virtual_keystringA virtual key (
vk-...) of the source's workspace to pay for the summaries from now on. Absent keeps the current one.At least 0 characters · At most 100 characters
index_modelstringThe model to write the summaries from now on; it must be one the key may use. Absent keeps the current one.
At least 0 characters · At most 200 characters
Responses
slugstringThe source's identifier (
ctx-...).organizationstringThe organization's identifier (slug).
workspace_idstring<uuid>The workspace the source belongs to (UUID).
namestringThe name given at upload.
formatenum<string>MARKDOWN,HTMLorPDF.One of
"MARKDOWN","HTML","PDF"filenamestringThe uploaded file's name.
size_bytesinteger<int64>Size of the uploaded file in bytes.
page_countinteger<int32>Number of pages (PDF only).
statusenum<string>PENDING,INDEXING,READY,QUARANTINEDorFAILED.One of
"PENDING","INDEXING","READY","QUARANTINED","FAILED"status_detailstringWhy the source is quarantined or failed; absent otherwise.
scan_findingsobject[]What the upload scan found (quarantined sources). Never the matched text.
Child attributes
check_typestringThe check that fired:
tool_output_injection(instructions aimed at a model) orsecrets_present(keys, tokens).descriptionstringWhat the check reported, without the matched text.
section_idstringThe section where it was found.
index_virtual_keystringThe virtual key that pays for this source's section summaries.
index_modelstringThe model that writes this source's section summaries, called on
index_virtual_key.index_attemptsinteger<int32>Failed indexing attempts since the last success. While the source is
PENDINGafter a temporary failure (a rate limit, a provider outage) it is retried with a growing delay; after too many it becomesFAILED.expires_atstring<date-time>When the source is deleted automatically (its retention), as an ISO 8601 timestamp. Absent: kept until deleted.
section_countinteger<int32>Number of sections (groups not counted).
token_countinteger<int32>Approximate size of the whole document's text in tokens.
summarystringOne sentence on what the document is; absent until indexed.
summary_edited_bystringWho replaced the generated one-sentence summary with their own; absent when it is the generated one.
summary_edited_atstring<date-time>When the source's summary was edited.
sectionsobject[]The outline (every section and group, in reading order). Returned when getting one source, not in lists.
Child attributes
section_idstringThe section's id within the source (
n12, org3for a group).parent_idstringThe id of the section or group this one sits under; absent at the top level.
kindenum<string>SECTIONorGROUP.One of
"SECTION","GROUP"depthinteger<int32>Nesting depth, 0 at the top level.
titlestringThe section's heading (several headings joined with " / " when short sections were merged).
summarystringA short summary of what the section contains; absent until the source is indexed, and for groups.
summary_edited_bystringWho replaced the generated summary with their own; absent when the summary is the generated one.
summary_edited_atstring<date-time>When the summary was edited. Reindexing keeps an edited summary.
page_frominteger<int32>First page the section covers (PDF only).
page_tointeger<int32>Last page the section covers (PDF only).
tokensinteger<int32>Approximate size of the section's text in tokens.
released_bystringWho released the source from quarantine; absent if never quarantined.
released_atstring<date-time>When the source was released from quarantine.
indexed_atstring<date-time>When indexing finished.
created_bystringWho uploaded the source.
created_atstring<date-time>When the source was uploaded.
updated_atstring<date-time>When the source last changed.