VocalDocscontracts 1.65.0

Read a Document

GET /v1/knowledge-bases/{knowledge_base_id}/documents/{document_id}

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

Answers the Document with the facts of its current revision (1.53.0); title and external_ref are null unless include=names adds them, 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_.../documents/kdoc_..." \
  -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.
document_idpathKnowledgeDocumentIdyesThe id of a Document of a Knowledge base: kdoc_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
includequeryarray of KnowledgeDocumentIncludenoContent classes to add, comma-separated: names answers title and external_ref and makes the read an audited content read (1.53.0, second part).

Responses

StatusContent typeShapeError codes
200application/jsonKnowledgeDocument
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is KnowledgeDocument.

FieldTypeRequiredDescription
byte_sizeinteger or nullyes
chunk_countintegeryes
chunker_versionstring or nullyes
classificationKnowledgeClassification or nullyes
created_atTimestampyes
embedding_spaceEmbeddingSpace or nullyes
entity_countsarray of KnowledgeEntityCountyes
error_codeIngestionErrorCode or nullyesSet when failed.
external_refstring or nullyesThe file name, URL or vendor reference the Source knows the Document by. The content class names: null unless the read names include=names, and null in the answer of a write (1.53.0, second part).
idKnowledgeDocumentIdyes
indexed_atTimestamp or nullyes
knowledge_base_idKnowledgeBaseIdyes
last_ingestion_run_idIngestionRunId or nullyes
media_typeKnowledgeMediaType or nullyes
object"knowledge_document"yes
page_countinteger or nullyes
parser_versionstring or nullyes
purged_atTimestamp or nullyes
quarantine_expires_atTimestamp or nullyesWhen the parsed text held for review is deleted, 14 days after the quarantine (a target); null otherwise.
quarantined_atTimestamp or nullyes
review_statusKnowledgeReviewStatusyes
revisionintegeryesCounts writes to the Document; returned as the ETag and required in If-Match. Not the number of content revisions.
source_idKnowledgeSourceIdyes
statusKnowledgeDocumentStatusyes
tagsarray of DocumentTagyes
titlestring or nullyesThe title the upload or the parse stage gave, or null when it has none. The content class names: null unless the read names include=names, and null in the answer of a write (1.53.0, second part).
updated_atTimestampyes