---
title: "Summarize documents"
method: POST
path: "/rest/api/v1/summarize"
tags: ["Summarize"]
---

# Summarize documents

`POST /rest/api/v1/summarize`

Generate an AI summary of the requested documents.

## Query parameters

- `locale` string

## Request body

- SummarizeRequest — Summary of the document
  - `timestamp` string, date-time — The ISO 8601 timestamp associated with the client request.
  - `query` string — Optional query that the summary should be about
  - `preferredSummaryLength` integer — Optional length of summary output. If not given, defaults to 500 chars.
  - `documentSpecs` DocumentSpec[], required — Specifications of documents to summarize
    - 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.
  - `trackingToken` string — An opaque token that represents this particular result. To be used for /feedback reporting.

## Response `200`

OK

- SummarizeResponse
  - `error` object
    - `message` string
  - `summary` Summary
    - `text` string
    - `followUpPrompts` string[] — Follow-up prompts based on the summarized doc
  - `trackingToken` string — An opaque token that represents this summary in this particular query. To be used for /feedback reporting.

## Other responses

- `400` — Invalid request
- `401` — Not Authorized
- `429` — Too Many Requests

## Changes

> 92 revisions in range; 12 could not be searched.

- **2026-07-21** `972a5118199e` — 1 info
  - the endpoint scheme security `APIToken` was added to the API
- **2026-07-21** `2d62172604d1` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API
- **2026-06-22** `08c17c9175d0` — 1 info
  - the endpoint scheme security `APIToken` was added to the API
- **2026-06-21** `b162fb37b3ad` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API
- **2026-06-20** `d1f1d35ae0f9` — 1 info
  - the endpoint scheme security `APIToken` was added to the API

[Full history](https://skmtc.dev/gleanwork/apis/glean-api/changes/rest/api/v1/summarize/post.md)

---

[API](https://skmtc.dev/gleanwork/apis/glean-api.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-api/revisions/7ed1f79f6fb7/schema)
