# Multistreaming walkthrough

Multistreaming — Livepush calls it *simulcast* — takes one incoming RTMP feed and
republishes it to several platforms at once. This walkthrough goes from an empty account
to a stream with three live destinations.

## 1. Create the stream

```bash
curl -X POST 'https://octopus.livepush.io/streams' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"category": "simulcast", "name": "Weekly show"}'
```

Keep the returned stream `id` — every later call needs it.

## 2. Attach destinations

Each destination is a platform you want the feed republished to. You supply the RTMP
ingest URL and stream key that the platform gave you.

```bash
curl -X POST 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/destinations' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "label": "YouTube",
    "appName": "youtube",
    "rtmpBase": "rtmp://a.rtmp.youtube.com/live2",
    "rtmpKey": "xxxx-xxxx-xxxx-xxxx"
  }'
```

Repeat for each platform. `label` is what you will see in the dashboard; `appName`
identifies the platform type.

Destination keys are write-only. When you later read the stream back with
[Get stream by ID](/streams/get-stream-by-id/), the key is masked.

## 3. Enable and disable without deleting

A destination can be toggled between broadcasts, which is the right way to skip a
platform for one show:

```bash
# Skip Facebook this week
curl -X PUT 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/destinations/pb_xxxxxxxxxxxx/disable' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'

# Bring it back next week
curl -X PUT 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/destinations/pb_xxxxxxxxxxxx/enable' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
```

Use [Delete stream destination](/destinations/delete-stream-destination/) only when the
destination is gone for good — deleting discards the stored RTMP credentials, so you
would have to re-enter the key to bring it back.

## 4. Go live

Point your encoder at the stream's ingest URL. Enabled destinations begin receiving the
feed as soon as the stream is online; disabled ones stay idle.

## 5. Collect the recording

After the broadcast, [List stream recordings by stream](/stream-recordings/list-stream-recordings-by-stream/)
returns the recordings produced for that stream. Entries can be completed, queued, or
errored, so check the state before assuming a file is ready. A recording marked as
cleaned has already been purged from storage.

## Reusing destinations across streams

[List saved destinations](/destinations/list-saved-destinations/) returns the destinations
saved on your account rather than the ones attached to a single stream. It is the right
call when you are building a picker UI — show the user their saved platforms, then attach
the chosen ones to the new stream.
