---
title: "Summarize the next bunch of chat messages from a given offset"
method: POST
path: "/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/summarize"
tags: ["chat"]
---

# Summarize the next bunch of chat messages from a given offset

`POST /ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}/summarize`

Required capability: `chat-summary-api`

## Path parameters

- `apiVersion` 'v1', required
- `token` string, required

## Headers

- `OCS-APIRequest` boolean, required

## Request body

- object
  - `fromMessageId` integer, required — Offset from where on the summary should be generated

## Response `201`

Summary was scheduled, use the returned taskId to get the status information and output from the TaskProcessing API: [OCS TaskProcessing API](https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-taskprocessing-api.html#fetch-a-task-by-id). If the response data contains nextOffset, not all messages could be handled in a single request. After receiving the response a second summary should be requested with the provided nextOffset.

- object
  - `ocs` object, required
    - `meta` OCSMeta, required
      - `status` string, required
      - `statuscode` integer, required
      - `message` string
      - `totalitems` string
      - `itemsperpage` string
    - `data` object, required
      - `taskId` integer, required
      - `nextOffset` integer

## Other responses

- `204` — No messages found to summarize
- `400` — The conversation is classified
- `500`

## Changes

- **2026-07-16** `a2b2faeb5c3f` — 1 warning
  - added the new `classified` enum value to the `ocs/data/error` response property for the response status `400`

[Change history](https://skmtc.dev/nextcloud/apis/spreed-full/changes/ocs/v2.php/apps/spreed/api/:apiVersion/chat/:token/summarize/post.md)

---

[API](https://skmtc.dev/nextcloud/apis/spreed-full.md) · [All operations](https://skmtc.dev/nextcloud/apis/spreed-full/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nextcloud/spreed-full/revisions/41d6458d6d6e/schema)
