Skip to main content
Access to the Livestream API is limited to whitelisted apps. To use it, you need the following:
1

Livestream API access

Your X application (OAuth client) must be whitelisted for the Livestream API. To request access, submit the Livestream API Access Form.
2

OAuth credentials

All Livestream endpoints support both OAuth 2.0 and OAuth 1.0a. OAuth 2.0 is the recommended method: request the broadcast.read and broadcast.write scopes at minimum, which cover most operations. OAuth 1.0a is still accepted for existing integrations. Store your credentials securely.
3

User permissions

The broadcasting account must have permission to go live. Protected/private X accounts are not permitted to create broadcasts.
4

RTMP encoder

You will need an external encoder (e.g., ffmpeg or similar) to push video to the RTMPS ingest URL provided by a stream source.

Finding your user ID

The Livestream endpoints enforce that the numeric X user ID from the access token must exactly match the :user_id in the URL path. Mismatches are rejected with HTTP 400 Bad Request. A common way to obtain the user ID is to call GET /2/users/me using the same credentials you will use for the Livestream endpoints.
When using OAuth 1.0a, the numeric user ID is also the prefix of the access token, before the - — e.g. 172483972-xxxxx → 172483972 — so you can avoid an extra request.
Example response from GET /2/users/me:

Next steps

Authentication

How to sign requests with OAuth 2.0 or OAuth 1.0a.

Typical workflow

The end-to-end flow from source to live broadcast.