VocalDocscontracts 1.65.0

Retire a Knowledge base version

POST /v1/knowledge-bases/{knowledge_base_id}/versions/{version}/retire

PropertyValue
Operationretire_knowledge_base_version
GroupKnowledge bases
Scopeknowledge:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited knowledge.version.retire (mutation)
Released in1.53.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Retires a published, inactive version and answers it with retired_at set (1.53.0); a retired version answers unchanged. The active version, and one an Agent version pins, are refused with 409 knowledge_base_version_in_use and the reason active or pinned. The platform also retires versions beyond the 10 newest (a target) under the same rule.

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 POST "$VOCAL_API/v1/knowledge-bases/kb_.../versions/1/retire" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

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.
versionpathintegeryesA version number, from 1.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Responses

StatusContent typeShapeError codes
200application/jsonKnowledgeBaseVersion
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused, knowledge_base_version_in_use
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is KnowledgeBaseVersion.

FieldTypeRequiredDescription
activebooleanyesTrue for the active version, the one bindings that track active resolve at dispatch.
chunk_countintegeryes
configKnowledgeBaseConfigyes
config_sha256stringyesThe SHA-256 of the canonical configuration, in lowercase hex.
document_countintegeryes
evaluation_idKnowledgeEvaluationId or nullyesThe Evaluation the gate read, or null when none ran.
excluded_document_countintegeryesThe pending Documents exclude_pending left out; 0 when it was not set.
excluded_document_idsarray of KnowledgeDocumentIdyesThe first 100 of them (a target), in id order.
gateKnowledgeGateOutcomeyes
knowledge_base_idKnowledgeBaseIdyes
notesstring or nullyes
object"knowledge_base_version"yes
published_atTimestampyes
published_byActorRef or nullyesWho published it; null when auto_publish published it after an Ingestion run.
retired_atTimestamp or nullyes
source_revisionintegeryesThe draft revision whose configuration the version froze.
statusKnowledgeBaseVersionStatusyes
versionintegeryesThe snapshot number, from 1.