Skip to main content
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 Request if the broadcast cannot be found, is not currently live, or the message is invalid.
  • It returns 403 Forbidden if 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

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string
required
Pattern: ^[a-zA-Z0-9]{1,13}$

Body

application/json
text
string
required

The chat message text.

Required string length: 1 - 140
reply_to
string

Message id to reply to, returned as timestamp when sent.

Pattern: ^[0-9]{1,19}$

Response

The request has succeeded.

data
object
errors
object[]