Get knowledge document
One knowledge document’s full content — raw_text and body_html — plus every field
List knowledge documents omits: error_message,
chunk_count, token_count, needs_reembed, file metadata, material_type, and writing-style
attachment. Round-trip target for
Update knowledge document.
Requires the read:knowledge_base scope.
GET /brands/{brand_id}/knowledge-documents/{document_id}Authorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
document_id | uuid | required | From List knowledge documents |
Request
cURL
curl --request GET \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/knowledge-documents/b4f7e2a1-9c3d-4e6f-8a1b-2c5d7e9f0a3b' \
--header 'Authorization: Bearer <api-key>'Response
200
{
"data": {
"document": {
"id": "b4f7e2a1-9c3d-4e6f-8a1b-2c5d7e9f0a3b",
"brand_id": "242546de-4cee-4a7d-952e-f6aa60c63ef8",
"title": "Product Positioning FAQ",
"user_description": "Internal FAQ used to ground content about our differentiation.",
"source_type": "paste",
"raw_text": "## What makes us different?\n\nAsky tracks...",
"body_html": "<h2>What makes us different?</h2><p>Asky tracks...</p>",
"status": "ready",
"error_message": null,
"char_count": 4820,
"chunk_count": 6,
"token_count": 1180,
"needs_reembed": false,
"file_name": null,
"page_count": null,
"file_size_bytes": null,
"mime_type": null,
"material_type": null,
"writing_style_id": null,
"style_prompt_dismissed": false,
"created_by": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"created_at": "2026-08-18T11:02:04.000Z",
"updated_at": "2026-08-20T09:14:22.000Z"
}
},
"request_id": "req_c7e1a0b8d3f24e6a9c5b"
}Response fields
| Field | Type | Description |
|---|---|---|
data.document.id | uuid | required |
data.document.brand_id | uuid | required |
data.document.title | string | required |
data.document.user_description | string | null | required |
data.document.source_type | string | required. One of paste, pdf, mcp — mcp is a legacy value, see List knowledge documents |
data.document.raw_text | string | null | required. null while a PDF is still processing |
data.document.body_html | string | null | required. See Notes — effectively never null once status is ready |
data.document.status | string | required. One of processing, ready, failed |
data.document.error_message | string | null | required. Populated only when status is failed |
data.document.char_count | integer | required |
data.document.chunk_count | integer | required. Chunks the document was split into for retrieval |
data.document.token_count | integer | required |
data.document.needs_reembed | boolean | required. true when the stored embeddings are stale relative to the current content |
data.document.file_name | string | null | PDF-sourced documents only |
data.document.page_count | integer | null | PDF-sourced documents only |
data.document.file_size_bytes | integer | null | PDF-sourced documents only |
data.document.mime_type | string | null | PDF-sourced documents only. application/pdf when set |
data.document.material_type | string | null | Optional user-assigned classification of the source material |
data.document.writing_style_id | uuid | null | Set when this document belongs to a writing style rather than general brand knowledge |
data.document.style_prompt_dismissed | boolean | required |
data.document.created_by | uuid | required |
data.document.created_at / data.document.updated_at | timestamptz | required |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 403 | insufficient_scope | The key does not carry read:knowledge_base |
| 404 | not_found | The brand does not exist, document_id does not belong to this brand, or this key is not allowed to reach it |
| 429 | rate_limited | Over 300 requests per minute |
Notes
raw_text and body_html are null while a PDF is still processing. They populate once
status flips to ready, after the vision extraction pass finishes.
body_html is synthesized, not always stored. Legacy and pasted rows with no persisted HTML
get one generated from raw_text on read, matching what the app does — so the field reads as
populated for a ready document even before anyone has edited it. The first edit through
Update knowledge document persists a real,
independently-stored value.
error_message only appears once a document has failed. It is null for every other status.
File metadata is PDF-only. file_name, page_count, file_size_bytes and mime_type are
null for paste and mcp documents. Use
Get knowledge document file to download the
original PDF for a pdf-sourced one.