VocalDocscontracts 1.65.0

Update the Knowledge base draft

PATCH /v1/knowledge-bases/{knowledge_base_id}

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

Replaces the named fields of the draft at the revision If-Match names (1.53.0), checked as a creation is. A change of embedding or chunking starts an Ingestion run with cause reindex on every Source; versions already published keep their configuration. An archived Knowledge base is refused with knowledge_base_archived.

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_..." \
  -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.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Request body

Content type application/json, required: KnowledgeBaseUpdateRequest.

FieldTypeRequiredDescription
auto_publishKnowledgeAutoPublishno
chunkingKnowledgeChunkingInputno
descriptionstring or nullno
embeddingKnowledgeEmbeddingInputno
languageLanguageTagno
nameKnowledgeBaseNameno
phi_contentKnowledgePhiContentno
retrieval_defaultsKnowledgeRetrievalDefaultsInputno
sensitive_contentKnowledgeSensitiveContentInputno

Responses

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

Fields of the 200 answer

The shape is KnowledgeBase.

FieldTypeRequiredDescription
active_versioninteger or nullyesThe version bindings that track active resolve at dispatch, or null when none is active.
archived_atTimestamp or nullyesWhen DELETE archived the Knowledge base, or null. An archived Knowledge base takes no write, upload, sync or publish (409 knowledge_base_archived).
auto_publishKnowledgeAutoPublishyes
chunkingKnowledgeChunkingyes
created_atTimestampyes
descriptionstring or nullyes
document_countintegernoThe Documents of the Knowledge base that are not removed, whatever their status (1.54.0); absent from an api before 1.54.0.
embeddingKnowledgeEmbeddingyes
idKnowledgeBaseIdyes
languageLanguageTagyes
latest_versioninteger or nullyesThe highest published version, or null before the first publish.
nameKnowledgeBaseNameyes
object"knowledge_base"yes
organization_idOrganizationIdyes
phi_contentKnowledgePhiContentyes
retrieval_defaultsKnowledgeRetrievalDefaultsyes
revisionintegeryesCounts writes to the draft; returned as the ETag and required in If-Match.
sensitive_contentKnowledgeSensitiveContentyes
source_countintegernoThe Sources of the Knowledge base that are not deleted (1.54.0); absent from an api before 1.54.0.
updated_atTimestampyes