- [HTTP request](https://developers.google.com/youtube/data/reference/rest/v3/liveChatMessages/insert.md.txt#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/youtube/data/reference/rest/v3/liveChatMessages/insert.md.txt#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/youtube/data/reference/rest/v3/liveChatMessages/insert.md.txt#body.request_body)
- [Response body](https://developers.google.com/youtube/data/reference/rest/v3/liveChatMessages/insert.md.txt#body.response_body)
- [Authorization scopes](https://developers.google.com/youtube/data/reference/rest/v3/liveChatMessages/insert.md.txt#body.aspect)
- [Try it!](https://developers.google.com/youtube/data/reference/rest/v3/liveChatMessages/insert.md.txt#try-it)

Adds a text message or a poll to a live chat.

Provide a `liveChatMessage` resource in the request body with these required properties:

- `snippet.liveChatId`: The live chat ID for the target broadcast.
- `snippet.type`: Either `textMessageEvent` or `pollEvent`.
- For `textMessageEvent`, include `snippet.textMessageDetails.messageText`.
- For `pollEvent` (requires channel owner or content manager authorization, with at most one active poll per chat), include `snippet.pollDetails.metadata` with:
  - `questionText`: Poll question text (up to 100 characters).
  - `options`: Between 2 and 4 items displayed in the order listed, each setting `optionText` (up to 35 characters). Do not set `tally` or `snippet.pollDetails.status`.

For method-specific error responses, see [liveChatMessages.insert errors](https://developers.google.com/youtube/data/reference/rest/v3/errors.md.txt#liveChatMessages_youtube.liveChatMessages.insert). For code examples, see [liveChatMessages.insert code snippets](https://developers.google.com/youtube/data/code_samples/code_snippets.md.txt?method=liveChatMessages.insert).

### HTTP request

`POST https://youtube.googleapis.com/youtube/v3/liveChat/messages`

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

### Query parameters

| Parameters ||
|---|---|
| `part[]` | `string` Required. Specifies the properties that the write operation sets and the resource parts that the API response includes. This parameter must include `snippet`, and can also include `id` and `authorDetails`. |

### Request body

The request body contains an instance of `LiveChatMessage`.

### Response body

If successful, the response body contains a newly created instance of `LiveChatMessage`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/youtube`
- `https://www.googleapis.com/auth/youtube.force-ssl`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).