Documents
View Document Content
Fetch parsed text for an attachment or knowledge-base document
GET
View Document Content
Use the document viewer endpoint when a UI needs the full parsed text for a file preview. The endpoint returns a single standard response shape for tenant attachments and knowledge-base documents.
For knowledge-base documents, prefer
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
source | knowledge_base | attachment | yes | Document source type |
file_id | string | for attachments | Attachment file ID |
agent_id | string | no | Optional agent scope for attachment authorization |
kb_id | string | for KB documents | Knowledge base ID |
document_id | string | preferred for KB documents | Indexed KB document ID |
file_path | string | alternative for KB documents | Source file path or filename when a document ID is not available |
document_id from GET /api/v1/knowledge-bases/{kb_id}/files or GET /api/v1/knowledge-bases/{kb_id}/documents. Use file_path only when the caller has a source path but no indexed document ID.
Attachment Example
Knowledge Base Example
Response
| Field | Type | Description |
|---|---|---|
filename | string | Display filename |
file_path | string | Source path or viewer path |
content | string | Full parsed text |
size | integer | Source file size in bytes when available |
last_modified | string | null | Last modified timestamp when available |
file_type | string | File extension/type label |
encoding | string | Text encoding, usually utf-8 |
summary | string | null | Attachment summary when available |
View Document Content

