---
title: "Get Document"
method: GET
path: "/datasets/{dataset_id}/documents/{document_id}"
tags: ["Documents"]
---

# Get Document

`GET /datasets/{dataset_id}/documents/{document_id}`

Returns detailed information for a single document.

## Path parameters

- `dataset_id` string, uuid, required
- `document_id` string, uuid, required

## Query parameters

- `metadata` 'all' | 'only' | 'without'

## Response `200`

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

- object
  - `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`).
    - `upload_file` object — Uploaded file details. Present when `data_source_type` is `upload_file`.
      - `id` string — File identifier.
      - `name` string — Original file name.
      - `size` integer — File size in bytes.
      - `extension` string — File extension.
      - `mime_type` string — File MIME type.
      - `created_by` string — ID of the user who uploaded the file.
      - `created_at` integer — Unix timestamp of file upload.
  - `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, nullable — Error message if indexing failed, `null` otherwise.
  - `enabled` boolean — Whether the document is enabled for retrieval.
  - `disabled_at` number, nullable — Unix timestamp when the document was disabled, `null` if enabled.
  - `disabled_by` string, nullable — 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, nullable — Document type classification, `null` if not set.
  - `doc_metadata` object[] — Custom metadata key-value pairs for this document.
    - `id` string — Metadata field identifier.
    - `name` string — Metadata field name.
    - `type` string — Metadata field type.
    - `value` string — Metadata field value for this document.
  - `completed_at` number, nullable — Unix timestamp when processing completed, `null` if not yet completed.
  - `updated_at` number, nullable — Unix timestamp of last update, `null` if never updated.
  - `indexing_latency` number, nullable — 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, nullable — Status of summary indexing, `null` if summary index is not enabled.
  - `need_summary` boolean — Whether the document needs summary generation.

## Other responses

- `400` — `invalid_metadata` : The `metadata` query parameter value is invalid (must be `all`, `only`, or `without`).
- `403` — - `forbidden` : You do not have permission to access this document. - `forbidden` : Knowledge base API access is not enabled.
- `404` — `not_found` : Document not found.

---

[API](https://skmtc.net/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.net/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/versions/361dc12484f4/schema)
