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

# Livestream API

> Create and manage live video broadcasts on X with the Livestream API: persistent RTMP/RTMPS stream sources, the full broadcast lifecycle, and reading and sending live chat messages.

The X Livestream API enables authorized third-party applications and services to create and manage live video broadcasts on X.

It provides a complete set of endpoints for the broadcast lifecycle:

* Managing persistent RTMP/RTMPS **stream sources** (ingest points)
* Creating, publishing (going live), monitoring, and ending **broadcasts**
* Creating and managing **scheduled broadcasts** with one-time and recurring schedules
* **Reading live chat** via the X Activity API
* **Sending chat messages** to live broadcasts
* **Moderating live chat** by removing messages and muting users

Endpoints are hosted under `https://api.x.com`.

<CardGroup cols={3}>
  <Card title="Get started" icon="rocket" href="/livestream-api/getting-started">
    Prerequisites, access, and credentials.
  </Card>

  <Card title="Typical workflow" icon="list-check" href="/livestream-api/typical-workflow">
    From stream source to live broadcast, step by step.
  </Card>

  <Card title="Request access" icon="key" href="/forms/livestream-api-access">
    Submit the Livestream API Access Form for review.
  </Card>
</CardGroup>

***

## Core concepts

Two resources form the core of the API:

* **Stream Source** — A persistent RTMP/RTMPS ingest point (an ingest URL plus a unique stream key). You create a source once for an encoder/region and reuse it across many broadcasts. A source exists independently of any broadcast.
* **Broadcast** — An ephemeral live session bound to a source. A broadcast moves through a lifecycle (`NOT_STARTED` → `RUNNING` → `ENDED`) and represents a single "go live" event that viewers watch on X.

The typical flow is: create a source → start your encoder → create a broadcast → publish (go live) → end. Sources are reusable; broadcasts are one-time sessions.

You can also schedule broadcasts in advance — one-time or recurring — with the [Livestream Scheduling API](/livestream-api/scheduled-broadcasts/overview). Scheduled broadcasts publish automatically at their scheduled start time or wait for an explicit go-live request.

### Key identifiers

| Identifier | Example | What it is |
| :- | :- | :- |
| Source id | `6ep48v6ar5q4` | Identifies a stream source. Also returned as `rtmp_stream_key`. |
| Stream key | `6ep48v6ar5q4` | Push your encoder feed to the source's `rtmps_url` using this key. |
| Broadcast id | `1AxRnanzLOrxl` | Identifies a broadcast (`id` / `broadcast_id`). Used in the broadcast endpoints, as the chat room, and to send chat messages. |
| Scheduled broadcast id | `2075599796786561024` | Identifies a scheduled broadcast (`scheduled_broadcast_id`). Numeric scheduler id required in the body of update requests. |
| Media key | `28_2026675106832068613` | Identifies the media for chat/playback (`media_key`). Used to obtain a chat token. |
