VocalDocscontracts 1.65.0

Update a corpus query

PATCH /v1/knowledge-bases/{knowledge_base_id}/eval-queries/{eval_query_id}

PropertyValue
Operationupdate_knowledge_eval_query
GroupKnowledge bases
Scopeknowledge:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited knowledge.eval_query.update (mutation)
Released in1.53.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Replaces the named fields of a corpus query at the revision If-Match names, checked as a creation is (1.53.0). An Evaluation that ran the earlier revision is stale for a publish.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the knowledge:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X PATCH "$VOCAL_API/v1/knowledge-bases/kb_.../eval-queries/kq_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
knowledge_base_idpathKnowledgeBaseIdyesThe id of a Knowledge base: kb_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
eval_query_idpathKnowledgeEvalQueryIdyesThe id of a query of the retrieval-quality corpus of a Knowledge base: kq_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Request body

Content type application/json, required: KnowledgeEvalQueryUpdateRequest.

FieldTypeRequiredDescription
expect_emptybooleannoTrue when no passage should score at or above min_score for the query.
filterKnowledgeFilterInput or nullno
querystringno
relevant_documentsarray of KnowledgeDocumentIdnoThe Documents that answer the query; empty when expect_empty.
tagsarray of KnowledgeEvalQueryTagnosnake_case labels that group the queries, such as lab_visits.

Responses

StatusContent typeShapeError codes
200application/jsonKnowledgeEvalQuery
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeknowledge_base_archived
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is KnowledgeEvalQuery.

FieldTypeRequiredDescription
created_atTimestampyes
expect_emptybooleanyesTrue when no passage should score at or above min_score for the query.
filterKnowledgeFilter or nullyesThe filter the query is run under, as a binding would fix it; null for none.
idKnowledgeEvalQueryIdyes
knowledge_base_idKnowledgeBaseIdyes
object"knowledge_eval_query"yes
querystring or nullyesThe question as a caller would ask it: the content class text, null unless the read names include=text, and null in the answer of a write.
relevant_documentsarray of KnowledgeDocumentIdyesThe Documents that answer the query; empty when expect_empty.
revisionintegeryesCounts writes; returned as the ETag and required in If-Match.
tagsarray of KnowledgeEvalQueryTagyessnake_case labels that group the queries, such as lab_visits.
updated_atTimestampyes