VocalDocscontracts 1.65.0

Read a corpus query

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

PropertyValue
Operationget_knowledge_eval_query
GroupKnowledge bases
Scopeknowledge:read
Scopes of include valuestext needs knowledge:read
Route classread
IdempotencyNo Idempotency-Key
AuditAn audited content read knowledge.eval_query.read, when the request names an include value
Released in1.53.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Answers one corpus query with its revision as the ETag (1.53.0); query is null unless include=text adds it, which makes the read an audited content read.

Request

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

curl "$VOCAL_API/v1/knowledge-bases/kb_.../eval-queries/kq_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY"

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.
includequeryarray of KnowledgeEvalQueryIncludenoContent classes to add, comma-separated: text answers query and makes the read an audited content read (1.53.0).

Responses

StatusContent typeShapeError codes
200application/jsonKnowledgeEvalQuery
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
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