Replace a context source's test cases
/v1/context-sources/{slug}/test-casesReplace a context source's test cases.
Sets the source's whole test set: up to 200 questions, each with 1 to 8 section ids (n12, from the outline) that answer it. Questions are stored encrypted with the organization's key. An empty list removes them.
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 400 for an empty or too long question or an id that is not a section of the source, 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
The test cases.
casesobject[]requiredThe test cases, at most 200. An empty list removes them all.
At most 200 items
Child attributes
questionstringrequiredA question your users would ask. At most 4,000 characters.
At least 0 characters · At most 4000 characters
expected_sectionsstring[]requiredIds of the sections (
n12, from the outline) that answer the question, 1 to 8.At most 8 items
idstringThe case's id. Read-only: ignored when you send test cases.
created_atstring<date-time>When the case was saved. Read-only.
Responses
casesobject[]The test cases, in the order they were sent.
Child attributes
questionstringrequiredA question your users would ask. At most 4,000 characters.
At least 0 characters · At most 4000 characters
expected_sectionsstring[]requiredIds of the sections (
n12, from the outline) that answer the question, 1 to 8.At most 8 items
idstringThe case's id. Read-only: ignored when you send test cases.
created_atstring<date-time>When the case was saved. Read-only.