Skip to content

Scheduling API

The Scheduling API plans what airs on the channels of a workspace and when. You create program slots, read the program guide (EPG) for a day, and sync a channel's approved slots to its streamers.

Resources

Resource What it is
Program What airs: a title and description wrapped around one media file. Created together with a slot, and reusable in later slots.
Slot One airing of a program on a channel, with a start and end time, a type and a status.
Program guide (EPG) The slots of one day, per channel, or the slot airing now and next on one channel.

Authentication and permissions

All routes need a bearer token. See Authentication.

Action Permission
List, get and read the guide (slots, EPG, now and next) workspace:schedules:view
Create, update and delete slots; sync a channel workspace:schedules:manage

Base path

Served by CoreAPI:

https://<API_HOST>/api/v1/scheduling/{workspaceId}/…

{workspaceId} is the workspace you act in. Channels come from the Playback API and media from the Media API. Shared rules are in API conventions.

Capabilities

  • Slot create, read, update and delete
  • Overlap check on create: no two slots on a channel overlap
  • Program guide for all channels or one, for a UTC day, and now and next
  • Sync of approved slots to every origin of a channel
  • Blackout rules for regions or subscriber tiers (planned)
  • Recurring slots (planned)
  • Bulk import of guide data (planned)
  • Events when a slot starts (planned)

Object model

Slot

Field Type On create Description
id integer read-only Slot ID.
channelId integer required A channel of this workspace.
type string required, write-once blackout, promo, event_window or emergency. emergency is an immediate action kept for history.
startTime string required Start, ISO 8601 UTC. Update it with PUT.
endTime string read-only Start plus the media's duration. You can't send it: a streamer plays a file to its end.
programId integer one of programId or program An existing program of this workspace.
program object one of programId or program On create: title (required), description, mediaId (required, a processed media file). In responses: the program with its media.
status string read-only draft at creation. See States.
createdAt, updatedAt string read-only ISO 8601, UTC.
{
  "id": 310,
  "channelId": 42,
  "programId": 77,
  "type": "promo",
  "startTime": "2026-11-17T18:00:00Z",
  "endTime": "2026-11-17T18:30:00Z",
  "status": "draft",
  "program": { "id": 77, "title": "Evening news", "description": "Daily bulletin", "mediaId": 15 }
}

Program guide

GET /epg returns one row per channel of the workspace, ordered by channelSid:

{
  "success": true,
  "data": [
    { "channelId": 42, "channelName": "Lobby Loop", "channelSid": 201, "slots": [ { "id": 310, "…": "…" } ] },
    { "channelId": 43, "channelName": "News 24", "channelSid": 101, "slots": [] }
  ]
}

Channels with no slots that day have slots: []. With no channels, data is []. date is a UTC day (YYYY-MM-DD), default today. Slots that overlap the day are included, so a slot that started the day before shows up. All times are UTC: convert them for display.

Lists

GET /slots is paginated with page (from 1, default 1) and limit (default 10, maximum 100; larger values become 100). Results are ordered by startTime, earliest first. The meta object reports the totals. The guide routes (/epg) are not paginated: they return every channel of the workspace for the day.

curl "https://<API_HOST>/api/v1/scheduling/{workspaceId}/slots?channelId=42&limit=2" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
{
  "success": true,
  "data": [
    {
      "id": 310,
      "channelId": 42,
      "programId": 77,
      "type": "promo",
      "startTime": "2026-11-17T18:00:00Z",
      "endTime": "2026-11-17T18:30:00Z",
      "status": "draft",
      "program": { "id": 77, "title": "Evening news", "description": "Daily bulletin", "mediaId": 15 }
    }
  ],
  "meta": {
    "count": 1,
    "total": 1,
    "page": 1,
    "limit": 2,
    "total_pages": 1,
    "has_next": false,
    "has_prev": false,
    "timestamp": "2026-11-18T09:30:00Z"
  }
}

States

Status Meaning Next
draft Planned. Not sent to streamers. approved
approved Included in the next sync of the channel. active or completed, or back to draft
active Airing. completed
completed Done. Ignored by the overlap check. none

You set the status with PUT /slots/{id}; the server doesn't change it on its own and doesn't limit which status you move to. Only approved slots are synced.

Errors

Errors have the body { "success": false, "error": "<message>" }. A 401 or 403 from the sign-in check has { "message": "<message>" }.

Status When What to do
400 A field is missing or invalid; channelId, programId or mediaId isn't in this workspace; both or neither of programId and program; the media's duration is unknown (still processing); the media's codec, profile, pixel format or audio codec differs from other media scheduled on the channel; date isn't YYYY-MM-DD. Read error and fix the request. Wait for processing to finish.
401 No valid access token. Sign in again or refresh the token.
403 Your role lacks the permission or you aren't a member of the workspace. Ask an organization admin for the role.
404 The slot or channel doesn't exist in this workspace. Check the ID and workspace.
409 On create: the slot overlaps another slot on the channel that isn't completed. The message names it. Touching slots (one ends when the next starts) are fine. Choose another start time.
502 On sync: the channel has no origins, or a streamer didn't accept the schedule. The message lists the origins. Fix the streamer or channel, then sync again.

Example bodies:

{ "success": false, "error": "exactly one of programId or program must be provided" }

400, and the same shape for 404 ("schedule slot not found", "channel not found"), 409 ("overlaps with existing slot(s): …") and 502.

{ "message": "Unauthorized - No token provided" }

401. The text after the dash changes with the cause (for example Invalid token format).

{ "message": "Forbidden - Insufficient permissions" }

403. A 500 has the { "success": false, "error": "<message>" } shape.

PUT /slots/{id} does not check for overlaps, so a moved slot can overlap another one. Check the guide after moving.

Endpoints