document_id.
Added in Python SDK 0.9.0 and JavaScript and TypeScript SDK 0.9.0. In TypeScript, pass the
document_key as a string, or an options object; every option is accepted in snake_case or camelCase (documentId or document_id). The result is returned as the server sends it, with snake_case fields, typed as Record<string, unknown>.section_key, heading and page range, so an agent can decide what to read and then call documents.read with a section_key. It is also how you check what a citation points at.
Parameters
Address the document one way: pass eitherdocument_key or document_id.
The document’s address, from
memories.create, a citation, or a knowledge.query result.Open the outline of this version instead of the current one. List versions with
documents.versions.The user you read the document as. Pass the same
user_id, customer_id and scope you use with context.fetch, also when you hold a document_key.The customer you read the document as. A customer’s document opens only for a call that names that customer. Not accepted on B2C.
Returns
A short summary of the whole document. Left out while any part of the document has been removed by a forget request.
The sections in reading order. Each has
section_key (what you pass to read), heading, level, parent_key (the enclosing section), section_path (the headings from the top down), page_start, page_end and a one-line summary. Empty while the document is still being processed. Sections removed by a forget request are not listed.document_key, document_id, version, is_current, document_type and processing_stage.
Example
Raises
ContextNotFoundError: when the document does not exist or you cannot see it (another customer’s or user’s, outside your instance’s visibility, or deleted); these look the same on purpose. Also when the feature is not enabled on your instance.FeatureNotInPlanError: when your plan does not include document navigation.InvalidInputError: whenversionis not a positive integer, or you pass both or neither ofdocument_keyanddocument_id.CustomerIdNotAcceptedError: whencustomer_idis passed on a B2C instance.