Where you are: docs → reference → api → playout Read this first: api.md See also: playout.md · subsystems/playout.md
TL;DR Forty-seven endpoints drive the playout channel engine: channel transport (start/stop/next/previous/jump), manual vs. auto mode, playlist loading, pod boards (20 endpoints for pod CRUD and lifecycle), pod templates (CRUD), BXF import, as-run logs (query / export / reset), asset-cache inspection and eviction, health and recovery, and sample/clip/template/saved-playlist discovery. Channels are addressed as 1..N (capped by playout.MaxChannels); pod IDs are strings assigned by the pod board.
Purpose: list all channel states.
Handler: control/api_playout.go → (*API).handlePlayoutChannelsList. Response 200: []playout.ChannelState.
Handler: (*API).handlePlayoutChannelGet. Response 200: one playout.ChannelState. Errors: 400 (playout.ErrInvalidChannel).
Purpose: load a playlist into a channel. Triggers the prefetcher to cache assets.
Handler: (*API).handlePlayoutLoad.
Request body: playout.Playlist.
Errors: 400 (invalid channel, playout.ErrEmptyPlaylist, playout.ErrInvalidItem), 409 (playout.ErrAlreadyOnAir).
Handler: (*API).handlePlayoutStart. Errors: 400 (playout.ErrNoPlaylist), 409 (playout.ErrAlreadyOnAir).
Handler: (*API).handlePlayoutStop. Errors: 400 (playout.ErrNotOnAir).
Handler: (*API).handlePlayoutNext.
Handler: (*API).handlePlayoutPrevious.
Purpose: jump to a playlist item by ID.
Handler: (*API).handlePlayoutJump. Request body: { "itemId": "item-17" }. Errors: 400 (missing ID), 404 (playout.ErrItemNotFound).
Purpose: take manual control — stop auto-advancing the playlist.
Handler: (*API).handlePlayoutTakeManual.
Purpose: return to auto-advance mode.
Handler: (*API).handlePlayoutReturnToAuto.
Purpose: return the loaded playlist items.
Handler: (*API).handlePlayoutPlaylist. Response 200: []playout.PlaylistItem.
Purpose: query the as-run event log, filtered by type and/or since-timestamp.
Handler: (*API).handlePlayoutAsRunQuery.
Query: ?type=<event type>&since=<ms>&limit=<int>.
Response 200: []playout.AsRunEvent.
Purpose: export the as-run log as JSONL.
Handler: (*API).handlePlayoutAsRunExport. Response 200: application/x-ndjson.
Purpose: reset the as-run log (clear ring buffer + truncate JSONL file).
Handler: (*API).handlePlayoutAsRunReset.
Purpose: import a BXF (Broadcast Exchange Format, SMPTE) XML file as a playlist.
Handler: (*API).handlePlayoutBXFImport.
Request: application/xml body.
Response 200: playout.Playlist.
Errors: 400 (invalid XML, validation failure).
Purpose: return health info for all channels (watchdog stalls, last-recovery).
Handler: (*API).handlePlayoutHealth.
Purpose: trigger a manual recovery on a stalled channel.
Handler: (*API).handlePlayoutRecover.
Purpose: return aggregate cache status (bytes used, entries, hit rate).
Handler: (*API).handlePlayoutCacheStatus. Errors: 501.
Purpose: look up cache status for an asset by URI.
Handler: (*API).handlePlayoutCacheLookup.
Request body: { "asset_uri": "https://.../clip.mp4" }.
Purpose: evict an asset from the cache.
Handler: (*API).handlePlayoutCacheEvict. Response 200: { "status": "evicted" }.
Purpose: return built-in sample clips (pre-generated via FFmpeg at startup).
Handler: (*API).handlePlayoutSamples.
Purpose: return the clip library as playlist-compatible items.
Handler: (*API).handlePlayoutClips.
Purpose: list built-in template playlists.
Handler: (*API).handlePlayoutTemplates.
Handler: (*API).handlePlayoutTemplate. Response 200: playout.Playlist. Errors: 404.
Handler: (*API).handlePlayoutSavedList.
Purpose: save a playlist to disk.
Handler: (*API).handlePlayoutSave. Request body: { "name": "morning-show", "playlist": { ... } }.
Handler: (*API).handlePlayoutSavedGet. Response 200: playout.Playlist.
Handler: (*API).handlePlayoutSavedDelete.
Pods are timed secondary events (cut-ins, squeezebacks, overlays) associated with a primary playlist item. The pod board manages their lifecycle: arm → fire → hold → extend → dump. See playout.md#pods for the state machine.
Handler: control/api_playout_pods.go → (*API).handlePodList. Response 200: []playout.PodStatus.
Purpose: create a pod on a channel.
Handler: (*API).handlePodCreate. Request body: playout.PodConfig.
Handler: (*API).handlePodGet. Errors: 404 (playout.ErrPodNotFound).
Handler: (*API).handlePodDelete.
Purpose: arm a pod (prep for fire).
Handler: (*API).handlePodArm. Errors: 400 (playout.ErrPodTerminal), 409 (playout.ErrPodAlreadyActive).
Handler: (*API).handlePodDisarm.
Purpose: fire an armed pod (start execution).
Handler: (*API).handlePodFire. Errors: 400 (playout.ErrPodNotArmed).
Purpose: defer a pod's scheduled fire time.
Handler: (*API).handlePodDefer. Request body: { "deferMs": 5000 }.
Purpose: pause an active pod (extends its display).
Handler: (*API).handlePodHold. Errors: 400 (playout.ErrPodNotActive).
Purpose: extend an active pod's duration.
Handler: (*API).handlePodExtend. Request body: { "durationMs": 10000 }.
Purpose: short-circuit an active pod (cut to its exit).
Handler: (*API).handlePodDump. Errors: 403 (playout.ErrPodNoDumpOut).
Purpose: reorder a pod in the queue.
Handler: (*API).handlePodMove. Request body: { "position": 3 }.
Purpose: swap with another pod in the queue.
Handler: (*API).handlePodSwap. Request body: { "otherPodId": "pod-5" }.
Purpose: resize the pod's visual area (for graphic / cut-in pods).
Handler: (*API).handlePodResize.
Purpose: elevate the pod's priority (e.g., promote a secondary to primary).
Handler: (*API).handlePodPromote.
Handler: (*API).handlePodDemote.
Handler: (*API).handlePodTemplateList. Response 200: []playout.PodTemplate.
Handler: (*API).handlePodTemplateCreate.
Handler: (*API).handlePodTemplateUpdate.
Handler: (*API).handlePodTemplateDelete.
- Concepts: playout.md
- Reference: api.md · state-broadcast.md
- Subsystems: playout.md