spaceXSI

Broadcast request desk, the live Tech 50, and a handoff into X Circle.

POST /2/users/:user_id/broadcasts ยท Starts in NOT_STARTED. Does not go live. A cold source returns 404.

Request

Ready to copy.

curl -X POST "https://api.x.com/2/users/172483972/broadcasts" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"source_id":"6ep48v6ar5q4","region":"eu-central-1","is_low_latency":true}'

Keep from the 200

id / broadcast_id
Same value. Use it everywhere after create.
media_key
Needed later for chat and playback.
share_url
https://x.com/i/broadcasts/{id}
hls urls
video_access.hls_url and https_hls_url.
state
Always NOT_STARTED at creation.

States

  • NOT_STARTED

    Initial. Not public.

    Create

  • PRE_PUBLISHED

    Transitional while going live.

    Platform

  • RUNNING

    Live and visible.

    PUBLISH

  • ENDED

    Terminal. Cannot restart.

    END

  • TIMED_OUT

    Terminal.

    Platform

  • CANCELED

    Terminal.

    Platform

404 trap

The source must already be receiving RTMP. If is_stream_active is false, Create returns 404.

Two user ids

Paths use twitter_user_id. The response user_id is a different livestream id. Ignore owner_id.

Elsewhere

Scheduled shows use POST /2/broadcasts/scheduled. List and get prefer routes without the user id.

Whitelist only. OAuth 2.0 with broadcast.read and broadcast.write, or OAuth 1.0a. Protected accounts cannot broadcast.