Skip to main content
GET
Get Document

Authorizations

Authorization
string
header
required

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Path Parameters

dataset_id
string<uuid>
required

Knowledge base ID. From List Knowledge Bases.

document_id
string<uuid>
required

Document ID. From List Documents.

Query Parameters

metadata
enum<string>
default:all

all returns all fields including metadata. only returns only id, doc_type, and doc_metadata. without returns all fields except doc_metadata.

Available options:
all,
only,
without

Response

Document details. The returned fields depend on the metadata query parameter.

id
string

Document identifier.

position
integer

Position index within the knowledge base.

data_source_type
string

How the document was uploaded. upload_file for file uploads, notion_import for Notion imports.

data_source_info
object

Data source details. For file uploads, this detail endpoint returns the full file object under upload_file (the list endpoint returns only upload_file_id).

dataset_process_rule_id
string

ID of the processing rule applied to this document.

dataset_process_rule
object

Knowledge-base-level processing rule configuration.

document_process_rule
object

Document-level processing rule configuration.

name
string

Document name.

created_from
string

Origin of the document. api for API creation, web for UI creation.

created_by
string

ID of the user who created the document.

created_at
number

Unix timestamp of document creation.

tokens
integer

Number of tokens in the document.

indexing_status
string

Current indexing status, e.g. waiting, parsing, cleaning, splitting, indexing, completed, error, paused.

error
string | null

Error message if indexing failed, null otherwise.

enabled
boolean

Whether the document is enabled for retrieval.

disabled_at
number | null

Unix timestamp when the document was disabled, null if enabled.

disabled_by
string | null

ID of the user who disabled the document, null if enabled.

archived
boolean

Whether the document is archived.

display_status
string

Display-friendly indexing status for the UI.

hit_count
integer

Number of times this document has been retrieved.

doc_form
string

Document chunking mode. text_model for standard text, hierarchical_model for parent-child, qa_model for QA pairs.

doc_language
string

Language of the document content.

doc_type
string | null

Document type classification, null if not set.

doc_metadata
object[]

Custom metadata key-value pairs for this document.

completed_at
number | null

Unix timestamp when processing completed, null if not yet completed.

updated_at
number | null

Unix timestamp of last update, null if never updated.

indexing_latency
number | null

Time taken for indexing in seconds, null if not completed.

segment_count
integer

Number of chunks in the document.

average_segment_length
number

Average character length of chunks.

summary_index_status
string | null

Status of summary indexing, null if summary index is not enabled.

need_summary
boolean

Whether the document needs summary generation.