> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Prerequisites for the X Livestream API: whitelisted app access, OAuth credentials (OAuth 2.0 recommended, OAuth 1.0a also supported), user permissions, and an RTMP encoder.

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

<Steps>
  <Step title="Livestream API access">
    Your X application (OAuth client) must be whitelisted for the Livestream API. To request access, submit the [Livestream API Access Form](/forms/livestream-api-access).
  </Step>

  <Step title="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.
  </Step>

  <Step title="User permissions">
    The broadcasting account must have permission to go live. Protected/private X accounts are not permitted to create broadcasts.
  </Step>

  <Step title="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.
  </Step>
</Steps>

## 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.

<Tip>
  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.
</Tip>

Example response from `GET /2/users/me`:

```json theme={null}
{
  "data": {
    "id": "172483972",
    "name": "Example User",
    "username": "example",
    "verified": true,
    "verified_type": "blue",
    "subscription_type": "Premium",
    "public_metrics": { ... },
    "profile_image_url": "..."
  }
}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/livestream-api/authentication">
    How to sign requests with OAuth 2.0 or OAuth 1.0a.
  </Card>

  <Card title="Typical workflow" icon="list-check" href="/livestream-api/typical-workflow">
    The end-to-end flow from source to live broadcast.
  </Card>
</CardGroup>
