# Pre-recorded streams

A pre-recorded live stream plays videos from your library as if they were live — no
encoder, no machine to keep running. Livepush calls this a *schedule* stream.

## 1. Create a schedule stream

```bash
curl -X POST 'https://octopus.livepush.io/streams' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"category": "schedule", "name": "24/7 replay channel"}'
```

The `category` must be `schedule`. A `simulcast` stream has no scheduler.

## 2. Build the playlist

The playlist defines playback order. Attach videos you already have in the library —
list them with [Get user videos](/videos/get-user-videos/), or bring new ones in via
[video imports](/video-imports/start-a-new-video-import/).

```bash
curl -X PUT 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/config/scheduler/playlist' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"videos": ["vid_aaaaaaaa", "vid_bbbbbbbb", "vid_cccccccc"]}'
```

This call replaces the playlist rather than appending to it — send the full ordered list
every time.

## 3. Choose one-off or continuous

For a channel that never stops, turn on looping:

```bash
curl -X PUT 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/config/scheduler/loop' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"enabled": true}'
```

With looping enabled the playlist repeats indefinitely, which is how a 24/7 pre-recorded
channel is built.

## 4. Schedule the event

```bash
curl -X POST 'https://octopus.livepush.io/streams/st_xxxxxxxxxxxxx/config/scheduler/events' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "label": "Sunday replay",
    "datetime": "2026-02-01T18:00:00.000Z",
    "immediateStart": false,
    "loop": false
  }'
```

`datetime` is the start time. Set `immediateStart` to `true` to begin as soon as the
event is created rather than waiting for the clock. The optional `videos` field overrides
the stream playlist for this event only.

## 5. Cancel or stop

Before an event starts, remove it with
[Delete scheduled stream event](/stream-scheduler/delete-scheduled-stream-event/). The
stream configuration and playlist are untouched.

Once it is running, use
[End active scheduled stream](/stream-scheduler/end-active-scheduled-stream/). Stopping
is not instantaneous — playback and destination disconnects take a few seconds to
settle, so poll rather than assuming the stream is down the moment the call returns.

## Combining with multistreaming

A schedule stream can carry destinations just like a simulcast stream. Attach them with
[Create new stream destination](/destinations/create-new-stream-destination/) and the
pre-recorded playout is republished to those platforms.
