- [HTTP request](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.response_body)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.CommitStreamMessageResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#body.aspect)
- [Try it!](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages/commit#try-it)

<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.

Commits an active stream message into a finalized message in a Google Chat space.

<br />

Requires [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope:

- `https://www.googleapis.com/auth/chat.bot`

### HTTP request

`POST https://chat.googleapis.com/v1/{name=spaces/*/streamMessages/*}:commit`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the stream message to commit. Format: `spaces/{space}/streamMessages/{streamMessage}` |

### Request body

The request body contains data with the following structure:

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

| Fields ||
|---|---|
| `chunkToken` | `string` Required. Token for committing the stream message, obtained from the `nextChunkToken` field of the previous stream response. |
| `streamContentChunks[]` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.streamMessages#StreamContentChunk`)`` Optional. Any final chunks to append before finalizing the message. |

### Response body

Response message for committing 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 />

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "message": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message`) } } ``` |

| Fields ||
|---|---|
| `message` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message`)`` The finalized message. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/chat.bot`
- `https://www.googleapis.com/auth/chat.messages`

For more information, see the [Authorization guide](https://developers.google.com/workspace/chat/authenticate-authorize).