Skip to content

Schedule a program on a channel

Use this guide to put a program on a channel at a set time and send the schedule to the channel's streamers. For the fields and rules, see the Scheduling API.

Before you begin

  • Your role in the workspace has workspace:schedules:manage.
  • You have a channel: see Create a live channel and the Playback API. It needs at least one origin on a streamer.
  • You have a media file that has finished processing (its duration is known), and know its ID. See the Media API. Media on one channel should share video codec, profile, pixel format and audio codec.

Steps

  1. Create a slot with a new program. The end time is set from the media's duration:

    curl -s -X POST "https://<API_HOST>/api/v1/scheduling/<WORKSPACE_ID>/slots" \
      -H "Authorization: Bearer <ACCESS_TOKEN>" \
      -H "Content-Type: application/json" \
      -d '{
        "channelId": <CHANNEL_ID>,
        "type": "promo",
        "startTime": "2026-11-17T18:00:00Z",
        "program": { "title": "Evening news", "description": "Daily bulletin", "mediaId": <MEDIA_ID> }
      }'
    

    You get 201 Created with the slot in draft status and its endTime. Note the slot id and programId. To air the same program again later, send "programId": <PROGRAM_ID> instead of program.

  2. Approve the slot. Only approved slots are sent to the streamers:

    curl -s -X PUT "https://<API_HOST>/api/v1/scheduling/<WORKSPACE_ID>/slots/<SLOT_ID>" \
      -H "Authorization: Bearer <ACCESS_TOKEN>" \
      -H "Content-Type: application/json" \
      -d '{ "status": "approved" }'
    

    You get 200 OK with "status": "approved".

  3. Sync the channel:

    curl -s -X POST "https://<API_HOST>/api/v1/scheduling/<WORKSPACE_ID>/sync/<CHANNEL_ID>" \
      -H "Authorization: Bearer <ACCESS_TOKEN>"
    

    You get 200 OK:

    { "success": true, "data": { "channelId": 42, "synced": true } }
    

    Run the sync again after you approve, move or delete slots.

Verify

Read the guide for the day:

curl -s "https://<API_HOST>/api/v1/scheduling/<WORKSPACE_ID>/epg/<CHANNEL_ID>?date=2026-11-17" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"

The slot is in data.slots. For a guide overlay, GET /epg/<CHANNEL_ID>/now returns the slot airing now (now) and the next one (next). All times are UTC: convert them to the viewer's time zone for display.

Troubleshooting

Symptom Cause Fix
409 overlaps with existing slot(s) Another slot on the channel covers part of that time Choose another start time. A slot that starts when another ends is fine.
400 media duration is unknown The media is still processing Wait until processing finishes, then retry.
400 codec mismatch The media differs from other media on the channel Use media with the same codec, profile, pixel format and audio codec.
400 channelId does not refer to a channel in this workspace Wrong channel or workspace Check the IDs.
502 on sync The channel has no origins, or a streamer refused the schedule Read the message for the origin, fix it and sync again.

Next steps