Skip to content

Publish an edit as the pack's next immutable version

POST
/v1/knowledge-packs/{pack_id}/versions
curl --request POST \
--url https://api.vocapable.com/v1/knowledge-packs/example/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "sources": [ { "kind": "pdf", "label": "example", "text": "example", "uri": "example" } ], "compiled_token_count": 1 }'
pack_id
required
Pack Id
string
Media typeapplication/json
KnowledgePackVersionCreateRequest

POST /v1/knowledge-packs/{id}/versions - publish an edit as a new version.

compiled_token_count is measured by whatever compiled the pack - the distillation job, or the authoring editor’s live token meter. The control plane holds no model tokenizer (the tokenizer lives with the serving model on the GPU plane), so it validates the declared count against the budget rather than recomputing it. The count is checked, never clamped: over the hard cap the request is refused and no version is written.

object
sources
required
Sources
Array<object>
>= 1 items
PackSource

One distilled section of a pack, plus where it came from.

text is the artifact, not a summary of one: knowledge_pack_versions carries sources and no separate body column, so these sections are the compiled pack. Phrase them spoken-answer-ready - short declaratives an agent can say verbatim.

object
kind
required
Kind
string
Allowed values: pdf url text
label
required
Label
string
>= 1 characters <= 200 characters
text
required
Text
string
>= 1 characters
uri
Any of:
string
compiled_token_count
required
Compiled Token Count
integer
>= 1

Successful Response

Media typeapplication/json
KnowledgePackVersionResource

A compiled version. Immutable once ready - an edit is the next version.

object
id
required
Id
string
knowledge_pack_id
required
Knowledge Pack Id
string
version
required
Version
integer
content_hash
required
Content Hash
string
compiled_token_count
Any of:
integer
status
required
Status
string
Allowed values: compiling ready failed
sources
required
Sources
Array<object>
PackSource

One distilled section of a pack, plus where it came from.

text is the artifact, not a summary of one: knowledge_pack_versions carries sources and no separate body column, so these sections are the compiled pack. Phrase them spoken-answer-ready - short declaratives an agent can say verbatim.

object
kind
required
Kind
string
Allowed values: pdf url text
label
required
Label
string
>= 1 characters <= 200 characters
text
required
Text
string
>= 1 characters
uri
Any of:
string
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time
over_default_budget
required
Over Default Budget

Compiled above the 8k default budget but inside the 16k hard cap.

Permitted, and worth telling the tenant: a cap-size pack roughly doubles cold prefill and halves the number of warm pack prefixes a node holds.

boolean
Example
{
"status": "compiling",
"sources": [
{
"kind": "pdf"
}
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}