---
title: "Read documents"
method: POST
path: "/rest/api/v1/getdocuments"
tags: ["Documents"]
---

# Read documents

`POST /rest/api/v1/getdocuments`

Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) for the given list of Glean Document IDs or URLs specified in the request.

## Query parameters

- `locale` string

## Request body

- GetDocumentsRequest
  - `documentSpecs` DocumentSpec[], required — The specification for the documents to be retrieved.
    - union
      - object
        - `url` string, required — The URL of the document.
      - object
        - `id` string, required — The ID of the document.
      - object
        - `ugcType` 'ANNOUNCEMENTS' | 'ANSWERS' | 'COLLECTIONS' | 'SHORTCUTS' | 'CHATS', required — The type of the user generated content (UGC datasource).
        - `contentId` integer, required — The numeric id for user generated content. Used for ANNOUNCEMENTS, ANSWERS, COLLECTIONS, SHORTCUTS.
        - `docType` string — The specific type of the user generated content type.
      - object
        - `ugcType` 'ANNOUNCEMENTS' | 'ANSWERS' | 'ARTIFACTS' | 'COLLECTIONS' | 'SHORTCUTS' | 'CHATS', required — The type of the user generated content (UGC datasource).
        - `ugcId` string, required — The string id for user generated content. Used for CHATS.
        - `docType` string — The specific type of the user generated content type.
  - `includeFields` string[] — List of Document fields to return (that aren't returned by default)

## Response `200`

OK

- GetDocumentsResponse
  - `documents` object — The document details or the error if document is not found.

## Other responses

- `400` — Invalid request
- `401` — Not Authorized
- `403` — Documents does not exist, or user cannot access documents.
- `429` — Too Many Requests

---

[API](https://skmtc.net/gleanwork/apis/glean-api.md) · [All operations](https://skmtc.net/gleanwork/apis/glean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gleanwork/glean-api/versions/5f93ec722f57/schema)
