Live Chat
Send a Chat Message
POST /2/broadcasts/:id/chat posts a plain-text chat message to a live broadcast, attributed to the authenticated user.
POST
Send a chat message to a live broadcast
Posts a plain-text chat message to a live broadcast. The message is attributed to the authenticated user.
:id is the alphanumeric broadcast_id, and text must be from 1 through 140 characters.
The broadcast must be currently live. Its chat settings and the authenticated user’s eligibility determine whether the user may send a message. For example, chat may be disabled or limited to verified users, subscribers, or users followed by the host.
The response’s timestamp is the server timestamp of the message in nanoseconds, returned as a decimal string. It also serves as the message id — for example, as the reply_to value of a follow-up message or the message_id when deleting the message.
Errors
- A request returns
400 Bad Requestif the broadcast cannot be found, is not currently live, or the message is invalid. - It returns
403 Forbiddenif the authenticated user is not permitted to chat in the broadcast.
This endpoint sends messages only. To receive chat messages in real time, subscribe to the
broadcast.chat event on the X Activity API as described in Accessing Live Chat.Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Pattern:
^[a-zA-Z0-9]{1,13}$Body
application/json
The chat message text.
Required string length:
1 - 140Message id to reply to, returned as timestamp when sent.
Pattern:
^[0-9]{1,19}$