- [Resource: StreamMessage](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamMessage)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamMessage.SCHEMA_REPRESENTATION)
- [StreamContentChunk](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamContentChunk)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamContentChunk.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#METHODS_SUMMARY)

## Resource: StreamMessage

A streaming message in a Google Chat space. Stream messages let Chat apps display incremental progress updates, steps, citations, and text chunks before committing a finalized message.

<br />

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

<br />

| JSON representation |
|---|
| ``` { "name": string, "progressText": string, "streamContentChunks": [ { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamContentChunk`) } ], "markupSyntax": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/MarkupSyntax`), "nextChunkToken": string, "referencedMessage": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. Resource name of the stream message. Format: `spaces/{space}/streamMessages/{streamMessage}` |
| `progressText` | `string` Required. Plain-text progress status displayed for the active stream message. Maximum length is 250 characters. Must be non-empty when creating a stream message or when included in `updateMask` during an update. |
| `streamContentChunks[]` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamContentChunk`)`` Optional. Input only. A list of chunks that define the content of the stream message. |
| `markupSyntax` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/MarkupSyntax`)`` Optional. Specifies how the server interprets the stream content chunks. |
| `nextChunkToken` | `string` Optional. Token returned by the server for sequencing subsequent stream requests. Pass this token as `chunkToken` when appending or committing content, or populate `nextChunkToken` when updating the stream message. |
| Required. The reference that the stream message is anchored to. One of the following is required: The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `referencedMessage` | `string` Resource name of the message that the stream message is referencing, such as the user message that invoked the Chat app. Must belong to the same space and be accessible to the Chat app. The space must have threading enabled. Format: `spaces/{space}/messages/{message}` |
| End of mutually exclusive fields. ||

## StreamContentChunk

A chunk of content within a stream message.

<br />

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

<br />

| JSON representation |
|---|
| ``` { "text": string, "step": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Step`) }, "card": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/CardWithId`) }, "accessoryWidget": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/AccessoryWidget`) }, "citation": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Citation`) }, "citedSource": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/CitedSource`) } } ``` |

| Fields ||
|---|---|
| The content of the chunk. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `text` | `string` Optional. Text content of the stream message. Concatenated across append requests and replaced when `streamContentChunks` is included in an update request. Supports Markdown formatting when `markupSyntax` is set to `MARKUP_SYNTAX_MARKDOWN`. |
| `step` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Step`)`` Optional. A step that the Chat app performed while generating the response, such as a reasoning step or tool call. |
| `card` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/CardWithId`)`` Optional. A [card](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). Only supported when committing a stream message. To learn how to create a message that contains cards, see [Send a message](https://developers.google.com/workspace/chat/create-messages). <br /> Design and preview cards with the Card Builder. [Open the Card Builder](https://addons.gsuite.google.com/uikit/builder) <br /> |
| `accessoryWidget` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/AccessoryWidget`)`` Optional. An interactive widget that appears at the bottom of a message. Only supported when committing a stream message. For details, see [Add interactive widgets at the bottom of a message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). |
| `citation` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Citation`)`` Optional. An inline citation referenced within the message text (via `<chat-citation>` tags) that renders as an interactive hover card. Only supported when the stream message's `markupSyntax` is set to `MARKUP_SYNTAX_MARKDOWN`. If a citation with a duplicate `id` is provided, it overwrites the existing citation with the same `id`. |
| `citedSource` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/CitedSource`)`` Optional. A source to be displayed under the message as a footer link. Only supported when committing a stream message. |
| End of mutually exclusive fields. ||

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/appendStreamMessageContent` | > [!WARNING] > **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. Appends content chunks to an existing stream message in a Google Chat space. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit` | > [!WARNING] > **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. Commits an active stream message into a finalized message in a Google Chat space. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/create` | > [!WARNING] > **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. Initiates a new stream message in a Google Chat space. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/delete` | > [!WARNING] > **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. Deletes an active stream message in a Google Chat space. |
| ### `https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/patch` | > [!WARNING] > **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. Updates fields in an active stream message in a Google Chat space. |