---
title: "Get Document Metadata"
method: GET
path: "/datastores/{datastore_id}/documents/{document_id}/metadata"
tags: ["/datastores/{id}/documents"]
---

# Get Document Metadata

`GET /datastores/{datastore_id}/documents/{document_id}/metadata`

Get details of a given document, including its `name` and ingestion job `status`.

## Path parameters

- `datastore_id` string, uuid, required — Datastore ID of the datastore from which to retrieve the document
- `document_id` string, uuid, required — Document ID of the document to retrieve details for

## Response `200`

Successful Response

- DocumentDescription — Document description
  - `custom_metadata` object — Custom metadata for the document, provided by the user at ingestion time.Must be a JSON-serializable dictionary with string keys and simple primitive values (str, int, float, bool). The total size must not exceed 2 KB.The strings with date format must stay in date format or be avodied if not in date format.The 'custom_metadata.url' field is automatically included in returned attributions during query time, if provided.The default maximum metadata fields that can be used is 15, contact support if more is needed.
  - `custom_metadata_config` object — A dictionary mapping metadata field names to the configuration to use for each field. If a metadata field is not present in the dictionary, the default configuration will be used. If the dictionary is not provided, metadata will be added in context for rerank and generation but will not be returned back to the user in retrievals in query API. Limits: - Maximum characters per metadata field (for prompt or rerank): **400** - Maximum number of metadata fields (for prompt or retrieval): **10** Contact support@contextual.ai to request quota increases.
  - `id` string, uuid, required — ID of the document that was ingested
  - `name` string, required — User specified name of the document
  - `status` 'pending' | 'processing' | 'retrying' | 'completed' | 'failed' | 'cancelled', required
  - `created_at` string, required — Timestamp of when the document was created in ISO format.
  - `updated_at` string — Timestamp of when the document was modified in ISO format.
  - `ingestion_config` object — Ingestion configuration for the document when the document was ingested. It may be different from the current datastore configuration.
  - `has_access` boolean — Whether the user has access to this document.

## Other responses

- `422` — Validation Error

## Changes

- **2025-10-28** `c8152db45500` — 1 breaking
  - response property `custom_metadata/additionalProperties/` list-of-types was widened by adding types `array` to media type `application/json` of response `200`
- **2025-08-26** `db7245c74772` — 3 info
  - added the optional property `custom_metadata_config` to the response with the `200` status
  - added the optional property `has_access` to the response with the `200` status
  - added the optional property `ingestion_config` to the response with the `200` status
- **2025-05-08** `17bdb8a33fb4` — 2 info
  - api tag `/datastores/{id}/documents` added
  - api tag `/datastores` removed
- **2025-02-26** `5298551c424b` — 6 warning, 3 info
  - added the new `cancelled` enum value to the `status` response property for the response status `200`
  - added the new `completed` enum value to the `status` response property for the response status `200`
  - added the new `failed` enum value to the `status` response property for the response status `200`
  - added the new `pending` enum value to the `status` response property for the response status `200`
  - …5 more

[Change history](https://skmtc.dev/contextualai/apis/endpoints/changes/datastores/:datastore_id/documents/:document_id/metadata/get.md)

---

[API](https://skmtc.dev/contextualai/apis/endpoints.md) · [All operations](https://skmtc.dev/contextualai/apis/endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/contextualai/endpoints/revisions/ca7f807eec8b/schema)
