state values.
Endpoint: PUT /2/users/:user_id/broadcasts/:broadcast_id/state
Publish (state: “PUBLISH”)
TransitionsNOT_STARTED → RUNNING. The broadcast becomes publicly visible on X. By default an announcement post is created. (Set should_not_tweet: true to suppress it.)
You can publish before your encoder connects: the response shows RUNNING right away, and video appears once the source is receiving it. Start your encoder before or right after publishing.
Request body
Chat option values
chat_option is an integer enum controlling who can participate in chat:
Set
chat_option explicitly to choose who can chat.
Example request
Response (on success)
start_msis set when it becomes live.- The announcement post is created asynchronously.
tweet_idis typically not present in this publish response — re-fetch the broadcast (GET .../broadcasts/:broadcast_id) a moment later to readtweet_idonce the post exists. tweet_error: present, next tobroadcast, only when the announcement post failed; it describes why. The broadcast still goes live.languageis present only when you sendlocale.
End (state: “END”)
TransitionsRUNNING → ENDED. Irreversible; you cannot restart a broadcast.
Request body (strict)
400 with error_type: "badRequest".
Example request
Response
available_for_replay was true (or per platform policy).