{"openapi":"3.1.0","info":{"title":"RadioEngine API","version":"0.0.0-dev","description":"REST API of RadioEngine. Conventions (errors, pagination, idempotency) are in docs/contracts/api.md."},"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"re_session"},"apiKey":{"type":"http","scheme":"bearer","description":"An API key: `Authorization: Bearer rek_…`"},"nodeToken":{"type":"http","scheme":"bearer","description":"A node token, valid only on /v1/engine/*: `Authorization: Bearer ren_…`"}},"schemas":{"ActivityPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false,"description":"Who changed what, newest first: event envelopes that have an `actor`. Page with `next_cursor` until it is null.","examples":[{"items":[{"id":"0192f0c8-0000-7000-8000-000000000005","type":"config.changed","station_id":"0192f0c4-0000-7000-8000-000000000001","created_at":"2026-10-01T14:12:30.120Z","actor":{"type":"user","id":"0192f0d0-0000-7000-8000-000000000001","name":"Ali"},"data":{"object":"output","object_id":"0192f0ce-0000-7000-8000-000000000001","action":"updated","name":"mp3","fields":["bitrate_kbps"]}},{"id":"0192f0c8-0000-7000-8000-000000000004","type":"programming.changed","station_id":"0192f0c4-0000-7000-8000-000000000001","created_at":"2026-10-01T14:05:02.400Z","actor":{"type":"api_key","id":"0192f0d1-0000-7000-8000-000000000001","name":"Newsroom automation"},"data":{"station_id":"0192f0c4-0000-7000-8000-000000000001","parts":["clocks"]}},{"id":"0192f0c8-0000-7000-8000-000000000003","type":"config.changed","station_id":null,"created_at":"2026-10-01T13:58:41.007Z","actor":{"type":"user","id":"0192f0d0-0000-7000-8000-000000000001","name":"Ali"},"data":{"object":"invitation","object_id":"0192f0d9-0000-7000-8000-000000000001","action":"created","name":"Morning Editor","fields":[]}}],"next_cursor":"0192f0c8-0000-7000-8000-000000000003"}]},"Alert":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["feed.late","feed.not_synced","node.offline","node.disk_low","station.not_reporting","station.fallback","station.silence","station.playback_failed","output.failed","media.analysis_failed","webhook.disabled"]},"severity":{"type":"string","enum":["info","warning","critical"]},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"feed_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"message":{"type":"string"},"dedupe_key":{"type":"string"},"details":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"opened_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"acknowledged_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","kind","severity","station_id","node_id","feed_id","message","dedupe_key","details","opened_at","resolved_at","acknowledged_at","acknowledged_by","created_at"],"additionalProperties":false,"description":"A problem detected before listeners notice. It opens and resolves on its own (`alert.opened` and `alert.resolved` events); acknowledging it only marks it as seen. `details` depends on `kind` (api.md §Alerts).","examples":[{"id":"0192f0d6-0000-7000-8000-000000000001","kind":"feed.late","severity":"warning","station_id":null,"node_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","message":"Feed \"News (hourly)\" is late: nothing valid for the slot at 2026-10-01T15:00:00.000Z on Rock FM","dedupe_key":"feed.late:0192f0c5-0000-7000-8000-000000000001","details":{"slot_at":"2026-10-01T15:00:00.000Z","deadline_at":"2026-10-01T14:55:00.000Z","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"expected_interval_minutes":60,"alert_lead_minutes":5,"latest_valid_from":"2026-10-01T13:55:00.000Z"},"opened_at":"2026-10-01T14:55:04.310Z","resolved_at":null,"acknowledged_at":"2026-10-01T14:56:40.000Z","acknowledged_by":"0192f0d0-0000-7000-8000-000000000001","created_at":"2026-10-01T14:55:04.310Z"},{"id":"0192f0d6-0000-7000-8000-000000000001","kind":"feed.late","severity":"warning","station_id":null,"node_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","message":"Feed \"News (hourly)\" is late: nothing valid for the slot at 2026-10-01T15:00:00.000Z on Rock FM","dedupe_key":"feed.late:0192f0c5-0000-7000-8000-000000000001","details":{"slot_at":"2026-10-01T15:00:00.000Z","deadline_at":"2026-10-01T14:55:00.000Z","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"expected_interval_minutes":60,"alert_lead_minutes":5,"latest_valid_from":"2026-10-01T13:55:00.000Z"},"opened_at":"2026-10-01T14:55:04.310Z","resolved_at":null,"acknowledged_at":null,"acknowledged_by":null,"created_at":"2026-10-01T14:55:04.310Z"}]},"AlertPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Alert"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false,"examples":[{"items":[{"id":"0192f0d6-0000-7000-8000-000000000001","kind":"feed.late","severity":"warning","station_id":null,"node_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","message":"Feed \"News (hourly)\" is late: nothing valid for the slot at 2026-10-01T15:00:00.000Z on Rock FM","dedupe_key":"feed.late:0192f0c5-0000-7000-8000-000000000001","details":{"slot_at":"2026-10-01T15:00:00.000Z","deadline_at":"2026-10-01T14:55:00.000Z","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"expected_interval_minutes":60,"alert_lead_minutes":5,"latest_valid_from":"2026-10-01T13:55:00.000Z"},"opened_at":"2026-10-01T14:55:04.310Z","resolved_at":null,"acknowledged_at":null,"acknowledged_by":null,"created_at":"2026-10-01T14:55:04.310Z"}],"next_cursor":null}]},"ApiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first 12 characters of the key, to recognize it."},"scopes":{"type":"array","items":{"type":"string","enum":["read","content:write","schedule:write","feeds:write","log:write","control","admin"]},"description":"Literal: unlike the admin role, `admin` doesn't include `read` unless listed."},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"The stations the key may touch; null means all. Other stations return `403 station_forbidden`."},"created_by":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The user who created the key; null when an API key did."},"last_used_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Updated at most once a minute."},"revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Set by `DELETE /v1/api-keys/{id}`."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","prefix","scopes","station_ids","created_by","last_used_at","revoked_at","created_at"],"additionalProperties":false,"description":"An API key for automation. The key itself is shown only once, when created.","examples":[{"id":"0192f0d1-0000-7000-8000-000000000001","name":"News automation","prefix":"rek_T3xg9Qm2","scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"created_by":"0192f0d0-0000-7000-8000-000000000001","last_used_at":"2026-10-01T13:55:02.000Z","revoked_at":null,"created_at":"2026-09-15T10:12:44.000Z"}]},"AsPlayed":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The engine's `item.started` `event_id`."},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The node that played it. Null after the node was deleted."},"log_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null for fallback and filler items, and once the log item is gone (log items are kept 7 days)."},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null after the media item was deleted; `title`, `artist`, `isrc` and `kind` keep its details."},"feed_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The feed item, when a feed slot played it."},"origin":{"type":"string","enum":["log","fallback","filler"],"description":"`log` for an item of the log; `fallback` and `filler` for what the station played on its own."},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ended_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Null while it plays."},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"`ended_at − started_at`. Null while it plays."},"end_reason":{"anyOf":[{"type":"string","enum":["completed","faded","skipped","failed","interrupted"]},{"type":"null"}],"description":"`completed`, `faded` (faded out at a hard start), `skipped`, `failed` or `interrupted` (the station stopped). Null while it plays."},"title":{"description":"The media's title when it started (a snapshot).","type":["string","null"]},"artist":{"description":"The media's artist when it started (a snapshot).","type":["string","null"]},"isrc":{"description":"The media's ISRC when it started (a snapshot).","type":["string","null"]},"kind":{"anyOf":[{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},{"type":"null"}],"description":"The media's kind when it started (a snapshot)."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the API recorded the play: later than `started_at` when the station's outbox was replayed."}},"required":["id","station_id","node_id","log_item_id","media_item_id","feed_item_id","origin","started_at","ended_at","duration_ms","end_reason","title","artist","isrc","kind","created_at"],"additionalProperties":false,"description":"One play of the as-played log: what aired, when and for how long, with a snapshot of the media's metadata. Kept forever, for reports.","examples":[{"id":"0192f0c7-0000-7000-8000-000000000002","station_id":"0192f0c4-0000-7000-8000-000000000001","node_id":"0192f0cf-0000-7000-8000-000000000001","log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_item_id":null,"origin":"log","started_at":"2026-10-01T13:58:12.400Z","ended_at":"2026-10-01T14:00:00.000Z","duration_ms":107600,"end_reason":"faded","title":"Neon Harbor","artist":"The Night Signals","isrc":"DEZ652600117","kind":"music","created_at":"2026-10-01T13:58:12.437Z"}]},"Category":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null for a shared category, which every station can use."},"name":{"type":"string"},"mode":{"type":"string","enum":["static","filter"],"description":"`static`: a list of media items (`PUT /v1/categories/{id}/items`). `filter`: the media items that match `filter`."},"filter":{"anyOf":[{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}},"tags_all":{"type":"array","items":{"type":"string","minLength":1}},"tags_any":{"type":"array","items":{"type":"string","minLength":1}},"tags_none":{"type":"array","items":{"type":"string","minLength":1}},"source_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"folders":{"type":"array","items":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"type":"string","maxLength":1024}},"required":["source_id","path"],"additionalProperties":false}},"artists":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"albums":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"genres":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"year_min":{"type":"integer","minimum":0,"maximum":9999},"year_max":{"type":"integer","minimum":0,"maximum":9999},"min_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"video":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}],"description":"Set when `mode` is `filter`: every given field must match."},"rotation":{"type":"string","enum":["least_recent","weighted_random","shuffle","sequential"],"description":"How the planner picks the next item."},"color":{"description":"A hex color such as `#16a34a`, or null.","type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","station_id","name","mode","filter","rotation","color","created_at","updated_at"],"additionalProperties":false,"description":"A pool of media items that clock slots pick from, with its rotation. A category belongs to a station, or is shared by all of them.","examples":[{"id":"0192f0ca-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"Rock","mode":"filter","filter":{"kinds":["music"],"tags_all":["rock"],"min_duration_ms":120000},"rotation":"least_recent","color":"#dc2626","created_at":"2026-09-01T09:30:00.000Z","updated_at":"2026-09-01T09:30:00.000Z"}]},"CategoryFilterPreview":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many media items the filter selects for this station."},"avg_duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Their average audible length (cue out − cue in), over the analyzed ones. Null when none is analyzed."},"sample":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"status":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","source_id","kind","status","title","artist","album","duration_ms"],"additionalProperties":false,"description":"A summary of the media item."},"description":"The first 10 of them by title (ignoring case)."}},"required":["count","avg_duration_ms","sample"],"additionalProperties":false,"description":"What a category filter would select for a station (its sources only), before it is saved.","examples":[{"count":312,"avg_duration_ms":236410,"sample":[{"id":"0192f0c1-0000-7000-8000-000000000001","source_id":"0192f0c9-0000-7000-8000-000000000001","kind":"music","status":"ready","title":"Highway Static","artist":"The Sine Waves","album":"Pure Tones","duration_ms":214000}]}]},"CategoryInUseProblem":{"type":"object","properties":{"type":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"code":{"type":"string","minLength":1},"detail":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string","minLength":1}},"required":["path","message"],"additionalProperties":false}},"details":{"description":"With `category_in_use` from `PATCH /v1/categories/{id}` (`shared: false`): the stations that still use the category.","type":"object","properties":{"stations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"description":"The other stations that use the category, by slug."}},"required":["stations"],"additionalProperties":false}},"required":["type","title","status","code","detail"],"additionalProperties":false,"description":"A conflict when changing a category. `category_in_use` while taking a shared category back for one station carries the other stations that use it in `details.stations`; `name_taken` doesn't.","examples":[{"type":"about:blank","title":"Conflict","status":409,"code":"category_in_use","detail":"Other stations use this shared category (talk): through their clocks, pad, rotation rules, fallback or filler. Remove those uses first.","details":{"stations":[{"id":"0192f0c4-0000-7000-8000-000000000002","slug":"talk","name":"Talk Radio"}]}}]},"CategoryItems":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"number"}},"required":["media_item_id","position","weight"],"additionalProperties":false}},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["items","count"],"additionalProperties":false,"description":"A static category's items as stored, in position order.","examples":[{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000003","position":0,"weight":1},{"media_item_id":"0192f0c1-0000-7000-8000-000000000005","position":1,"weight":2}],"count":2}]},"CategoryItemsBulkResult":{"type":"object","properties":{"added":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Items appended to the list."},"removed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Items taken out of the list."},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Items in the list afterwards."}},"required":["added","removed","count"],"additionalProperties":false,"description":"What a bulk change did to a static category's list.","examples":[{"added":60,"removed":0,"count":312}]},"CategoryMember":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Static categories: the item's position (0-based). Null for filter categories."},"weight":{"description":"Static categories: the item's weight for `weighted_random`. Null for filter categories.","type":["number","null"]},"media":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"status":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","source_id","kind","status","title","artist","album","duration_ms"],"additionalProperties":false,"description":"A summary of the media item."}},"required":["media_item_id","position","weight","media"],"additionalProperties":false,"description":"A media item that a category can pick.","examples":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000003","position":0,"weight":1,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","source_id":"0192f0c9-0000-7000-8000-000000000001","kind":"station_id","status":"ready","title":"Station ID","artist":null,"album":null,"duration_ms":3200}}]},"CategoryMembersPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CategoryMember"}},"next_cursor":{"type":["string","null"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The number of members in the whole category."}},"required":["items","next_cursor","count"],"additionalProperties":false,"description":"A page of a category's members: a static category's items in position order, or the media items that match a filter category, by id.","examples":[{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000003","position":0,"weight":1,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","source_id":"0192f0c9-0000-7000-8000-000000000001","kind":"station_id","status":"ready","title":"Station ID","artist":null,"album":null,"duration_ms":3200}},{"media_item_id":"0192f0c1-0000-7000-8000-000000000005","position":1,"weight":2,"media":{"id":"0192f0c1-0000-7000-8000-000000000005","source_id":"0192f0c9-0000-7000-8000-000000000001","kind":"jingle","status":"ready","title":"Jingle","artist":null,"album":null,"duration_ms":5000}}],"next_cursor":null,"count":2},{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000001","position":null,"weight":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000001","source_id":"0192f0c9-0000-7000-8000-000000000001","kind":"music","status":"ready","title":"Highway Static","artist":"The Sine Waves","album":"Pure Tones","duration_ms":214000}}],"next_cursor":"0192f0c1-0000-7000-8000-000000000001","count":312}]},"CategoryUsage":{"type":"object","properties":{"clocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slots":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of the clock's slots pick from the category or pad their window with it."}},"required":["id","name","station_id","slots"],"additionalProperties":false},"description":"Clocks with slots that pick from the category or pad their window with it (`pad_category_id`), by station and name."},"rotation_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["song_separation","artist_separation","title_separation","max_plays_per_day","daypart"]},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["id","kind","station_id"],"additionalProperties":false},"description":"Rotation rules scoped to the category."},"stations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"},"roles":{"minItems":1,"type":"array","items":{"type":"string","enum":["fallback","filler"]}}},"required":["id","slug","name","roles"],"additionalProperties":false},"description":"Stations whose fallback or filler category it is, by slug."}},"required":["clocks","rotation_rules","stations"],"additionalProperties":false,"description":"Where a category is used. A category that a clock slot uses (to pick from, or to pad its window with) can't be deleted (`409 category_in_use`).","examples":[{"clocks":[{"id":"0192f0cb-0000-7000-8000-000000000001","name":"Standard hour","station_id":"0192f0c4-0000-7000-8000-000000000001","slots":2}],"rotation_rules":[{"id":"0192f0cd-0000-7000-8000-000000000001","kind":"artist_separation","station_id":"0192f0c4-0000-7000-8000-000000000001"}],"stations":[{"id":"0192f0c4-0000-7000-8000-000000000001","slug":"rock","name":"Rock FM","roles":["fallback"]}]}]},"Clock":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"type":["string","null"]},"duration_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Divides 24 hours evenly. Instances start at station-local midnight and every multiple of it."},"notes":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","station_id","name","color","duration_minutes","notes","created_at","updated_at"],"additionalProperties":false,"description":"A station's clock: a program template that repeats every `duration_minutes`, used by the station's schedule rules and `default_clock_id`. Without its slots.","examples":[{"id":"0192f0cb-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"Standard hour","color":"#16a34a","duration_minutes":60,"notes":"News at :00 (hard anchor), an ident at :30 (soft anchor), music around them.","created_at":"2026-09-01T09:05:00.000Z","updated_at":"2026-09-01T09:05:00.000Z"}]},"ClockDraftPreview":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"instance":{"type":"object","properties":{"instance_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["instance_start_at","start_at","end_at"],"additionalProperties":false},"items":{"type":"array","items":{"$ref":"#/components/schemas/ClockPreviewItem"}},"stats":{"type":"object","properties":{"fill_error_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The largest fill error of the instance's segments: where the content ends minus the anchor it aims for. Positive is an overrun, negative an underrun."},"relaxations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Picks that needed a rotation rule relaxed (the items' `notes` say which)."},"segments":{"type":"array","items":{"type":"object","properties":{"start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the segment's first item starts."},"target_end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The anchor the content aims to end at."},"end_mode":{"type":"string","enum":["hard","soft","none"],"description":"The anchor the segment ends at: `hard` or `soft`, or `none` at the start of the next instance without an anchor."},"end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"Where the content ends: the segue point of the segment's last item into the next item."},"error_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`end_at − target_end_at`: positive is an overrun, negative an underrun."},"within_tolerance":{"type":"boolean","description":"For a hard end, whether the error is within the station's `max_overrun_ms` and `max_underrun_ms`. Soft ends are always within tolerance."},"item_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filler_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Items picked from the filler category to fill an underrun."}},"required":["start_at","target_end_at","end_mode","end_at","error_ms","within_tolerance","item_count","filler_count"],"additionalProperties":false},"description":"The instance split at its anchors."}},"required":["fill_error_ms","relaxations","segments"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["code","message","at"],"additionalProperties":false},"description":"What the planner couldn't do as planned, by `code`: `no_program`, `category_empty`, `media_unavailable`, `pinned_media_unavailable`, `unknown_clock`, `unknown_feed`, `anchor_missed`, `segment_end_skipped` (a segment too short for its `segment_end` slots), `window_overrun` (a window's item, or a feed's estimate, is longer than its `window_ms`: it is faded at the window's end) and `window_unpadded` (neither the filler nor the fallback category filled what a window's item leaves of it). The window warnings name the slot (its label, or its type and what it plays, and its id) and both lengths; they take the place of `anchor_missed` at a window's end."},"slot_ids":{"description":"With `slots`: the id of each slot sent, in the order sent: its own `id`, or the temporary id its items carry in this preview (`clock_slot_id`), which exists only here. Absent without `slots` (the saved slots keep their ids).","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["clock_id","station_id","instance","items","stats","warnings"],"additionalProperties":false,"description":"The dry run of a clock instance with unsaved slots (`POST /v1/clocks/{id}/preview`): a `ClockPreview` plus, when slots were sent, `slot_ids`, so an editor can match the items to the slots it sent.","examples":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","instance":{"instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"},"items":[{"planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":57000,"start_mode":"hard","type":"feed","media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","transition":{"type":"cut"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000001","category_id":null,"notes":null,"media":null,"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"}},{"planned_start_at":"2026-10-01T14:00:57.000Z","planned_duration_ms":4200,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000002","category_id":"0192f0ca-0000-7000-8000-000000000002","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Jingle","artist":null,"album":null,"kind":"jingle","duration_ms":5000},"feed":null},{"planned_start_at":"2026-10-01T14:01:01.200Z","planned_duration_ms":206000,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000001","title":"Northern Lights","artist":"The Wanderers","album":"Open Road","kind":"music","duration_ms":214000},"feed":null},{"planned_start_at":"2026-10-01T14:04:27.200Z","planned_duration_ms":4200,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-00000000000a","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000002","category_id":"0192f0ca-0000-7000-8000-000000000002","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-00000000000a","title":"Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":5000},"feed":null},{"planned_start_at":"2026-10-01T14:04:31.400Z","planned_duration_ms":236500,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000002","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000002","title":"Long Way Home","artist":"Harbor Lights","album":null,"kind":"music","duration_ms":243000},"feed":null}],"stats":{"fill_error_ms":4200,"relaxations":0,"segments":[{"start_at":"2026-10-01T14:00:00.000Z","target_end_at":"2026-10-01T14:30:00.000Z","end_mode":"soft","end_at":"2026-10-01T14:30:04.200Z","error_ms":4200,"within_tolerance":true,"item_count":17,"filler_count":0},{"start_at":"2026-10-01T14:30:04.200Z","target_end_at":"2026-10-01T15:00:00.000Z","end_mode":"hard","end_at":"2026-10-01T14:59:58.500Z","error_ms":-1500,"within_tolerance":true,"item_count":9,"filler_count":0}]},"warnings":[],"slot_ids":["0192f0c3-0000-7000-8000-000000000001","0192f0c3-0000-7000-8000-000000000002","0192f0c3-0000-7000-8000-000000000003","0192f0c3-0000-7000-8000-000000000004","0192f0c3-0000-7000-8000-000000000005","0192f0c3-0000-7000-8000-0000000000f1"]}]},"ClockPreview":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"instance":{"type":"object","properties":{"instance_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["instance_start_at","start_at","end_at"],"additionalProperties":false},"items":{"type":"array","items":{"$ref":"#/components/schemas/ClockPreviewItem"}},"stats":{"type":"object","properties":{"fill_error_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The largest fill error of the instance's segments: where the content ends minus the anchor it aims for. Positive is an overrun, negative an underrun."},"relaxations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Picks that needed a rotation rule relaxed (the items' `notes` say which)."},"segments":{"type":"array","items":{"type":"object","properties":{"start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the segment's first item starts."},"target_end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The anchor the content aims to end at."},"end_mode":{"type":"string","enum":["hard","soft","none"],"description":"The anchor the segment ends at: `hard` or `soft`, or `none` at the start of the next instance without an anchor."},"end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"Where the content ends: the segue point of the segment's last item into the next item."},"error_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`end_at − target_end_at`: positive is an overrun, negative an underrun."},"within_tolerance":{"type":"boolean","description":"For a hard end, whether the error is within the station's `max_overrun_ms` and `max_underrun_ms`. Soft ends are always within tolerance."},"item_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filler_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Items picked from the filler category to fill an underrun."}},"required":["start_at","target_end_at","end_mode","end_at","error_ms","within_tolerance","item_count","filler_count"],"additionalProperties":false},"description":"The instance split at its anchors."}},"required":["fill_error_ms","relaxations","segments"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["code","message","at"],"additionalProperties":false},"description":"What the planner couldn't do as planned, by `code`: `no_program`, `category_empty`, `media_unavailable`, `pinned_media_unavailable`, `unknown_clock`, `unknown_feed`, `anchor_missed`, `segment_end_skipped` (a segment too short for its `segment_end` slots), `window_overrun` (a window's item, or a feed's estimate, is longer than its `window_ms`: it is faded at the window's end) and `window_unpadded` (neither the filler nor the fallback category filled what a window's item leaves of it). The window warnings name the slot (its label, or its type and what it plays, and its id) and both lengths; they take the place of `anchor_missed` at a window's end."}},"required":["clock_id","station_id","instance","items","stats","warnings"],"additionalProperties":false,"description":"A dry-run plan of one instance of a clock: the items, how well each segment fills up to its anchor, and the planner's warnings. The example shows the first items only.","examples":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","instance":{"instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"},"items":[{"planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":57000,"start_mode":"hard","type":"feed","media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","transition":{"type":"cut"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000001","category_id":null,"notes":null,"media":null,"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"}},{"planned_start_at":"2026-10-01T14:00:57.000Z","planned_duration_ms":4200,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000002","category_id":"0192f0ca-0000-7000-8000-000000000002","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Jingle","artist":null,"album":null,"kind":"jingle","duration_ms":5000},"feed":null},{"planned_start_at":"2026-10-01T14:01:01.200Z","planned_duration_ms":206000,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000001","title":"Northern Lights","artist":"The Wanderers","album":"Open Road","kind":"music","duration_ms":214000},"feed":null},{"planned_start_at":"2026-10-01T14:04:27.200Z","planned_duration_ms":4200,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-00000000000a","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000002","category_id":"0192f0ca-0000-7000-8000-000000000002","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-00000000000a","title":"Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":5000},"feed":null},{"planned_start_at":"2026-10-01T14:04:31.400Z","planned_duration_ms":236500,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000002","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000002","title":"Long Way Home","artist":"Harbor Lights","album":null,"kind":"music","duration_ms":243000},"feed":null}],"stats":{"fill_error_ms":4200,"relaxations":0,"segments":[{"start_at":"2026-10-01T14:00:00.000Z","target_end_at":"2026-10-01T14:30:00.000Z","end_mode":"soft","end_at":"2026-10-01T14:30:04.200Z","error_ms":4200,"within_tolerance":true,"item_count":17,"filler_count":0},{"start_at":"2026-10-01T14:30:04.200Z","target_end_at":"2026-10-01T15:00:00.000Z","end_mode":"hard","end_at":"2026-10-01T14:59:58.500Z","error_ms":-1500,"within_tolerance":true,"item_count":9,"filler_count":0}]},"warnings":[]}]},"ClockPreviewItem":{"type":"object","properties":{"planned_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"planned_duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Play length until the next item starts."},"max_play_ms":{"description":"The cap the item would play with (its slot's `max_length_ms`). Null: none.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"start_mode":{"type":"string","enum":["sequential","hard"]},"type":{"type":"string","enum":["media","feed"]},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"feed_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"transition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"cut"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"crossfade"},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"overlay"},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}],"description":"The transition into this item."},"origin":{"type":"string","enum":["scheduler","manual","api"]},"clock_slot_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The slot it was planned for; null for filler picks."},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The category it was picked from; null for media and feed slots."},"notes":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"`relaxed`, `relaxations`, `filler` (a pick that fills an underrun before a hard start, such as a window's padding), as the planner would store them."},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's duration. Null until analyzed."},"intro_ms":{"description":"Where a song's vocals start, set by hand (api.md §Media and tags). Null when unknown; absent where the summary doesn't carry it.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","title","artist","album","kind","duration_ms"],"additionalProperties":false},{"type":"null"}],"description":"What will play (as in `UpcomingLogItem`); null for a feed, which resolves when it airs."},"feed":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},{"type":"null"}]}},"required":["planned_start_at","planned_duration_ms","start_mode","type","media_item_id","feed_id","transition","origin","clock_slot_id","category_id","notes","media","feed"],"additionalProperties":false,"description":"An item the planner would write to the log, with a summary of what would play and the category it was picked from.","examples":[{"planned_start_at":"2026-10-01T14:01:01.200Z","planned_duration_ms":206000,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000001","title":"Northern Lights","artist":"The Wanderers","album":"Open Road","kind":"music","duration_ms":214000},"feed":null}]},"ClockSlot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0-based, in playing order."},"type":{"type":"string","enum":["category","media","feed"],"description":"What the slot plays: a pick from `category_id`, the media item `media_item_id`, or the current item of the feed `feed_id`."},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"feed_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"anchor_offset_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Where the slot's item is anchored, from the start of the clock instance. Null: it follows the previous item."},"anchor_mode":{"anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}],"description":"`hard`: the item starts exactly at the anchor, and what plays is faded out. `soft`: it starts when the previous item ends, and the planner aims to end the content before it near the anchor, without cutting anything."},"transition":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"cut"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"crossfade"},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},{"type":"null"}],"description":"The transition into this slot's item. Null: the station's `default_transition`."},"transition_out":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"cut"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"crossfade"},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"overlay"},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}]},{"type":"null"}],"description":"The transition into the item the planner places after this slot's item, in place of that item's own slot transition or the station default. A pinned item and a hard-anchored slot's item keep their own. An `overlay` may have `fit_intro`: the next song starts so that this item ends where its intro marker is. Null: none."},"segment_end":{"type":"boolean","description":"The slot plays once per segment as its last item, ending at the segment's end: the next anchored slot's time, or the end of the clock instance. The planner picks its item and reserves its time before it fills the rest; several such slots in a segment play in list order; they never repeat with the category slots. A segment too short to hold them skips them (plan warning `segment_end_skipped`). Only category and media slots without an anchor."},"window_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Hard-anchored slots only, 5000 to 1800000; the anchor plus the window ends at or before the next anchored slot (or the end of the clock). The slot's segment ends exactly this long after its anchor and the item after it starts hard there. The slot's item plays once; what's left is padded from the station's filler category (else its fallback category; plan warning `window_unpadded` without either), and an item longer than the window is faded at its end (plan warning `window_overrun`). Null: no window."},"every_n":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Category slots without an anchor or `segment_end`, 1 to 12. The slot is left out of the slot order: in each segment, after every N songs (picks of kind `music`) from the segment's other category slots, one pick from this slot's category plays. Null: an ordinary slot."},"max_length_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Feed, media and category slots, 5000 to 1800000. The slot's item plays at most this long: its log item gets `max_play_ms`, and the engine fades it and ends it there. For a feed, the item the station resolves is capped; for a category slot, every pick is capped, and the planner fits picks by their capped length. Null: no cap."},"pad_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Only with `window_ms`: a category of the station or a shared one. The window is padded from it first, then the station's filler category, then its fallback category. Null: the filler category."},"label":{"type":["string","null"]}},"required":["id","position","type","category_id","media_item_id","feed_id","anchor_offset_ms","anchor_mode","transition","transition_out","segment_end","window_ms","every_n","max_length_ms","pad_category_id","label"],"additionalProperties":false,"description":"One slot of a clock. The planner splits each clock instance at its anchored slots and fills each segment with the slots in position order, repeating the category slots until the next anchor. `segment_end` slots play last instead, `transition_out` shapes the join into the next item, a `window_ms` ends the slot's segment at a set time with the next item starting hard there, and an `every_n` slot plays after every N picks of the segment's other category slots (api.md §Slot placement).","examples":[{"id":"0192f0c3-0000-7000-8000-000000000001","position":0,"type":"feed","category_id":null,"media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","position":1,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","media_item_id":null,"feed_id":null,"anchor_offset_ms":null,"anchor_mode":null,"transition":null,"transition_out":{"type":"crossfade","duration_ms":1500,"curve":"linear"},"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000006","position":5,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","media_item_id":null,"feed_id":null,"anchor_offset_ms":null,"anchor_mode":null,"transition":null,"transition_out":null,"segment_end":true,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"Station ID before the news"},{"id":"0192f0c3-0000-7000-8000-000000000001","position":0,"type":"feed","category_id":null,"media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","transition":null,"transition_out":null,"segment_end":false,"window_ms":90000,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000007","position":5,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","media_item_id":null,"feed_id":null,"anchor_offset_ms":null,"anchor_mode":null,"transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":3,"max_length_ms":null,"pad_category_id":null,"label":"Station ID every 3 songs"}]},"ClockWithSlots":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"type":["string","null"]},"duration_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Divides 24 hours evenly. Instances start at station-local midnight and every multiple of it."},"notes":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/ClockSlot"}}},"required":["id","station_id","name","color","duration_minutes","notes","created_at","updated_at","slots"],"additionalProperties":false,"description":"A clock with its slots, in playing order.","examples":[{"id":"0192f0cb-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"Standard hour","color":"#16a34a","duration_minutes":60,"notes":"News at :00 (hard anchor), an ident at :30 (soft anchor), music around them.","created_at":"2026-09-01T09:05:00.000Z","updated_at":"2026-09-01T09:05:00.000Z","slots":[{"id":"0192f0c3-0000-7000-8000-000000000001","position":0,"type":"feed","category_id":null,"media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","position":1,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","media_item_id":null,"feed_id":null,"anchor_offset_ms":null,"anchor_mode":null,"transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000003","position":2,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","media_item_id":null,"feed_id":null,"anchor_offset_ms":null,"anchor_mode":null,"transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000004","position":3,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","media_item_id":null,"feed_id":null,"anchor_offset_ms":1800000,"anchor_mode":"soft","transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"Half-hour ident"},{"id":"0192f0c3-0000-7000-8000-000000000005","position":4,"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","media_item_id":null,"feed_id":null,"anchor_offset_ms":null,"anchor_mode":null,"transition":null,"transition_out":null,"segment_end":false,"window_ms":null,"every_n":null,"max_length_ms":null,"pad_category_id":null,"label":"Music"}]}]},"CommandAccepted":{"type":"object","properties":{"command_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The command's id. The station answers with `command.result` for it, which the API logs."}},"required":["command_id"],"additionalProperties":false,"description":"A command sent to the station process, which carries it out asynchronously.","examples":[{"command_id":"0192f0d7-0000-7000-8000-000000000001"}]},"CreatedApiKey":{"type":"object","properties":{"api_key":{"$ref":"#/components/schemas/ApiKey"},"secret":{"type":"string","description":"The key itself (`rek_…`), for `Authorization: Bearer`. It is shown only this once; only its hash is stored."}},"required":["api_key","secret"],"additionalProperties":false,"examples":[{"api_key":{"id":"0192f0d1-0000-7000-8000-000000000001","name":"News automation","prefix":"rek_T3xg9Qm2","scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"created_by":"0192f0d0-0000-7000-8000-000000000001","last_used_at":null,"revoked_at":null,"created_at":"2026-09-15T10:12:44.000Z"},"secret":"rek_T3xg9Qm2vK7pL0sWn4cR8bYdF2hJ6tZqX1uE5aM9oGi"}]},"CreatedWebhook":{"type":"object","properties":{"webhook":{"$ref":"#/components/schemas/Webhook"},"secret":{"type":"string","description":"The signing secret (`whsec_…`): the HMAC-SHA256 key of `X-RadioEngine-Signature`, the whole string as UTF-8. It is shown only this once and stored encrypted."}},"required":["webhook","secret"],"additionalProperties":false,"examples":[{"webhook":{"id":"0192f0d4-0000-7000-8000-000000000001","name":"Website now playing","url":"https://www.example.com/hooks/radioengine","event_types":["track.started","track.ended"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"enabled":true,"consecutive_failures":0,"created_at":"2026-09-20T09:00:00.000Z","updated_at":"2026-09-20T09:00:00.000Z"},"secret":"whsec_q8Vt3LwX0nR5bJ2kP7yF1cM6hZ9sD4gA8eU0oT3iW5x"}]},"DiagnosisCause":{"type":"object","properties":{"code":{"type":"string","enum":["not_deployed","no_node","node_offline","process_not_running","not_reporting","fallback_empty_log","fallback_playback_failing","outputs_failing","not_ready"],"description":"`not_deployed` (paused or disabled), `no_node`, `node_offline` (no heartbeat for 60 s), `process_not_running` (the node's last heartbeat lists the station's process `stopped` or `failed`, or doesn't list it), `not_reporting` (no `station.status` for 30 s while its node is online and runs the process), `fallback_empty_log` (on fallback, nothing upcoming in the log), `fallback_playback_failing` (on fallback with an open `station.playback_failed` alert), `outputs_failing` (an enabled output not `connected`), `not_ready` (a `blocking` readiness check)."},"severity":{"type":"string","enum":["critical","warning","info"]},"message":{"type":"string","description":"What is wrong, for people, with times in the station's zone."},"actions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["start","restart","replan","sync_node","open_node","open_readiness","open_outputs","open_log"],"description":"`start` (`POST /v1/stations/{id}/start`, control: pushes the configuration again), `restart` (`POST /v1/stations/{id}/restart`, control: ends the station's process on its node and starts it again; offered on `not_reporting` and `process_not_running` while the node's agent is connected at protocol 3 or more), `replan` (`POST /v1/stations/{id}/log/replan`, log:write), `sync_node` (`POST /v1/nodes/{id}/sync`, admin), or a page to open: `open_node`, `open_readiness` (the setup checklist), `open_outputs`, `open_log`. Offer only those the client's scopes allow."},"label":{"type":"string","description":"What a button says, e.g. \"Start again\"."}},"required":["kind","label"],"additionalProperties":false},"description":"What fixes it, most useful first."}},"required":["code","severity","message","actions"],"additionalProperties":false,"description":"One reason why a station isn't on air as it should be, with its fixes.","examples":[{"code":"not_reporting","severity":"critical","message":"dev-node says the station process is running, but the station has sent no status since 21:03","actions":[{"kind":"restart","label":"Restart process"},{"kind":"start","label":"Start again"},{"kind":"open_node","label":"Open node"}]}]},"EngineFeedsResponse":{"type":"object","properties":{"feeds":{"type":"array","items":{"type":"object","properties":{"feed_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"items":{"type":"array","items":{"type":"object","properties":{"feed_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"local_path":{"type":"string","pattern":"^([0-9a-f]{2})\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{10}\\1-[^/\\\\]+\\.[A-Za-z0-9]+$"},"duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"cue_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"cue_out_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"mix_out_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"gain_db":{"type":"number","const":0},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"video":{"type":"boolean"}},"required":["id","local_path","duration_ms","cue_in_ms","cue_out_ms","mix_out_ms","gain_db","title","artist","kind"],"additionalProperties":false},"loudness":{"type":"object","properties":{"loudness_lufs":{"type":["number","null"]},"true_peak_dbtp":{"type":["number","null"]},"gain_override_db":{"type":["number","null"]}},"required":["loudness_lufs","true_peak_dbtp","gain_override_db"],"additionalProperties":false},"valid_from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"file":{"$ref":"#/components/schemas/ManifestItem"}},"required":["feed_item_id","media","loudness","valid_from","expires_at","station_ids","file"],"additionalProperties":false}}},"required":["feed_id","slug","items"],"additionalProperties":false}}},"required":["feeds"],"additionalProperties":false,"examples":[{"feeds":[{"feed_id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","items":[{"feed_item_id":"0192f0c6-0000-7000-8000-000000000001","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","local_path":"0b/0192f0c1-0000-7000-8000-00000000000b-7215ee9c.mp3","duration_ms":62350,"cue_in_ms":120,"cue_out_ms":61920,"mix_out_ms":61920,"gain_db":0,"title":"News 14:00","artist":null,"kind":"news"},"loudness":{"loudness_lufs":-17.8,"true_peak_dbtp":-1.2,"gain_override_db":null},"valid_from":"2026-10-01T13:55:00.000Z","expires_at":"2026-10-01T14:55:00.000Z","station_ids":null,"file":{"media_item_id":"0192f0c1-0000-7000-8000-00000000000b","etag":"7215ee9c7d9dc229d2921a40e899ec5f","size_bytes":1482337,"local_path":"0b/0192f0c1-0000-7000-8000-00000000000b-7215ee9c.mp3","url":"https://radioengine-media.fsn1.your-objectstorage.com/feeds/news-hourly/2026/10/01/0192f0c1-0000-7000-8000-00000000000b.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20261001%2Ffsn1%2Fs3%2Faws4_request&X-Amz-Date=20261001T140000Z&X-Amz-Expires=21600&X-Amz-Signature=9a8b7c6d5e4f30211203f4e5d6c7b8a99a8b7c6d5e4f30211203f4e5d6c7b8a9&X-Amz-SignedHeaders=host","url_expires_at":"2026-10-01T20:00:00.000Z"}}]}]}]},"EngineManifestLookupResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ManifestItem"}}},"required":["items"],"additionalProperties":false,"examples":[{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-00000000000b","etag":"7215ee9c7d9dc229d2921a40e899ec5f","size_bytes":1482337,"local_path":"0b/0192f0c1-0000-7000-8000-00000000000b-7215ee9c.mp3","url":"https://radioengine-media.fsn1.your-objectstorage.com/feeds/news-hourly/2026/10/01/0192f0c1-0000-7000-8000-00000000000b.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20261001%2Ffsn1%2Fs3%2Faws4_request&X-Amz-Date=20261001T140000Z&X-Amz-Expires=21600&X-Amz-Signature=9a8b7c6d5e4f30211203f4e5d6c7b8a99a8b7c6d5e4f30211203f4e5d6c7b8a9&X-Amz-SignedHeaders=host","url_expires_at":"2026-10-01T20:00:00.000Z"}]}]},"EngineManifestResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ManifestItem"}},"next_cursor":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"complete":{"type":"boolean"}},"required":["items","next_cursor","complete"],"additionalProperties":false,"examples":[{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000001","etag":"5d41402abc4b2a76b9719d911017c592","size_bytes":8734201,"local_path":"01/0192f0c1-0000-7000-8000-000000000001-5d41402a.mp3","url":"https://radioengine-media.fsn1.your-objectstorage.com/music/night-drive.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20261001%2Ffsn1%2Fs3%2Faws4_request&X-Amz-Date=20261001T140000Z&X-Amz-Expires=21600&X-Amz-Signature=3f1b9c2e7a4d8f6051e2c9b7a3d4f8e6c1b0a9d8e7f6a5b4c3d2e1f0a9b8c7d6&X-Amz-SignedHeaders=host","url_expires_at":"2026-10-01T20:00:00.000Z"},{"media_item_id":"0192f0c1-0000-7000-8000-00000000000b","etag":"7215ee9c7d9dc229d2921a40e899ec5f","size_bytes":1482337,"local_path":"0b/0192f0c1-0000-7000-8000-00000000000b-7215ee9c.mp3","url":"https://radioengine-media.fsn1.your-objectstorage.com/feeds/news-hourly/2026/10/01/0192f0c1-0000-7000-8000-00000000000b.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20261001%2Ffsn1%2Fs3%2Faws4_request&X-Amz-Date=20261001T140000Z&X-Amz-Expires=21600&X-Amz-Signature=9a8b7c6d5e4f30211203f4e5d6c7b8a99a8b7c6d5e4f30211203f4e5d6c7b8a9&X-Amz-SignedHeaders=host","url_expires_at":"2026-10-01T20:00:00.000Z"}],"next_cursor":null,"complete":true}]},"Event":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"media.ready"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]}},"required":["id","title","artist","album","kind","duration_ms","status"],"additionalProperties":false}},"required":["media_item_id","source_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"media.failed"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"error":{"type":"string"},"media":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]}},"required":["id","title","artist","album","kind","duration_ms","status"],"additionalProperties":false}},"required":["media_item_id","error"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"source.scanned"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"added":{"type":"integer","minimum":0,"maximum":9007199254740991},"updated":{"type":"integer","minimum":0,"maximum":9007199254740991},"missing":{"type":"integer","minimum":0,"maximum":9007199254740991},"added_ids":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"categories_created":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["source_id","added","updated","missing"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"log.updated"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"generation":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["station_id","generation"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"track.started"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"as_played_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"log_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feed_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"origin":{"type":"string","enum":["log","fallback","filler"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"planned_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["as_played_id","log_item_id","media_item_id","feed_item_id","title","artist","kind","origin","started_at","planned_duration_ms"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"track.ended"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"as_played_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ended_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"end_reason":{"type":"string","enum":["completed","faded","skipped","failed","interrupted"]},"duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["as_played_id","ended_at","end_reason","duration_ms"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"feed_item.created"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"feed_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feed_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valid_from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["feed_id","feed_item_id","media_item_id","valid_from","expires_at"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"feed_item.synced"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"feed_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"node_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["feed_item_id","node_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"feed_item.withdrawn"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"feed_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feed_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["feed_item_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"station.state_changed"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"state":{"type":"string","enum":["starting","playing","fallback","stopping","stopped","offline"]},"previous":{"type":"string","enum":["starting","playing","fallback","stopping","stopped","offline"]}},"required":["state","previous"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"station.silence"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"log_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["at","log_item_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"output.state_changed"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"output_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"state":{"type":"string","enum":["connected","reconnecting","failed"]},"previous":{"type":"string","enum":["connected","reconnecting","failed"]}},"required":["output_id","state","previous"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"node.online"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"node_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["node_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"node.offline"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"node_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["node_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"alert.opened"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"alert":{"$ref":"#/components/schemas/Alert"}},"required":["alert"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"alert.resolved"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"alert":{"$ref":"#/components/schemas/Alert"}},"required":["alert"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"alert.acknowledged"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"alert":{"$ref":"#/components/schemas/Alert"}},"required":["alert"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"pad.updated"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["station_id"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"programming.changed"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"parts":{"minItems":1,"type":"array","items":{"type":"string","enum":["clocks","categories","schedule_rules","rotation_rules","defaults"]}}},"required":["station_id","parts"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","const":"config.changed"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actor":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":["string","null"]}},"required":["type","id","name"],"additionalProperties":false},{"type":"null"}]},"data":{"type":"object","properties":{"object":{"type":"string","enum":["station","output","source","storage_connection","node","user","invitation","api_key","webhook","notification_channel","feed","media","tag"]},"object_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"action":{"type":"string","enum":["created","updated","deleted"]},"name":{"type":["string","null"]},"fields":{"type":"array","items":{"type":"string"}},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["active","paused","disabled"]}},"required":["object","object_id","action","name","fields"],"additionalProperties":false}},"required":["id","type","station_id","created_at","actor","data"],"additionalProperties":false}],"description":"An event, as `GET /v1/events`, the WebSocket stream (`GET /v1/events/ws`) and webhooks deliver it. Discriminated on `type`, with one `data` shape per type (api.md §Events).","examples":[{"id":"0192f0c8-0000-7000-8000-000000000001","type":"track.started","station_id":"0192f0c4-0000-7000-8000-000000000001","created_at":"2026-10-01T14:00:00.012Z","actor":null,"data":{"as_played_id":"0192f0c7-0000-7000-8000-000000000002","log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","feed_item_id":"0192f0c6-0000-7000-8000-000000000001","title":"News 14:00","artist":null,"kind":"news","origin":"log","started_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":61800}},{"id":"0192f0c8-0000-7000-8000-000000000002","type":"alert.opened","station_id":null,"created_at":"2026-10-01T14:55:04.310Z","actor":null,"data":{"alert":{"id":"0192f0d6-0000-7000-8000-000000000001","kind":"feed.late","severity":"warning","station_id":null,"node_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","message":"Feed \"News (hourly)\" is late: nothing valid for the slot at 2026-10-01T15:00:00.000Z on Rock FM","dedupe_key":"feed.late:0192f0c5-0000-7000-8000-000000000001","details":{"slot_at":"2026-10-01T15:00:00.000Z","deadline_at":"2026-10-01T14:55:00.000Z","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"expected_interval_minutes":60,"alert_lead_minutes":5,"latest_valid_from":"2026-10-01T13:55:00.000Z"},"opened_at":"2026-10-01T14:55:04.310Z","resolved_at":null,"acknowledged_at":null,"acknowledged_by":null,"created_at":"2026-10-01T14:55:04.310Z"}}}]},"EventPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false,"examples":[{"items":[{"id":"0192f0c8-0000-7000-8000-000000000001","type":"track.started","station_id":"0192f0c4-0000-7000-8000-000000000001","created_at":"2026-10-01T14:00:00.012Z","actor":null,"data":{"as_played_id":"0192f0c7-0000-7000-8000-000000000002","log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","feed_item_id":"0192f0c6-0000-7000-8000-000000000001","title":"News 14:00","artist":null,"kind":"news","origin":"log","started_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":61800}},{"id":"0192f0c8-0000-7000-8000-000000000002","type":"alert.opened","station_id":null,"created_at":"2026-10-01T14:55:04.310Z","actor":null,"data":{"alert":{"id":"0192f0d6-0000-7000-8000-000000000001","kind":"feed.late","severity":"warning","station_id":null,"node_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","message":"Feed \"News (hourly)\" is late: nothing valid for the slot at 2026-10-01T15:00:00.000Z on Rock FM","dedupe_key":"feed.late:0192f0c5-0000-7000-8000-000000000001","details":{"slot_at":"2026-10-01T15:00:00.000Z","deadline_at":"2026-10-01T14:55:00.000Z","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"expected_interval_minutes":60,"alert_lead_minutes":5,"latest_valid_from":"2026-10-01T13:55:00.000Z"},"opened_at":"2026-10-01T14:55:04.310Z","resolved_at":null,"acknowledged_at":null,"acknowledged_by":null,"created_at":"2026-10-01T14:55:04.310Z"}}}],"next_cursor":null}]},"Feed":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$","description":"Names the watched prefix and the upload folder, `<source prefix><slug>/`."},"name":{"type":"string"},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A source with purpose `feed`. Uploads go to `<source prefix><slug>/<yyyy>/<mm>/<dd>/`."},"watch_prefix":{"type":"boolean","description":"Whether each object under `<source prefix><slug>/` becomes a feed item when the source is scanned."},"default_kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"],"description":"The kind of the media items of uploaded files."},"default_ttl_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How long an item stays valid when it is created without `expires_at`."},"on_missing":{"type":"string","enum":["skip","fallback","reuse_previous"],"description":"What a station plays in a feed slot when no item is valid: nothing (`skip`), `fallback_media_item_id` (`fallback`), or an item that expired less than `reuse_grace_minutes` ago (`reuse_previous`)."},"fallback_media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"What `on_missing: fallback` plays."},"reuse_grace_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How long after it expired `on_missing: reuse_previous` may still play an item."},"expected_interval_minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How often new items are expected: drives `next_item_expected_at` and the `feed.late` alert. Null: no lateness alerts."},"alert_lead_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`feed.late` opens this long before an expected slot that has no valid item."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","slug","name","source_id","watch_prefix","default_kind","default_ttl_minutes","on_missing","fallback_media_item_id","reuse_grace_minutes","expected_interval_minutes","alert_lead_minutes","created_at","updated_at"],"additionalProperties":false,"description":"A feed of fresh content (news, weather) that clock slots play. Its items are its files, each valid for a time window.","examples":[{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)","source_id":"0192f0c9-0000-7000-8000-000000000002","watch_prefix":false,"default_kind":"news","default_ttl_minutes":60,"on_missing":"skip","fallback_media_item_id":null,"reuse_grace_minutes":0,"expected_interval_minutes":60,"alert_lead_minutes":5,"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"}]},"FeedItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feed_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valid_from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the item may start airing."},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it stops airing."},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"The stations that play it. Null: every station that uses the feed."},"created_via":{"type":"string","enum":["api","dashboard","s3"]},"created_by":{"description":"`user:<id>`, `key:<id>` or `s3`.","type":["string","null"]},"withdrawn_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the item was withdrawn; it never airs after that."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","feed_id","media_item_id","valid_from","expires_at","station_ids","created_via","created_by","withdrawn_at","created_at"],"additionalProperties":false,"description":"One file of a feed, valid from `valid_from` until `expires_at`. In a feed slot, a station plays the newest valid item meant for it.","examples":[{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z"}]},"FeedItemCreated":{"type":"object","properties":{"feed_item":{"$ref":"#/components/schemas/FeedItem"},"media_item":{"$ref":"#/components/schemas/MediaItem"}},"required":["feed_item","media_item"],"additionalProperties":false,"description":"The new feed item and its media item. The media item is `pending` right after an upload, until its analysis finishes.","examples":[{"feed_item":{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z"},"media_item":{"id":"0192f0c1-0000-7000-8000-00000000000b","source_id":"0192f0c9-0000-7000-8000-000000000002","s3_key":"news-hourly/2026/10/01/0192f0c1-0000-7000-8000-00000000000b.mp3","etag":"2c26b46b68ffc68ff99b453c1d304134","size_bytes":1488384,"kind":"news","status":"pending","error":null,"title":null,"artist":null,"album":null,"year":null,"genre":null,"isrc":null,"duration_ms":null,"codec":null,"sample_rate":null,"channels":null,"bitrate_kbps":null,"loudness_lufs":null,"true_peak_dbtp":null,"cue_in_ms":null,"cue_out_ms":null,"mix_out_ms":null,"peaks_key":null,"analyzed_at":null,"cue_in_override_ms":null,"cue_out_override_ms":null,"mix_out_override_ms":null,"gain_override_db":null,"intro_ms":null,"has_video":false,"video_width":null,"video_height":null,"video_frame_rate":null,"video_codec":null,"video_key":null,"video_etag":null,"video_size_bytes":null,"effective":{"cue_in_ms":0,"cue_out_ms":null,"mix_out_ms":null},"tags":[],"created_at":"2026-10-01T13:58:47.000Z","updated_at":"2026-10-01T13:58:47.000Z"}}]},"FeedItemMedia":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Null before analysis."}},"required":["id","status","kind","title","artist","duration_ms"],"additionalProperties":false,"description":"A summary of a feed item's media item.","examples":[{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}]},"FeedItemWithMedia":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feed_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valid_from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the item may start airing."},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it stops airing."},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"The stations that play it. Null: every station that uses the feed."},"created_via":{"type":"string","enum":["api","dashboard","s3"]},"created_by":{"description":"`user:<id>`, `key:<id>` or `s3`.","type":["string","null"]},"withdrawn_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the item was withdrawn; it never airs after that."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"media":{"$ref":"#/components/schemas/FeedItemMedia"}},"required":["id","feed_id","media_item_id","valid_from","expires_at","station_ids","created_via","created_by","withdrawn_at","created_at","media"],"additionalProperties":false,"description":"A feed item with a summary of its media item.","examples":[{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}}]},"FeedStatus":{"type":"object","properties":{"feed_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the status was computed."},"stations":{"type":"array","items":{"type":"object","properties":{"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"},"timezone":{"type":"string","description":"The station's IANA time zone, for showing its slot and item times in local time."},"status":{"type":"string","enum":["active","paused","disabled"]},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"current_item":{"anyOf":[{"$ref":"#/components/schemas/FeedItemWithMedia"},{"type":"null"}],"description":"What the station would play now: its newest valid item (by `valid_from`, then id) whose media is ready. Null when there is none."},"age_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Time since the current item's `valid_from`."},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The current item's `expires_at`."},"expires_in_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Time until the current item expires."},"next_slot_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The start of the next feed slot in the station's planned log. Null when none is planned."},"next_item_expected_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the next item is due: the newest item's `valid_from` plus the feed's `expected_interval_minutes`. Null without an interval or without items."},"slots":{"description":"The slots of the station's clocks that play the feed, by clock name and position, as `GET /v1/stations/{id}/feeds` lists them. Empty when only log items name it. Always present in responses.","type":"array","items":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clock_name":{"type":"string"},"slot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The slot's position in its clock, 0-based."},"anchor_offset_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Where the slot is anchored, from the start of the clock instance. Null: it follows the previous item."},"anchor_mode":{"anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"window_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The slot's window: its segment ends this long after the anchor. Null: none."},"max_length_ms":{"description":"The slot's cap: the feed's item plays at most this long, faded at its end. Null: none. Always present in responses.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pad_category_id":{"description":"The category the window is padded from first (a bed), before the station's filler and fallback categories. Null: none. Always present in responses.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":["string","null"]}},"required":["clock_id","clock_name","slot_id","position","anchor_offset_ms","anchor_mode","window_ms","label"],"additionalProperties":false,"description":"A slot of one of the station's clocks that plays the feed."}}},"required":["station_id","slug","name","timezone","status","node_id","current_item","age_ms","expires_at","expires_in_ms","next_slot_at","next_item_expected_at"],"additionalProperties":false},"description":"The stations that use the feed: a clock slot or an upcoming log item names it."},"nodes":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"status":{"type":"string","enum":["online","offline"]},"station_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The node's active stations that use the feed."},"items":{"type":"array","items":{"type":"object","properties":{"feed_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"synced":{"type":"boolean","description":"The node holds the item's current file (`feed.synced`, or its sync report)."},"synced_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["feed_item_id","synced","synced_at"],"additionalProperties":false},"description":"The current items of those stations."},"synced":{"description":"Whether every current item is synced; null when the node's stations have none.","type":["boolean","null"]}},"required":["node_id","name","status","station_ids","items","synced"],"additionalProperties":false},"description":"The nodes of those stations that are active."}},"required":["feed_id","slug","at","stations","nodes"],"additionalProperties":false,"description":"Whether a feed is on time and on the nodes: each using station's current item, next feed slot and the slots of its clocks that play the feed, and whether each node holds those items.","examples":[{"feed_id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","at":"2026-10-01T14:05:00.000Z","stations":[{"station_id":"0192f0c4-0000-7000-8000-000000000001","slug":"rock","name":"Rock FM","timezone":"Europe/Berlin","status":"active","node_id":"0192f0cf-0000-7000-8000-000000000001","current_item":{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}},"age_ms":330000,"expires_at":"2026-10-01T14:20:00.000Z","expires_in_ms":900000,"next_slot_at":"2026-10-01T15:00:00.000Z","next_item_expected_at":"2026-10-01T14:59:30.000Z","slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000001","position":0,"anchor_offset_ms":0,"anchor_mode":"hard","window_ms":90000,"max_length_ms":90000,"pad_category_id":"0192f0ca-0000-7000-8000-000000000006","label":"News"}]}],"nodes":[{"node_id":"0192f0cf-0000-7000-8000-000000000001","name":"stream1","status":"online","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"items":[{"feed_item_id":"0192f0c6-0000-7000-8000-000000000001","synced":true,"synced_at":"2026-10-01T13:59:41.000Z"}],"synced":true}]}]},"Invitation":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string","description":"Stored lowercase: the new user's email, once they accept."},"name":{"description":"The name the admin gave; the person may change it when they accept.","type":["string","null"]},"role":{"type":"string","enum":["admin","editor","viewer"],"description":"The new user's role (api.md §Scopes)."},"invited_by":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The admin who invited, or who last resent it, with their name now; null for an API key."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the link stops working: 7 days after the invitation, or after its last resend."},"accepted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"expired":{"type":"boolean","description":"Whether `expires_at` has passed. Resend to make a new link."}},"required":["id","email","name","role","invited_by","created_at","expires_at","accepted_at","expired"],"additionalProperties":false,"description":"An invitation to join by email. The link's token is never returned again after the response that made it.","examples":[{"id":"0192f0d9-0000-7000-8000-000000000001","email":"editor@example.com","name":"Morning Editor","role":"editor","invited_by":{"id":"0192f0d0-0000-7000-8000-000000000001","name":"Admin"},"created_at":"2026-10-01T14:00:00.000Z","expires_at":"2026-10-08T14:00:00.000Z","accepted_at":null,"expired":false},{"id":"0192f0d9-0000-7000-8000-000000000002","email":"night@example.com","name":null,"role":"viewer","invited_by":{"id":"0192f0d0-0000-7000-8000-000000000001","name":"Admin"},"created_at":"2026-09-20T09:00:00.000Z","expires_at":"2026-09-27T09:00:00.000Z","accepted_at":null,"expired":true}]},"InvitationLink":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]},"role":{"type":"string","enum":["admin","editor","viewer"]},"invited_by_name":{"description":"Who invited, or who last resent it; null for an API key.","type":["string","null"]},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["email","name","role","invited_by_name","expires_at"],"additionalProperties":false,"description":"The invitation behind a link, for the page that accepts it.","examples":[{"email":"editor@example.com","name":"Morning Editor","role":"editor","invited_by_name":"Admin","expires_at":"2026-10-08T14:00:00.000Z"}]},"InvitationSent":{"type":"object","properties":{"invitation":{"$ref":"#/components/schemas/Invitation"},"accept_url":{"type":"string","description":"`<DASHBOARD_PUBLIC_URL>/invite/<token>`: shown only in this response. Anyone with it can join with the invitation's role until it expires."},"delivery":{"type":"string","enum":["email","link"],"description":"`email`: the platform can send email (the worker's `BIRD_API_KEY` or `SMTP_URL`, else the oldest enabled `email` notification channel), and the worker sends the link. `link`: it can't; pass the link on yourself."}},"required":["invitation","accept_url","delivery"],"additionalProperties":false,"description":"An invitation with its new link, after `POST /v1/invitations` or a resend.","examples":[{"invitation":{"id":"0192f0d9-0000-7000-8000-000000000001","email":"editor@example.com","name":"Morning Editor","role":"editor","invited_by":{"id":"0192f0d0-0000-7000-8000-000000000001","name":"Admin"},"created_at":"2026-10-01T14:00:00.000Z","expires_at":"2026-10-08T14:00:00.000Z","accepted_at":null,"expired":false},"accept_url":"https://app.example.com/invite/q8Zt0bW4nYk2vXo7HcL1sJp9aRf3eGu6TmDiNyQwEcA","delivery":"email"}]},"ListenerBucket":{"type":"object","properties":{"t":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The bucket's start. Buckets are aligned to whole minutes, 5 minutes or hours (UTC)."},"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The sum of `by_output`."},"by_output":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Per output id: the most listeners any sample of that output in the bucket reported. Outputs without a sample in the bucket are left out."}},"required":["t","total","by_output"],"additionalProperties":false,"description":"The listeners of one time bucket: each output's peak, and their sum.","examples":[{"t":"2026-10-01T13:55:00.000Z","total":186,"by_output":{"0192f0ce-0000-7000-8000-000000000001":143,"0192f0ce-0000-7000-8000-000000000002":43}}]},"Log":{"type":"object","properties":{"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"log_generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`stations.log_generation`: every change to the log increases it, and `log.updated` carries it."},"from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"to":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"lock_until":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The end of the lock window (now + the station's `lock_window_seconds`): items starting before it are locked, as is everything up to a loaded or playing item."},"items":{"type":"array","items":{"$ref":"#/components/schemas/LogItem"},"description":"Items overlapping `[from, to)`, in playing order."}},"required":["station_id","log_generation","from","to","lock_until","items"],"additionalProperties":false,"description":"A station's log over a time range.","examples":[{"station_id":"0192f0c4-0000-7000-8000-000000000001","log_generation":412,"from":"2026-10-01T13:59:00.000Z","to":"2026-10-01T14:04:30.000Z","lock_until":"2026-10-01T14:01:47.000Z","items":[{"id":"0192f0c2-0000-7000-8000-000000000002","planned_start_at":"2026-10-01T13:58:12.400Z","planned_duration_ms":107600,"start_mode":"sequential","type":"media","status":"playing","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000001","title":"Neon Harbor","artist":"The Night Signals","album":"Coastline","kind":"music","duration_ms":113500,"intro_ms":18400,"cue_in_ms":120,"cue_out_ms":112900},"feed":null,"feed_item":null,"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_id":null,"resolved_feed_item_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_slot_id":"0192f0c3-0000-7000-8000-000000000005","clock_instance_start":"2026-10-01T13:00:00.000Z","notes":null,"generation":407,"locked":true,"slot":{"id":"0192f0c3-0000-7000-8000-000000000005","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music","anchor_mode":null,"anchor_offset_ms":null,"window_ms":null,"every_n":null,"segment_end":false,"max_length_ms":null},"created_at":"2026-10-01T10:58:20.114Z","updated_at":"2026-10-01T13:58:12.431Z"},{"id":"0192f0c2-0000-7000-8000-000000000003","planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":61800,"start_mode":"hard","type":"feed","status":"loaded","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-00000000000b","title":"News 14:00","artist":null,"album":null,"kind":"news","duration_ms":62000,"intro_ms":null,"cue_in_ms":0,"cue_out_ms":61800},"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"},"feed_item":{"id":"0192f0c6-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z"},"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","resolved_feed_item_id":"0192f0c6-0000-7000-8000-000000000001","transition":{"type":"cut"},"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_slot_id":"0192f0c3-0000-7000-8000-000000000001","clock_instance_start":"2026-10-01T14:00:00.000Z","notes":null,"generation":405,"locked":true,"slot":{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","category_id":null,"label":"News","anchor_mode":"hard","anchor_offset_ms":0,"window_ms":null,"every_n":null,"segment_end":false,"max_length_ms":null},"created_at":"2026-10-01T11:00:21.530Z","updated_at":"2026-10-01T13:59:31.207Z"},{"id":"0192f0c2-0000-7000-8000-000000000004","planned_start_at":"2026-10-01T14:01:01.800Z","planned_duration_ms":205000,"start_mode":"sequential","type":"media","status":"planned","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000002","title":"Paper Satellites","artist":"Juniper Road","album":"Low Orbit","kind":"music","duration_ms":211300,"intro_ms":12500,"cue_in_ms":300,"cue_out_ms":209800},"feed":null,"feed_item":null,"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000002","feed_id":null,"resolved_feed_item_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","clock_instance_start":"2026-10-01T14:00:00.000Z","notes":{"relaxed":["artist_separation"],"relaxations":[{"rule_id":"0192f0cd-0000-7000-8000-000000000001","kind":"artist_separation","step":"halved"}]},"generation":409,"locked":true,"slot":{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music","anchor_mode":null,"anchor_offset_ms":null,"window_ms":null,"every_n":null,"segment_end":false,"max_length_ms":null},"created_at":"2026-10-01T11:01:22.004Z","updated_at":"2026-10-01T13:40:02.118Z"},{"id":"0192f0c2-0000-7000-8000-000000000005","planned_start_at":"2026-10-01T14:04:26.800Z","planned_duration_ms":198400,"start_mode":"sequential","type":"media","status":"planned","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000005","title":"Glass Canyon","artist":"The Low Frequencies","album":null,"kind":"music","duration_ms":204900,"intro_ms":null,"cue_in_ms":0,"cue_out_ms":203400},"feed":null,"feed_item":null,"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000005","feed_id":null,"resolved_feed_item_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","clock_instance_start":"2026-10-01T14:00:00.000Z","notes":null,"generation":412,"locked":false,"slot":{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music","anchor_mode":null,"anchor_offset_ms":null,"window_ms":null,"every_n":null,"segment_end":false,"max_length_ms":null},"created_at":"2026-10-01T11:04:47.960Z","updated_at":"2026-10-01T13:52:10.411Z"}]}]},"LogEditResult":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/LogItem"},"log_generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The log's generation after the plan that followed the edit."}},"required":["item","log_generation"],"additionalProperties":false,"description":"The item as the plan after the edit left it, with the log's new generation.","examples":[{"item":{"id":"0192f0c2-0000-7000-8000-000000000006","planned_start_at":"2026-10-01T14:04:26.800Z","planned_duration_ms":5200,"start_mode":"sequential","type":"media","status":"planned","origin":"manual","pinned":true,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":8200,"intro_ms":null,"cue_in_ms":0,"cue_out_ms":8200},"feed":null,"feed_item":null,"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_id":null,"resolved_feed_item_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"clock_id":null,"clock_slot_id":null,"clock_instance_start":null,"notes":null,"generation":413,"locked":false,"slot":null,"created_at":"2026-10-01T13:59:47.318Z","updated_at":"2026-10-01T13:59:47.318Z"},"log_generation":413}]},"LogItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The log item id."},"planned_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"planned_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Play length until the next item starts (for the item before a hard start, at most the time until it)."},"start_mode":{"type":"string","enum":["sequential","hard"]},"type":{"type":"string","enum":["media","feed"]},"status":{"type":"string","enum":["planned","loaded","playing","played","skipped","failed","cancelled"]},"origin":{"type":"string","enum":["scheduler","manual","api"]},"pinned":{"type":"boolean"},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's duration. Null until analyzed."},"intro_ms":{"description":"Where a song's vocals start, set by hand (api.md §Media and tags). Null when unknown; absent where the summary doesn't carry it.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"cue_in_ms":{"description":"Its effective cue in (`cue_in_override_ms ?? cue_in_ms ?? 0`): where playout starts it. Always present in log items.","type":"integer","minimum":0,"maximum":9007199254740991},"cue_out_ms":{"description":"Its effective cue out (`cue_out_override_ms ?? cue_out_ms ?? duration_ms`): where playout ends it at the latest; null before analysis. Always present in log items.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","title","artist","album","kind","duration_ms"],"additionalProperties":false},{"type":"null"}],"description":"What will play: the media item, or for a feed item the resolved feed item's media (null until the station resolves it), with the song's `intro_ms` and its effective `cue_in_ms` and `cue_out_ms`."},"feed":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},{"type":"null"}]},"feed_item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valid_from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","media_item_id","valid_from","expires_at"],"additionalProperties":false},{"type":"null"}],"description":"The feed item the station resolved for this slot, once it reported `item.loaded`. Null before that, and for media items."},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The media item of a `media` item."},"feed_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The feed of a `feed` item."},"resolved_feed_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The feed item the station resolved (see `feed_item`)."},"transition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"cut"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"crossfade"},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"overlay"},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}],"description":"The transition into this item."},"clock_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The clock it was planned from. Null for inserted items and the fallback pseudo-clock."},"clock_slot_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clock_instance_start":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"max_play_ms":{"description":"The slot's `max_length_ms` when it was planned: the engine fades the item and ends it there (engine-protocol.md §Capped items). Null: no cap.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"notes":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Scheduler notes: `relaxed` (the kinds of the rotation rules relaxed for this pick), `relaxations` (`[{rule_id, kind, step}]`, `step` being `halved` or `dropped`), `filler` (true for filler picks), `category_id` (the category an inserted pick or a filler pick came from) and `suppressed` (true on a cancelled item of a media or feed slot: that slot isn't placed again in its clock instance)."},"generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`stations.log_generation` when the row was last written."},"locked":{"type":"boolean","description":"Loaded, playing, over, or starting inside the lock window (or before a loaded or playing item): the planner won't change it, and `PATCH`/`DELETE` return `409 log_item_locked`."},"slot":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["category","media","feed"]},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The category a `category` slot picks from; null otherwise."},"label":{"type":["string","null"]},"anchor_mode":{"anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"anchor_offset_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The anchor's offset into the clock."},"window_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"every_n":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"segment_end":{"type":"boolean"},"max_length_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","type","category_id","label","anchor_mode","anchor_offset_ms","window_ms","every_n","segment_end","max_length_ms"],"additionalProperties":false,"description":"The clock slot the item was planned from, as that slot is now, so a log can name it without loading the clock. Null for inserted items, the fallback pseudo-clock and a slot that no longer exists."},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","planned_start_at","planned_duration_ms","start_mode","type","status","origin","pinned","media","feed","feed_item","station_id","media_item_id","feed_id","resolved_feed_item_id","transition","clock_id","clock_slot_id","clock_instance_start","notes","generation","locked","slot","created_at","updated_at"],"additionalProperties":false,"description":"A log item: the fields of now playing's `UpcomingLogItem` (`pinned` marks manual and API inserts and edited items, which the planner fits its picks around), plus the row's other columns, `locked` and the clock `slot` it was planned from.","examples":[{"id":"0192f0c2-0000-7000-8000-000000000003","planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":61800,"start_mode":"hard","type":"feed","status":"loaded","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-00000000000b","title":"News 14:00","artist":null,"album":null,"kind":"news","duration_ms":62000,"intro_ms":null,"cue_in_ms":0,"cue_out_ms":61800},"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"},"feed_item":{"id":"0192f0c6-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z"},"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","resolved_feed_item_id":"0192f0c6-0000-7000-8000-000000000001","transition":{"type":"cut"},"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_slot_id":"0192f0c3-0000-7000-8000-000000000001","clock_instance_start":"2026-10-01T14:00:00.000Z","notes":null,"generation":405,"locked":true,"slot":{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","category_id":null,"label":"News","anchor_mode":"hard","anchor_offset_ms":0,"window_ms":null,"every_n":null,"segment_end":false,"max_length_ms":null},"created_at":"2026-10-01T11:00:21.530Z","updated_at":"2026-10-01T13:59:31.207Z"},{"id":"0192f0c2-0000-7000-8000-000000000005","planned_start_at":"2026-10-01T14:04:26.800Z","planned_duration_ms":198400,"start_mode":"sequential","type":"media","status":"planned","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000005","title":"Glass Canyon","artist":"The Low Frequencies","album":null,"kind":"music","duration_ms":204900,"intro_ms":null,"cue_in_ms":0,"cue_out_ms":203400},"feed":null,"feed_item":null,"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000005","feed_id":null,"resolved_feed_item_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","clock_instance_start":"2026-10-01T14:00:00.000Z","notes":null,"generation":412,"locked":false,"slot":{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music","anchor_mode":null,"anchor_offset_ms":null,"window_ms":null,"every_n":null,"segment_end":false,"max_length_ms":null},"created_at":"2026-10-01T11:04:47.960Z","updated_at":"2026-10-01T13:52:10.411Z"}]},"LogReplanResult":{"type":"object","properties":{"log_generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The log's generation after the plan: unchanged when nothing changed."},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Items the plan added."},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Planned items the plan re-timed or changed."},"cancelled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Planned items the plan cancelled."},"until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Where the planned log ends."}},"required":["log_generation","added","updated","cancelled","until"],"additionalProperties":false,"examples":[{"log_generation":414,"added":41,"updated":3,"cancelled":41,"until":"2026-10-01T17:01:01.800Z"}]},"LoginResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"],"additionalProperties":false,"examples":[{"user":{"id":"0192f0d0-0000-7000-8000-000000000001","email":"admin@example.com","name":"Admin","role":"admin","disabled_at":null,"created_at":"2026-09-01T08:30:00.000Z","updated_at":"2026-09-01T08:30:00.000Z"}}]},"ManifestItem":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"etag":{"type":"string","minLength":1},"size_bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"local_path":{"type":"string","pattern":"^([0-9a-f]{2})\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{10}\\1-[^/\\\\]+\\.[A-Za-z0-9]+$"},"url":{"type":"string","format":"uri"},"url_expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["media_item_id","etag","size_bytes","local_path","url","url_expires_at"],"additionalProperties":false,"description":"A file the node should hold: where to download it (`url`, a presigned GET valid for 6 h) and where to store it under the node's media root (`local_path`, `<last 2 hex chars of the id>/<id>-<first 8 chars of the etag>.<ext>`).","examples":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000001","etag":"5d41402abc4b2a76b9719d911017c592","size_bytes":8734201,"local_path":"01/0192f0c1-0000-7000-8000-000000000001-5d41402a.mp3","url":"https://radioengine-media.fsn1.your-objectstorage.com/music/night-drive.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20261001%2Ffsn1%2Fs3%2Faws4_request&X-Amz-Date=20261001T140000Z&X-Amz-Expires=21600&X-Amz-Signature=3f1b9c2e7a4d8f6051e2c9b7a3d4f8e6c1b0a9d8e7f6a5b4c3d2e1f0a9b8c7d6&X-Amz-SignedHeaders=host","url_expires_at":"2026-10-01T20:00:00.000Z"}]},"MeApiKey":{"type":"object","properties":{"api_key":{"$ref":"#/components/schemas/ApiKey"},"scopes":{"type":"array","items":{"type":"string","enum":["read","content:write","schedule:write","feeds:write","log:write","control","admin"]},"description":"The key's scopes."},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"The stations the key may touch; null means all."}},"required":["api_key","scopes","station_ids"],"additionalProperties":false,"description":"`GET /v1/auth/me` for an API key.","examples":[{"api_key":{"id":"0192f0d1-0000-7000-8000-000000000001","name":"News automation","prefix":"rek_T3xg9Qm2","scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"created_by":"0192f0d0-0000-7000-8000-000000000001","last_used_at":"2026-10-01T13:55:02.000Z","revoked_at":null,"created_at":"2026-09-15T10:12:44.000Z"},"scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"]}]},"MeUser":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"scopes":{"type":"array","items":{"type":"string","enum":["read","content:write","schedule:write","feeds:write","log:write","control","admin"]},"description":"The scopes of the user's role."}},"required":["user","scopes"],"additionalProperties":false,"description":"`GET /v1/auth/me` for a session.","examples":[{"user":{"id":"0192f0d0-0000-7000-8000-000000000001","email":"admin@example.com","name":"Admin","role":"admin","disabled_at":null,"created_at":"2026-09-01T08:30:00.000Z","updated_at":"2026-09-01T08:30:00.000Z"},"scopes":["read","content:write","schedule:write","feeds:write","log:write","control","admin"]}]},"MediaAnalysisQueued":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"job_id":{"description":"The id of the analysis job.","type":["string","null"]}},"required":["media_item_id","job_id"],"additionalProperties":false,"description":"The media item is `pending` and its analysis is queued; `media.ready` or `media.failed` follows.","examples":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000001","job_id":"0192f0d8-0000-7000-8000-000000000001"}]},"MediaBulkResult":{"type":"object","properties":{"updated":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many media items the request selected (and changed where they differed)."}},"required":["updated"],"additionalProperties":false,"examples":[{"updated":2}]},"MediaItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"s3_key":{"type":"string","description":"The object's key in the source's bucket."},"etag":{"type":"string","description":"The object's ETag, without quotes. It identifies the version of the file."},"size_bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"status":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"],"description":"`pending` and `analyzing` until analysis ends with `ready` (playable) or `error`; `missing` when a scan no longer finds the file; `deleted` after `DELETE /v1/media/{id}`."},"error":{"description":"Why analysis failed, when `status` is `error`.","type":["string","null"]},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"year":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"genre":{"type":["string","null"]},"isrc":{"type":["string","null"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's length. Null before analysis."},"codec":{"type":["string","null"]},"sample_rate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"channels":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bitrate_kbps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"loudness_lufs":{"description":"EBU R128 integrated loudness.","type":["number","null"]},"true_peak_dbtp":{"type":["number","null"]},"cue_in_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Analysed cue in; see `effective` for the values playout uses."},"cue_out_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Analysed cue out."},"mix_out_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Analysed mix out: where the next item may start."},"peaks_key":{"description":"S3 key of the waveform peaks JSON (`GET /v1/media/{id}/peaks`), or null before analysis.","type":["string","null"]},"analyzed_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"cue_in_override_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Manual cue in; wins over `cue_in_ms`."},"cue_out_override_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Manual cue out; wins over `cue_out_ms`."},"mix_out_override_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Manual mix out; wins over `mix_out_ms`."},"gain_override_db":{"description":"Replaces the loudness-normalizing gain on every station.","type":["number","null"]},"intro_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Where the song's vocals start (its intro marker), set by hand; null when unknown. Between the effective cue in and cue out."},"has_video":{"type":"boolean","description":"A video item: analysis found a video stream that isn't cover art. It plays its picture on video outputs and its sound everywhere; stations play its mezzanine."},"video_width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The source's picture width, as analysis found it."},"video_height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The source's picture height."},"video_frame_rate":{"description":"The source's frames per second, e.g. 29.97.","type":["number","null"]},"video_codec":{"description":"The source's video codec, as ffprobe names it: h264, hevc, prores, vp9, …","type":["string","null"]},"video_key":{"description":"S3 key of the mezzanine, the item's copy in the platform's video profile (1080p, 25 fps) that stations play, in the same bucket. Null until it is transcoded.","type":["string","null"]},"video_etag":{"description":"The mezzanine's ETag, without quotes.","type":["string","null"]},"video_size_bytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The mezzanine's size."},"effective":{"type":"object","properties":{"cue_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"`cue_in_override_ms ?? cue_in_ms ?? 0`."},"cue_out_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"`cue_out_override_ms ?? cue_out_ms ?? duration_ms`: null before analysis."},"mix_out_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"`mix_out_override_ms ?? mix_out_ms ?? effective cue out`: null before analysis."}},"required":["cue_in_ms","cue_out_ms","mix_out_ms"],"additionalProperties":false,"description":"The cue points playout uses: each override wins over the analysed value (engine-protocol.md §Effective cue points)."},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"Sorted by name."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","source_id","s3_key","etag","size_bytes","kind","status","error","title","artist","album","year","genre","isrc","duration_ms","codec","sample_rate","channels","bitrate_kbps","loudness_lufs","true_peak_dbtp","cue_in_ms","cue_out_ms","mix_out_ms","peaks_key","analyzed_at","cue_in_override_ms","cue_out_override_ms","mix_out_override_ms","gain_override_db","intro_ms","has_video","video_width","video_height","video_frame_rate","video_codec","video_key","video_etag","video_size_bytes","effective","tags","created_at","updated_at"],"additionalProperties":false,"description":"An audio or video file of a source: its descriptive fields (read from the file's tags, editable), the analysis results (format, loudness, cue points; for a video item, the source's picture and its mezzanine), the manual overrides, the `effective` cue points playout uses, and its tags.","examples":[{"id":"0192f0c1-0000-7000-8000-000000000001","source_id":"0192f0c9-0000-7000-8000-000000000001","s3_key":"music/the-sine-waves/highway-static.mp3","etag":"5d41402abc4b2a76b9719d911017c592","size_bytes":8574216,"kind":"music","status":"ready","error":null,"title":"Highway Static","artist":"The Sine Waves","album":"Pure Tones","year":1999,"genre":"Rock","isrc":"DEA629900017","duration_ms":214000,"codec":"mp3","sample_rate":44100,"channels":2,"bitrate_kbps":320,"loudness_lufs":-9.6,"true_peak_dbtp":-0.4,"cue_in_ms":120,"cue_out_ms":212500,"mix_out_ms":208000,"peaks_key":"_radioengine/peaks/0192f0c1-0000-7000-8000-000000000001.json","analyzed_at":"2026-09-01T09:12:31.000Z","cue_in_override_ms":null,"cue_out_override_ms":null,"mix_out_override_ms":null,"gain_override_db":null,"intro_ms":18400,"has_video":false,"video_width":null,"video_height":null,"video_frame_rate":null,"video_codec":null,"video_key":null,"video_etag":null,"video_size_bytes":null,"effective":{"cue_in_ms":120,"cue_out_ms":212500,"mix_out_ms":208000},"tags":[{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z"}],"created_at":"2026-09-01T09:10:02.000Z","updated_at":"2026-09-01T09:12:31.000Z"},{"id":"0192f0c1-0000-7000-8000-00000000000c","source_id":"0192f0c9-0000-7000-8000-000000000001","s3_key":"music/videos/The Sine Waves - Highway Static (Live).mov","etag":"9e107d9d372bb6826bd81d3542a419d6","size_bytes":412316860,"kind":"music","status":"ready","error":null,"title":"Highway Static (Live)","artist":"The Sine Waves","album":null,"year":2024,"genre":"Rock","isrc":null,"duration_ms":241000,"codec":"aac","sample_rate":48000,"channels":2,"bitrate_kbps":256,"loudness_lufs":-11.2,"true_peak_dbtp":-0.6,"cue_in_ms":0,"cue_out_ms":238500,"mix_out_ms":236000,"peaks_key":"_radioengine/peaks/0192f0c1-0000-7000-8000-00000000000c.json","analyzed_at":"2026-10-01T14:06:52.000Z","cue_in_override_ms":null,"cue_out_override_ms":null,"mix_out_override_ms":null,"gain_override_db":null,"intro_ms":null,"has_video":true,"video_width":1280,"video_height":720,"video_frame_rate":29.97,"video_codec":"h264","video_key":"_radioengine/video/0192f0c1-0000-7000-8000-00000000000c-9e107d9d.mp4","video_etag":"7b3e91aa5c2d4e6f8a0b1c2d3e4f5a6b","video_size_bytes":180750000,"effective":{"cue_in_ms":0,"cue_out_ms":238500,"mix_out_ms":236000},"tags":[{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z"}],"created_at":"2026-10-01T14:00:00.000Z","updated_at":"2026-10-01T14:06:52.000Z"}]},"MediaMatches":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null for a shared category."},"mode":{"type":"string","enum":["static","filter"]}},"required":["id","name","station_id","mode"],"additionalProperties":false},"matched":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of the given items the category holds."},"stations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"description":"The stations that use the category (a slot of their clocks, a window's padding, their fallback or filler, their pad), by slug; for a filter category, only those whose sources hold the items it matches."}},"required":["category","matched","stations"],"additionalProperties":false},"description":"The categories that hold some of the items, by name: a static category that lists them, or a filter category that matches them for a station (from that station's sources: a station's own category for that station, a shared one for each station that uses it)."},"unmatched":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of the items no listed category holds."}},"required":["categories","unmatched"],"additionalProperties":false,"description":"Where media items will play: the categories they fall into, and the stations that use those categories.","examples":[{"categories":[{"category":{"id":"0192f0ca-0000-7000-8000-000000000002","name":"Idents","station_id":null,"mode":"static"},"matched":1,"stations":[{"id":"0192f0c4-0000-7000-8000-000000000001","slug":"rock","name":"Rock FM"},{"id":"0192f0c4-0000-7000-8000-000000000002","slug":"talk","name":"Talk Radio"}]},{"category":{"id":"0192f0ca-0000-7000-8000-000000000001","name":"Rock","station_id":"0192f0c4-0000-7000-8000-000000000001","mode":"filter"},"matched":2,"stations":[{"id":"0192f0c4-0000-7000-8000-000000000001","slug":"rock","name":"Rock FM"}]}],"unmatched":0},{"categories":[],"unmatched":3}]},"MediaPeaks":{"type":"object","properties":{"version":{"type":"number","const":1},"length_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The length of the audio the points cover."},"points":{"maxItems":1000,"type":"array","items":{"type":"number","minimum":0,"maximum":1},"description":"At most 1000 values in 0..1, evenly spread over the file and normalized so the loudest is 1. Files under 1 s have one per millisecond."}},"required":["version","length_ms","points"],"additionalProperties":false,"description":"The waveform of a media item, for drawing it.","examples":[{"version":1,"length_ms":214000,"points":[0,0.12,0.48,0.63,0.71,0.69,0.74,0.92,1,0.95,0.88,0.9,0.97,0.99,0.93,0.81,0.77,0.94,0.98,0.64,0.31,0.04]}]},"MediaStatusCounts":{"type":"object","properties":{"pending":{"type":"integer","minimum":0,"maximum":9007199254740991},"analyzing":{"type":"integer","minimum":0,"maximum":9007199254740991},"ready":{"type":"integer","minimum":0,"maximum":9007199254740991},"error":{"type":"integer","minimum":0,"maximum":9007199254740991},"missing":{"type":"integer","minimum":0,"maximum":9007199254740991},"deleted":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["pending","analyzing","ready","error","missing","deleted"],"additionalProperties":false,"description":"A source's media items by status.","examples":[{"pending":0,"analyzing":2,"ready":1240,"error":3,"missing":1,"deleted":5}]},"MediaUpload":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The new media item: `pending` until its file is analysed."},"url":{"type":"string","description":"The presigned PUT URL, valid until `expires_at`."},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Send these headers with the PUT: the signature covers them. Browsers set `content-length` themselves and refuse to set it, so browser clients leave it out."},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["media_item_id","url","method","headers","expires_at"],"additionalProperties":false,"description":"Where to PUT the file of a new media item. Complete the upload with `POST /v1/media/uploads/{media_item_id}/complete` once the PUT succeeded.","examples":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000002","url":"https://s3.example.com/re-library/music/M%C3%B6tley%20T%C3%B6nes%20-%20Night%20Drive.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=RE0EXAMPLE0KEY%2F20261001%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261001T140000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=content-length%3Bcontent-type%3Bhost&X-Amz-Signature=3b5f0c4e2a9d8f7e6c1b0a9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e9d","method":"PUT","headers":{"content-type":"audio/mpeg","content-length":"7340032"},"expires_at":"2026-10-01T15:00:00.000Z"}]},"MediaUsage":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","name","station_id"],"additionalProperties":false},"description":"Static categories that list the item, by name. `station_id` is null for shared ones."},"clock_slots":{"type":"array","items":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clock_name":{"type":"string"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["clock_id","clock_name","station_id","slot_id","position"],"additionalProperties":false},"description":"Media slots that play the item, by station, clock and position."},"feeds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"description":"Feeds whose fallback item it is."},"log_items":{"type":"object","properties":{"planned":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Its log items that are planned and haven't started yet."},"next_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the earliest of them starts."}},"required":["planned","next_at"],"additionalProperties":false,"description":"What the stations' logs plan to play."},"plays":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How often it aired."},"last_played_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When it last started to air."}},"required":["count","last_played_at"],"additionalProperties":false,"description":"The as-played history."}},"required":["categories","clock_slots","feeds","log_items","plays"],"additionalProperties":false,"description":"Where a media item is used. Using an item never blocks editing or deleting it, but deleting it takes it out of these.","examples":[{"categories":[{"id":"0192f0ca-0000-7000-8000-000000000002","name":"Idents","station_id":null}],"clock_slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","station_id":"0192f0c4-0000-7000-8000-000000000001","slot_id":"0192f0c3-0000-7000-8000-000000000002","position":3}],"feeds":[{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"}],"log_items":{"planned":2,"next_at":"2026-10-01T14:30:00.000Z"},"plays":{"count":41,"last_played_at":"2026-10-01T13:30:02.500Z"}}]},"Node":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"public_base_url":{"type":"string"},"status":{"type":"string","enum":["online","offline"]},"hostname":{"type":["string","null"]},"version":{"type":["string","null"]},"last_heartbeat_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"info":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"What the node's agent last reported, `{}` until it first connects. It is the latest `agent.heartbeat` (engine-protocol.md §Agent channel), sent every 10 s, plus `disk_total_bytes` from the agent's hello:\n\n- `disk_free_bytes`, `disk_total_bytes`: the data directory's disk (the `node.disk_low` alert opens below 10 % free);\n- `mem_free_bytes`, `load_avg` (1, 5 and 15 minutes);\n- `stations`: `[{station_id, state, since}]`, the station processes the agent runs, `state` being `running`, `starting`, `stopped` or `failed`;\n- `sync`: `{pending_items, pending_bytes, failed_items}`, the media mirror's download queue.\n\nThe schema leaves it open because it holds what the agent sent, whatever its version. `last_heartbeat_at` says how fresh it is: a node is `offline` after 60 s without one.","examples":[{"disk_free_bytes":828091625472,"disk_total_bytes":1995165736960,"mem_free_bytes":2147483648,"load_avg":[0.42,0.37,0.31],"stations":[{"station_id":"0192f0c4-0000-7000-8000-000000000001","state":"running","since":"2026-10-01T06:00:04.118Z"}],"sync":{"pending_items":0,"pending_bytes":0,"failed_items":0}}]},"media":{"type":"object","properties":{"required":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Media items its active stations need: the ready items of its manifest (engine-protocol.md §REST endpoints for nodes), from their sources, the static categories, clock slots and upcoming log items they use, and their feeds."},"held":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of them the node holds in their current version (it reported the item's current ETag)."},"missing":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"`required − held`: what the node still has to fetch. A station that requires synced media (`require_synced`) plans only what its node holds."}},"required":["required","held","missing"],"additionalProperties":false,"description":"How much of the media its stations need the node holds. `info.sync` is the agent's own download queue; this is the API's view of what is missing."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","public_base_url","status","hostname","version","last_heartbeat_at","info","media","created_at","updated_at"],"additionalProperties":false,"description":"A stream server: the agent's connection state and its last heartbeat (`info`). Its stations are those whose `node_id` is this node.","examples":[{"id":"0192f0cf-0000-7000-8000-000000000001","name":"stream1","public_base_url":"https://stream1.example.com","status":"online","hostname":"stream1.example.com","version":"0.1.0","last_heartbeat_at":"2026-10-01T13:59:58.201Z","info":{"disk_free_bytes":828091625472,"disk_total_bytes":1995165736960,"mem_free_bytes":2147483648,"load_avg":[0.42,0.37,0.31],"stations":[{"station_id":"0192f0c4-0000-7000-8000-000000000001","state":"running","since":"2026-10-01T06:00:04.118Z"}],"sync":{"pending_items":0,"pending_bytes":0,"failed_items":0}},"media":{"required":1312,"held":1113,"missing":199},"created_at":"2026-09-01T08:45:00.000Z","updated_at":"2026-10-01T13:59:58.201Z"}]},"NodeSyncRequested":{"type":"object","properties":{},"additionalProperties":false,"description":"Nothing more: the agent walks its manifest in the background.","examples":[{}]},"NodeToken":{"type":"object","properties":{"token":{"type":"string","description":"The new node token (`ren_…`). It is shown only this once; the old one stops working."}},"required":["token"],"additionalProperties":false,"examples":[{"token":"ren_Wq7Zt2Ys5Xb8Vc1Ud4Re6Pf9Og3Nh0Mi5Lj8Kk2Jl7a"}]},"NodeWithToken":{"type":"object","properties":{"node":{"$ref":"#/components/schemas/Node"},"token":{"type":"string","description":"The node token (`ren_…`), for the node's `node.env` (`RADIOENGINE_NODE_TOKEN`). It is shown only this once; only its hash is stored."}},"required":["node","token"],"additionalProperties":false,"examples":[{"node":{"id":"0192f0cf-0000-7000-8000-000000000001","name":"stream1","public_base_url":"https://stream1.example.com","status":"offline","hostname":null,"version":null,"last_heartbeat_at":null,"info":{},"media":{"required":0,"held":0,"missing":0},"created_at":"2026-09-01T08:45:00.000Z","updated_at":"2026-09-01T08:45:00.000Z"},"token":"ren_Hk2mP9vQx4Lr7sT1wZc8Nb5Fy3Jd6Ga0Ue2Ro9Ki4Mn"}]},"NotificationChannel":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"kind":{"type":"string","enum":["slack","telegram","email"]},"config":{"anyOf":[{"$ref":"#/components/schemas/RedactedSlackConfig"},{"$ref":"#/components/schemas/RedactedTelegramConfig"},{"$ref":"#/components/schemas/RedactedEmailConfig"}],"description":"The channel's config for its kind, with its secrets hidden (`…`)."},"min_severity":{"type":"string","enum":["info","warning","critical"],"description":"Alerts of this severity and above are sent (`info` < `warning` < `critical`)."},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"Only alerts of these stations, and alerts without a station. Null means every alert."},"enabled":{"type":"boolean","description":"A disabled channel gets no alert messages (tests still go out)."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","kind","config","min_severity","station_ids","enabled","created_at","updated_at"],"additionalProperties":false,"description":"Where alert messages go: a Slack incoming webhook, a Telegram chat or email recipients, with a minimum severity and optionally only some stations. The config is stored encrypted and shown with its secrets hidden.","examples":[{"id":"0192f0d9-0000-7000-8000-000000000001","name":"#radio-ops","kind":"slack","config":{"webhook_url":"https://hooks.slack.com/…a1B2"},"min_severity":"warning","station_ids":null,"enabled":true,"created_at":"2026-09-02T10:15:00.000Z","updated_at":"2026-09-02T10:15:00.000Z"}]},"NotificationChannelTest":{"type":"object","properties":{"channel_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"queued_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the test message was queued. The worker sends it within seconds."}},"required":["channel_id","queued_at"],"additionalProperties":false,"description":"A queued test message.","examples":[{"channel_id":"0192f0d9-0000-7000-8000-000000000001","queued_at":"2026-10-01T14:03:12.000Z"}]},"NowPlaying":{"type":"object","properties":{"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"current":{"anyOf":[{"$ref":"#/components/schemas/NowPlayingCurrent"},{"type":"null"}]},"next":{"type":"array","items":{"$ref":"#/components/schemas/UpcomingLogItem"},"description":"The next 3 items of the log (status `planned` or `loaded`), in order."},"recent":{"type":"array","items":{"$ref":"#/components/schemas/AsPlayed"},"description":"The last 5 plays that ended, newest first."},"listeners":{"$ref":"#/components/schemas/NowPlayingListeners"},"runtime":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"`stations.runtime` as stored: the engine's last `station.status` data (`state`, `current`, `buffer_ahead_ms`, `drift_ms`, `outputs`) plus `connected`. Null until the station reports. The `Station` schema describes it.","examples":[{"state":"playing","current":{"log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","started_at":"2026-10-01T13:58:12.400Z","position_ms":95300},"buffer_ahead_ms":1500,"drift_ms":3,"outputs":[{"output_id":"0192f0ce-0000-7000-8000-000000000001","state":"connected","restarts":0},{"output_id":"0192f0ce-0000-7000-8000-000000000002","state":"connected","restarts":0}],"connected":true}]},"runtime_updated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When `runtime` was last written."}},"required":["station_id","current","next","recent","listeners","runtime","runtime_updated_at"],"additionalProperties":false,"description":"What a station is playing (`current`), what comes next (`next`), what it just played (`recent`), its listeners now, and what its process last reported (`runtime`).","examples":[{"station_id":"0192f0c4-0000-7000-8000-000000000001","current":{"as_played_id":"0192f0c7-0000-7000-8000-000000000002","log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_item_id":null,"title":"Neon Harbor","artist":"The Night Signals","kind":"music","origin":"log","started_at":"2026-10-01T13:58:12.400Z","planned_duration_ms":107600,"position_ms":97300},"next":[{"id":"0192f0c2-0000-7000-8000-000000000003","planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":61800,"start_mode":"hard","type":"feed","status":"loaded","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-00000000000b","title":"News 14:00","artist":null,"album":null,"kind":"news","duration_ms":62000},"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"},"feed_item":{"id":"0192f0c6-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z"}},{"id":"0192f0c2-0000-7000-8000-000000000004","planned_start_at":"2026-10-01T14:01:01.800Z","planned_duration_ms":205000,"start_mode":"sequential","type":"media","status":"planned","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000002","title":"Paper Satellites","artist":"Juniper Road","album":"Low Orbit","kind":"music","duration_ms":211300},"feed":null,"feed_item":null},{"id":"0192f0c2-0000-7000-8000-000000000005","planned_start_at":"2026-10-01T14:04:26.800Z","planned_duration_ms":198400,"start_mode":"sequential","type":"media","status":"planned","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000005","title":"Glass Canyon","artist":"The Low Frequencies","album":null,"kind":"music","duration_ms":204900},"feed":null,"feed_item":null}],"recent":[{"id":"0192f0c7-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","node_id":"0192f0cf-0000-7000-8000-000000000001","log_item_id":"0192f0c2-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_item_id":null,"origin":"log","started_at":"2026-10-01T13:58:07.200Z","ended_at":"2026-10-01T13:58:15.400Z","duration_ms":8200,"end_reason":"completed","title":"Rock FM Station ID","artist":null,"isrc":null,"kind":"station_id","created_at":"2026-10-01T13:58:07.228Z"}],"listeners":{"total":184,"by_output":{"0192f0ce-0000-7000-8000-000000000001":142,"0192f0ce-0000-7000-8000-000000000002":42},"sampled_at":"2026-10-01T13:59:40.000Z"},"runtime":{"state":"playing","current":{"log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","started_at":"2026-10-01T13:58:12.400Z","position_ms":95300},"buffer_ahead_ms":1500,"drift_ms":3,"outputs":[{"output_id":"0192f0ce-0000-7000-8000-000000000001","state":"connected","restarts":0},{"output_id":"0192f0ce-0000-7000-8000-000000000002","state":"connected","restarts":0}],"connected":true},"runtime_updated_at":"2026-10-01T13:59:45.012Z"}]},"NowPlayingCurrent":{"type":"object","properties":{"as_played_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The `as_played` row, whose id is the engine's `item.started` `event_id`."},"log_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null for fallback and filler items."},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null after the media item was deleted."},"feed_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null unless a feed item is playing."},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"origin":{"type":"string","enum":["log","fallback","filler"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"planned_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How long it plays: the log item's play length, or for fallback and filler items the media's effective cue out − cue in."},"position_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The playback position now, from the station's last status. Null when the runtime is older than 60 s, the station isn't connected, or its status names another item."}},"required":["as_played_id","log_item_id","media_item_id","feed_item_id","title","artist","kind","origin","started_at","planned_duration_ms","position_ms"],"additionalProperties":false,"description":"The item on air: the most recently started play, while it hasn't ended (and at most 10 min past its planned end, after which its end counts as lost). The same fields as the `track.started` event data, plus `position_ms`.","examples":[{"as_played_id":"0192f0c7-0000-7000-8000-000000000002","log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_item_id":null,"title":"Neon Harbor","artist":"The Night Signals","kind":"music","origin":"log","started_at":"2026-10-01T13:58:12.400Z","planned_duration_ms":107600,"position_ms":97300}]},"NowPlayingListeners":{"type":"object","properties":{"total":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The sum of `by_output`. Null when no output has a sample from the last 60 s."},"by_output":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":"Listeners per output id, from each output's latest sample if it is at most 60 s old."},"sampled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The newest sample of any of the station's outputs, however old. Null if there is none."}},"required":["total","by_output","sampled_at"],"additionalProperties":false,"description":"The latest listener counts. Samples older than 60 s are stale and left out, so a missing output or a null total means the agent isn't reporting.","examples":[{"total":184,"by_output":{"0192f0ce-0000-7000-8000-000000000001":142,"0192f0ce-0000-7000-8000-000000000002":42},"sampled_at":"2026-10-01T13:59:40.000Z"}]},"Output":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$","description":"Unique per station. Also the output's HLS directory name."},"kind":{"type":"string","enum":["icecast","hls"]},"codec":{"type":"string","enum":["mp3","aac","opus"]},"bitrate_kbps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sample_rate":{"type":"number","enum":[22050,44100,48000]},"channels":{"type":"number","enum":[1,2]},"enabled":{"type":"boolean","description":"Disabled outputs aren't sent to the node, so nothing streams."},"config":{"anyOf":[{"type":"object","properties":{"mount":{"type":"string","pattern":"^\\/[A-Za-z0-9][A-Za-z0-9._-]*$"},"public":{"type":"boolean"},"stream_name":{"type":"string"},"description":{"type":"string"},"genre":{"type":"string"}},"required":["mount","public","stream_name","description","genre"],"additionalProperties":false},{"type":"object","properties":{"segment_seconds":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"list_size":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"segment_type":{"type":"string","enum":["mpegts","fmp4"]},"video":{"type":"boolean"}},"required":["segment_seconds","list_size","segment_type"],"additionalProperties":false}],"description":"`IcecastOutputConfig` for Icecast outputs, `HlsOutputConfig` for HLS outputs."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","station_id","name","kind","codec","bitrate_kbps","sample_rate","channels","enabled","config","created_at","updated_at"],"additionalProperties":false,"description":"One encoding of a station's stream: an Icecast mount or an HLS rendition. A station's audio-only HLS outputs share one master playlist (`master.m3u8`). An HLS output with `config.video: true` is a video output: it carries the station's picture (1080p, 25 fps, copied from the video items' mezzanines; the slate between them) with its sound, and the video outputs share `video.m3u8`. Its `codec`, `bitrate_kbps`, `sample_rate` and `channels` describe its sound. A video output reaches only nodes whose agent speaks protocol 4 or more; on an older node it is left out of the configuration and shows as not connected.","examples":[{"id":"0192f0ce-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"mp3","kind":"icecast","codec":"mp3","bitrate_kbps":128,"sample_rate":44100,"channels":2,"enabled":true,"config":{"mount":"/rock-mp3","public":true,"stream_name":"Rock FM","description":"Classic and modern rock, news on the hour.","genre":"Rock"},"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"},{"id":"0192f0ce-0000-7000-8000-000000000002","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"hls","kind":"hls","codec":"aac","bitrate_kbps":64,"sample_rate":44100,"channels":2,"enabled":true,"config":{"segment_seconds":6,"list_size":10,"segment_type":"mpegts"},"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"},{"id":"0192f0ce-0000-7000-8000-000000000003","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"video","kind":"hls","codec":"aac","bitrate_kbps":128,"sample_rate":48000,"channels":2,"enabled":true,"config":{"segment_seconds":4,"list_size":10,"segment_type":"mpegts","video":true},"created_at":"2026-10-01T09:00:00.000Z","updated_at":"2026-10-01T09:00:00.000Z"}]},"Pad":{"type":"object","properties":{"buttons":{"maxItems":48,"type":"array","items":{"$ref":"#/components/schemas/PadButton"},"description":"In position order."}},"required":["buttons"],"additionalProperties":false,"description":"A station's pad: up to 48 buttons that play an item or a category pick.","examples":[{"buttons":[{"id":"0192f0da-0000-7000-8000-000000000001","position":0,"label":"Station ID","color":"#e4572e","media_item_id":"0192f0c1-0000-7000-8000-000000000003","category_id":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":8200},"category":null},{"id":"0192f0da-0000-7000-8000-000000000002","position":1,"label":"Any ID","color":null,"media_item_id":null,"category_id":"0192f0ca-0000-7000-8000-000000000002","media":null,"category":{"id":"0192f0ca-0000-7000-8000-000000000002","name":"Idents","mode":"static"}},{"id":"0192f0da-0000-7000-8000-000000000003","position":2,"label":"Sponsor","color":"#2e86ab","media_item_id":"0192f0c1-0000-7000-8000-000000000004","category_id":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000004","title":"Garage Sale Spot","artist":null,"album":null,"kind":"spot","duration_ms":30100},"category":null}]}]},"PadButton":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The button's place on the pad, from 0."},"label":{"type":"string","minLength":1,"maxLength":40},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"`#rrggbb` (stored lowercase)."},{"type":"null"}]},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The media item it plays. Null for a category button."},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The category it picks from (the station's or a shared one). Null for a media button."},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's duration. Null until analyzed."},"intro_ms":{"description":"Where a song's vocals start, set by hand (api.md §Media and tags). Null when unknown; absent where the summary doesn't carry it.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","title","artist","album","kind","duration_ms"],"additionalProperties":false},{"type":"null"}],"description":"A summary of the media item; null for a category button."},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"mode":{"type":"string","enum":["static","filter"]}},"required":["id","name","mode"],"additionalProperties":false,"description":"The category a button picks from."},{"type":"null"}],"description":"The category; null for a media button."}},"required":["id","position","label","color","media_item_id","category_id","media","category"],"additionalProperties":false,"description":"A button of a station's pad: it plays one media item, or a pick from one category, with `POST /v1/stations/{id}/play`.","examples":[{"id":"0192f0da-0000-7000-8000-000000000001","position":0,"label":"Station ID","color":"#e4572e","media_item_id":"0192f0c1-0000-7000-8000-000000000003","category_id":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":8200},"category":null},{"id":"0192f0da-0000-7000-8000-000000000002","position":1,"label":"Any ID","color":null,"media_item_id":null,"category_id":"0192f0ca-0000-7000-8000-000000000002","media":null,"category":{"id":"0192f0ca-0000-7000-8000-000000000002","name":"Idents","mode":"static"}}]},"PlayReportRow":{"type":"object","properties":{"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"ended_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Null while it plays."},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"`ended_at − started_at`. Null while it plays."},"station":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$","description":"The station's slug."},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The station's id. JSON only: not a CSV column."},"media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The media item played; null once it was deleted. JSON only: not a CSV column."},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"isrc":{"type":["string","null"]},"kind":{"anyOf":[{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},{"type":"null"}]},"origin":{"type":"string","enum":["log","fallback","filler"]},"end_reason":{"anyOf":[{"type":"string","enum":["completed","faded","skipped","failed","interrupted"]},{"type":"null"}],"description":"Null while it plays."}},"required":["started_at","ended_at","duration_ms","station","station_id","media_item_id","title","artist","isrc","kind","origin","end_reason"],"additionalProperties":false,"description":"One play: an `as_played` row with its station's slug, and the media's metadata as it was when the play started.","examples":[{"started_at":"2026-10-01T13:58:12.400Z","ended_at":"2026-10-01T14:00:00.000Z","duration_ms":107600,"station":"rock","station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000001","title":"Neon Harbor","artist":"The Night Signals","isrc":"DEZ652600117","kind":"music","origin":"log","end_reason":"faded"}]},"PlayResult":{"type":"object","properties":{"item":{"description":"The new log item, pinned, as the plan after it left it.","$ref":"#/components/schemas/LogItem"},"log_generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The log's generation after the plan that followed."},"command_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The `play` command sent to the station, which answers with `command.result` for it (the API logs it)."}},"required":["item","log_generation","command_id"],"additionalProperties":false,"description":"The item `POST /v1/stations/{id}/play` put into the log, and the `play` command the station got after the log snapshot that holds it.","examples":[{"item":{"id":"0192f0c2-0000-7000-8000-000000000007","planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":5200,"start_mode":"sequential","type":"media","status":"planned","origin":"manual","pinned":true,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":8200,"intro_ms":null,"cue_in_ms":0,"cue_out_ms":8200},"feed":null,"feed_item":null,"station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_id":null,"resolved_feed_item_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"clock_id":null,"clock_slot_id":null,"clock_instance_start":null,"notes":null,"generation":413,"locked":true,"slot":null,"created_at":"2026-10-01T13:59:47.318Z","updated_at":"2026-10-01T13:59:47.318Z"},"log_generation":413,"command_id":"0192f0d7-0000-7000-8000-000000000001"}]},"PlaysReport":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PlayReportRow"},"description":"Every play that started in the range, oldest first."}},"required":["items"],"additionalProperties":false,"examples":[{"items":[{"started_at":"2026-10-01T13:58:07.200Z","ended_at":"2026-10-01T13:58:15.400Z","duration_ms":8200,"station":"rock","station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Station ID","artist":null,"isrc":null,"kind":"station_id","origin":"log","end_reason":"completed"},{"started_at":"2026-10-01T13:58:12.400Z","ended_at":"2026-10-01T14:00:00.000Z","duration_ms":107600,"station":"rock","station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000001","title":"Neon Harbor","artist":"The Night Signals","isrc":"DEZ652600117","kind":"music","origin":"log","end_reason":"faded"},{"started_at":"2026-10-01T14:00:00.000Z","ended_at":"2026-10-01T14:01:01.800Z","duration_ms":61800,"station":"rock","station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","title":"News 14:00","artist":null,"isrc":null,"kind":"news","origin":"log","end_reason":"completed"},{"started_at":"2026-10-01T14:01:01.800Z","ended_at":null,"duration_ms":null,"station":"rock","station_id":"0192f0c4-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000002","title":"Paper Satellites","artist":"Juniper Road","isrc":"GBX7L2600342","kind":"music","origin":"log","end_reason":null}]}]},"Problem":{"type":"object","properties":{"type":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"code":{"type":"string","minLength":1},"detail":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string","minLength":1}},"required":["path","message"],"additionalProperties":false}}},"required":["type","title","status","code","detail"],"additionalProperties":false,"description":"An error (RFC 9457). `code` is stable and machine-readable; `errors` lists the invalid fields of a `422 validation_failed`. See docs/api-guide/errors-and-idempotency.md.","examples":[{"type":"about:blank","title":"Unprocessable Entity","status":422,"code":"validation_failed","detail":"Request body is invalid","errors":[{"path":"position.at","message":"Must be at or after 2026-10-01T14:02:10.480Z: the log before it is locked"}]}]},"PublicNowPlaying":{"type":"object","properties":{"current":{"anyOf":[{"$ref":"#/components/schemas/PublicNowPlayingCurrent"},{"type":"null"}]},"next":{"type":"array","items":{"$ref":"#/components/schemas/PublicUpcomingItem"},"description":"The next 3 music, news, traffic and weather items of the log, in order."}},"required":["current","next"],"additionalProperties":false,"description":"What an active station is playing and what comes next: music, news, traffic and weather only.","examples":[{"current":{"title":"Neon Harbor","artist":"The Night Signals","kind":"music","started_at":"2026-10-01T13:58:12.400Z","duration_ms":107600},"next":[{"title":"News 14:00","artist":null,"planned_start_at":"2026-10-01T14:00:00.000Z"},{"title":"Paper Satellites","artist":"Juniper Road","planned_start_at":"2026-10-01T14:01:01.800Z"},{"title":"Glass Canyon","artist":"The Low Frequencies","planned_start_at":"2026-10-01T14:04:26.800Z"}]}]},"PublicNowPlayingCurrent":{"type":"object","properties":{"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"kind":{"type":"string","enum":["music","news","traffic","weather"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How long it plays: the log item's play length (for fallback items, the media's cue out − cue in). For a music item that has already ended, how long it played."}},"required":["title","artist","kind","started_at","duration_ms"],"additionalProperties":false,"description":"The music, news, traffic or weather item on air. While anything else plays (a jingle, a spot), the last music item that started within the hour, if any.","examples":[{"title":"Neon Harbor","artist":"The Night Signals","kind":"music","started_at":"2026-10-01T13:58:12.400Z","duration_ms":107600},{"title":"Traffic 08:15","artist":null,"kind":"traffic","started_at":"2026-10-01T08:15:00.000Z","duration_ms":62400}]},"PublicStation":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"streams":{"type":"array","items":{"$ref":"#/components/schemas/PublicStream"},"description":"Icecast mounts by output name, then HLS: the audio-only master playlist, then the video one. Empty when the station has no enabled output."}},"required":["slug","name","description","streams"],"additionalProperties":false,"description":"An active station and its listener URLs.","examples":[{"slug":"rock","name":"Rock FM","description":"Classic and modern rock, news on the hour.","streams":[{"kind":"icecast","codec":"mp3","bitrate_kbps":128,"url":"https://stream1.example.com/rock-mp3","video":false},{"kind":"hls","codec":"aac","bitrate_kbps":64,"url":"https://stream1.example.com/hls/rock/master.m3u8","video":false}]}]},"PublicStream":{"type":"object","properties":{"kind":{"type":"string","enum":["icecast","hls"]},"codec":{"type":"string","enum":["mp3","aac","opus"]},"bitrate_kbps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"For HLS, the highest bitrate among the renditions of the master playlist (their sound's, for a video playlist)."},"url":{"type":"string","description":"Where a player connects."},"video":{"type":"boolean","description":"Whether the stream carries the station's picture: the master playlist of its video outputs (1080p, 25 fps, H.264). Audio players should pick a stream without it."}},"required":["kind","codec","bitrate_kbps","url","video"],"additionalProperties":false,"description":"A listener URL: one per enabled Icecast output (`<node public URL>/<mount>`), one HLS master playlist (`<node public URL>/hls/<slug>/master.m3u8`) for all enabled audio-only HLS outputs, and one (`<node public URL>/hls/<slug>/video.m3u8`, `video: true`) for all enabled video outputs.","examples":[{"kind":"icecast","codec":"mp3","bitrate_kbps":128,"url":"https://stream1.example.com/rock-mp3","video":false},{"kind":"hls","codec":"aac","bitrate_kbps":64,"url":"https://stream1.example.com/hls/rock/master.m3u8","video":false},{"kind":"hls","codec":"aac","bitrate_kbps":128,"url":"https://stream1.example.com/hls/rock/video.m3u8","video":true}]},"PublicUpcomingItem":{"type":"object","properties":{"title":{"description":"For a bulletin (news, traffic or weather) slot whose item isn't chosen yet, the feed's name.","type":["string","null"]},"artist":{"type":["string","null"]},"planned_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["title","artist","planned_start_at"],"additionalProperties":false,"description":"A music, news, traffic or weather item of the log, still to play.","examples":[{"title":"Paper Satellites","artist":"Juniper Road","planned_start_at":"2026-10-01T14:01:01.800Z"},{"title":"News (hourly)","artist":null,"planned_start_at":"2026-10-01T15:00:00.000Z"}]},"ReadinessCheck":{"type":"object","properties":{"key":{"type":"string","enum":["node","node_online","outputs","sources","media","programme","slots","padding","fallback"],"description":"`node` (a node is assigned), `node_online` (its agent is connected), `outputs` (at least one enabled output), `sources` (at least one source), `media` (ready items in its sources), `programme` (a default clock or a schedule rule), `slots` (the category slots of the clocks it uses have members, as have the categories their windows are padded from, and their feeds a current item), `padding` (every window of those clocks can be padded: its slot has a padding category, or the station has a filler or fallback category; a warning names the first window without, with its clock as `subject`), `fallback` (a fallback category with members). With `require_synced`, `slots` and `fallback` also warn about members its node doesn't hold yet."},"status":{"type":"string","enum":["ok","warning","blocking"],"description":"`blocking` stops `POST /v1/stations/{id}/start` (`409 station_not_ready`, unless `force=true`): `node`, `outputs`, and `fallback` when nothing can play. Other failures are `warning`s."},"message":{"type":"string","description":"What the check found, for people."},"subject":{"description":"What to look at or fix: the station's settings, a node, an output, a clock or a category.","type":"object","properties":{"type":{"type":"string","enum":["station","node","output","clock","category"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"],"additionalProperties":false},"details":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"members":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Its members as the station sees them: a filter category matches only the station's sources."},"held":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"How many of them the station's node holds in their current version. Null unless the station requires synced media (`require_synced`) and has a node."}},"required":["id","name","members","held"],"additionalProperties":false},"description":"Every category the message is about, in the message's order (`subject` names only the first): categories without members, then those whose members aren't all on the node yet. Empty when the message is only about feeds, or about a missing fallback category."},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The node `held` counts on: the station's, when it requires synced media. Null otherwise."}},"required":["categories","node_id"],"additionalProperties":false,"description":"On `slots` and `fallback` when they aren't `ok`: what the message says, as data, so a client needn't parse it."}},"required":["key","status","message"],"additionalProperties":false,"description":"One readiness check of a station.","examples":[{"key":"slots","status":"warning","message":"Feed news-hourly (clock Standard hour) has no current item","subject":{"type":"clock","id":"0192f0cb-0000-7000-8000-000000000001"},"details":{"categories":[],"node_id":"0192f0cf-0000-7000-8000-000000000001"}},{"key":"slots","status":"warning","message":"Category Sweepers (clock Standard hour) has no members; DubaiPopALL: 199 members, none on stream1 yet","subject":{"type":"category","id":"0192f0ca-0000-7000-8000-000000000003"},"details":{"categories":[{"id":"0192f0ca-0000-7000-8000-000000000003","name":"Sweepers","members":0,"held":0},{"id":"0192f0ca-0000-7000-8000-000000000002","name":"DubaiPopALL","members":199,"held":0}],"node_id":"0192f0cf-0000-7000-8000-000000000001"}},{"key":"padding","status":"warning","message":"Window News at 00:00 (clock Standard hour) has nothing to pad it: give it a padding category, or set the station's filler or fallback category","subject":{"type":"clock","id":"0192f0cb-0000-7000-8000-000000000001"}},{"key":"fallback","status":"blocking","message":"No sources: nothing can play","subject":{"type":"station","id":"0192f0c4-0000-7000-8000-000000000001"},"details":{"categories":[{"id":"0192f0ca-0000-7000-8000-000000000001","name":"Music","members":0,"held":null}],"node_id":null}}]},"RedactedEmailConfig":{"type":"object","properties":{"smtp_url":{"type":"string","description":"Without the password, e.g. `smtps://alerts%40example.com:…@smtp.example.com:465`."},"from":{"type":"string","description":"The From header, e.g. `RadioEngine <alerts@example.com>`."},"to":{"type":"array","items":{"type":"string"},"description":"The recipients."}},"required":["smtp_url","from","to"],"additionalProperties":false,"description":"An email channel's config, with the SMTP password hidden.","examples":[{"smtp_url":"smtps://alerts%40example.com:…@smtp.example.com:465","from":"RadioEngine <alerts@example.com>","to":["oncall@example.com","studio@example.com"]}]},"RedactedSlackConfig":{"type":"object","properties":{"webhook_url":{"type":"string","description":"The incoming webhook's origin and last 4 characters, e.g. `https://hooks.slack.com/…a1B2`."}},"required":["webhook_url"],"additionalProperties":false,"description":"A Slack channel's config, with the webhook URL's secret path hidden.","examples":[{"webhook_url":"https://hooks.slack.com/…a1B2"}]},"RedactedTelegramConfig":{"type":"object","properties":{"bot_token":{"type":"string","description":"The bot id only, e.g. `123456789:…`."},"chat_id":{"type":"string","description":"A numeric chat id (e.g. `-1001234567890`) or an `@channel` name."}},"required":["bot_token","chat_id"],"additionalProperties":false,"description":"A Telegram channel's config, with the bot token's secret hidden.","examples":[{"bot_token":"123456789:…","chat_id":"-1001234567890"}]},"RotationRule":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null: the rule applies to every category of the station. Otherwise it keeps this category's picks apart from every pick near them, in either direction."},"kind":{"type":"string","enum":["song_separation","artist_separation","title_separation","max_plays_per_day","daypart"]},"params":{"anyOf":[{"type":"object","properties":{"minutes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["minutes"],"additionalProperties":false},{"type":"object","properties":{"count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["count"],"additionalProperties":false},{"type":"object","properties":{"tags_any":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"days_of_week":{"minItems":1,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"from":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"to":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"action":{"type":"string","enum":["exclude","only"]},"dates":{"type":"object","properties":{"from":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"},"to":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"}},"required":["from","to"],"additionalProperties":false}},"required":["tags_any","days_of_week","from","to","action"],"additionalProperties":false}],"description":"Depends on `kind` (api.md §Rotation rule params)."},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Relaxation order: rules with a lower priority are relaxed first."},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","station_id","category_id","kind","params","priority","enabled","created_at","updated_at"],"additionalProperties":false,"description":"A constraint on the station's rotation picks: a minimum time between plays of the same song, artist or title, a daily play limit, or a daypart window for tagged items.","examples":[{"id":"0192f0cd-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":"0192f0ca-0000-7000-8000-000000000001","kind":"artist_separation","params":{"minutes":45},"priority":10,"enabled":true,"created_at":"2026-09-01T09:10:00.000Z","updated_at":"2026-09-01T09:10:00.000Z"},{"id":"0192f0cd-0000-7000-8000-000000000002","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":null,"kind":"song_separation","params":{"minutes":180},"priority":20,"enabled":true,"created_at":"2026-09-01T09:11:00.000Z","updated_at":"2026-09-01T09:11:00.000Z"},{"id":"0192f0cd-0000-7000-8000-000000000003","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":null,"kind":"daypart","params":{"tags_any":["christmas"],"days_of_week":[1,2,3,4,5,6,7],"from":"00:00","to":"00:00","action":"only","dates":{"from":"12-01","to":"12-26"}},"priority":30,"enabled":true,"created_at":"2026-09-01T09:12:00.000Z","updated_at":"2026-09-01T09:12:00.000Z"}]},"RotationRuleBatchResult":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/RotationRule"},"description":"Every rotation rule of the station after the batch, in id order."}},"required":["rules"],"additionalProperties":false,"description":"The station's rotation rules after a batch.","examples":[{"rules":[{"id":"0192f0cd-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":"0192f0ca-0000-7000-8000-000000000001","kind":"artist_separation","params":{"minutes":60},"priority":10,"enabled":true,"created_at":"2026-09-01T09:10:00.000Z","updated_at":"2026-10-01T13:59:47.318Z"},{"id":"0192f0cd-0000-7000-8000-000000000004","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":null,"kind":"title_separation","params":{"minutes":120},"priority":5,"enabled":true,"created_at":"2026-10-01T13:59:47.318Z","updated_at":"2026-10-01T13:59:47.318Z"}]}]},"ScanQueued":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"job_id":{"description":"The queued `source-scan` job, or null if a scan of the source was already queued.","type":["string","null"]}},"required":["source_id","job_id"],"additionalProperties":false,"examples":[{"source_id":"0192f0c9-0000-7000-8000-000000000001","job_id":"0192f0d8-0000-7000-8000-000000000001"}]},"ScheduleInstance":{"type":"object","properties":{"clock_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null for the fallback pseudo-clock."},"rule_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The schedule rule that applies; null for the default clock and the fallback."},"source":{"type":"string","enum":["rule","default","fallback"],"description":"`rule`: a schedule rule applies; `default`: no rule does, so the station's `default_clock_id` applies; `fallback`: neither, so the fallback category plays."},"instance_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The instance's time on the clock's grid; anchor offsets count from it."},"start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"Where the instance is in effect: clipped where the clock changes mid-instance."},"end_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["clock_id","rule_id","source","instance_start_at","start_at","end_at"],"additionalProperties":false,"description":"One instance of a clock in a station's schedule. Instances are aligned to station-local midnight in multiples of the clock's duration.","examples":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","rule_id":"0192f0cc-0000-7000-8000-000000000001","source":"rule","instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"}]},"ScheduleRule":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A clock of the station."},"name":{"type":["string","null"]},"days_of_week":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"ISO days, 1 = Monday … 7 = Sunday: the day the range starts."},"start_time":{"type":"string","description":"Station-local `HH:MM:SS`, inclusive."},"end_time":{"type":"string","description":"Station-local `HH:MM:SS`, exclusive. At or before `start_time`, the range crosses midnight; equal to it, the range lasts 24 hours."},"valid_from":{"description":"Station-local `YYYY-MM-DD`, inclusive. Null: open.","type":["string","null"]},"valid_until":{"description":"Station-local `YYYY-MM-DD`, inclusive. Null: open.","type":["string","null"]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Where rules overlap, the highest priority wins; on a tie, the most recently created rule."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","station_id","clock_id","name","days_of_week","start_time","end_time","valid_from","valid_until","priority","created_at","updated_at"],"additionalProperties":false,"description":"Maps days of the week, a station-local time range and an optional date range to one of the station's clocks. Where no rule applies, the station's `default_clock_id` does.","examples":[{"id":"0192f0cc-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"All week","days_of_week":[1,2,3,4,5,6,7],"start_time":"00:00:00","end_time":"00:00:00","valid_from":null,"valid_until":null,"priority":0,"created_at":"2026-09-01T09:06:00.000Z","updated_at":"2026-09-01T09:06:00.000Z"}]},"ScheduleRuleBatchResult":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleRule"},"description":"Every rule of the station after the batch, in id order."}},"required":["rules"],"additionalProperties":false,"description":"The station's schedule rules after a batch.","examples":[{"rules":[{"id":"0192f0cc-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"All week","days_of_week":[1,2,3,4,5],"start_time":"00:00:00","end_time":"00:00:00","valid_from":null,"valid_until":null,"priority":0,"created_at":"2026-09-01T09:06:00.000Z","updated_at":"2026-10-01T13:59:47.318Z"},{"id":"0192f0cc-0000-7000-8000-000000000003","station_id":"0192f0c4-0000-7000-8000-000000000001","clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"Weekend","days_of_week":[6,7],"start_time":"00:00:00","end_time":"00:00:00","valid_from":null,"valid_until":null,"priority":10,"created_at":"2026-10-01T13:59:47.318Z","updated_at":"2026-10-01T13:59:47.318Z"}]}]},"SharedCategory":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"station_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Null for a shared category, which every station can use."},"name":{"type":"string"},"mode":{"type":"string","enum":["static","filter"],"description":"`static`: a list of media items (`PUT /v1/categories/{id}/items`). `filter`: the media items that match `filter`."},"filter":{"anyOf":[{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}},"tags_all":{"type":"array","items":{"type":"string","minLength":1}},"tags_any":{"type":"array","items":{"type":"string","minLength":1}},"tags_none":{"type":"array","items":{"type":"string","minLength":1}},"source_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"folders":{"type":"array","items":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"type":"string","maxLength":1024}},"required":["source_id","path"],"additionalProperties":false}},"artists":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"albums":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"genres":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"year_min":{"type":"integer","minimum":0,"maximum":9999},"year_max":{"type":"integer","minimum":0,"maximum":9999},"min_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"video":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}],"description":"Set when `mode` is `filter`: every given field must match."},"rotation":{"type":"string","enum":["least_recent","weighted_random","shuffle","sequential"],"description":"How the planner picks the next item."},"color":{"description":"A hex color such as `#16a34a`, or null.","type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"usage":{"type":"object","properties":{"stations":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many stations use it: through their clocks, pad, rotation rules, fallback or filler."},"clocks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many clocks have slots that pick from it or pad their window with it."}},"required":["stations","clocks"],"additionalProperties":false,"description":"Where it is used. Station-restricted API keys count only their stations and their clocks."}},"required":["id","station_id","name","mode","filter","rotation","color","created_at","updated_at","usage"],"additionalProperties":false,"description":"A shared category (`station_id` null) with how many stations and clocks use it.","examples":[{"id":"0192f0ca-0000-7000-8000-000000000002","station_id":null,"name":"Idents","mode":"static","filter":null,"rotation":"least_recent","color":"#ca8a04","created_at":"2026-09-01T09:20:00.000Z","updated_at":"2026-09-12T15:41:07.000Z","usage":{"stations":2,"clocks":3}}]},"SharedCategoryList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SharedCategory"},"description":"Ordered by name."}},"required":["items"],"additionalProperties":false,"description":"Every shared category, ordered by name. Not paginated.","examples":[{"items":[{"id":"0192f0ca-0000-7000-8000-000000000002","station_id":null,"name":"Idents","mode":"static","filter":null,"rotation":"least_recent","color":"#ca8a04","created_at":"2026-09-01T09:20:00.000Z","updated_at":"2026-09-12T15:41:07.000Z","usage":{"stations":2,"clocks":3}},{"id":"0192f0ca-0000-7000-8000-000000000004","station_id":null,"name":"Music","mode":"filter","filter":{"kinds":["music"]},"rotation":"least_recent","color":null,"created_at":"2026-09-01T09:10:00.000Z","updated_at":"2026-09-01T09:10:00.000Z","usage":{"stations":2,"clocks":2}}]}]},"Source":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"storage_connection_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prefix":{"type":"string","description":"`''` (the whole bucket) or a prefix ending in `/`."},"purpose":{"type":"string","enum":["library","feed"],"description":"`feed` for the source of feeds (a feed's source must have it), `library` otherwise."},"default_kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"],"description":"The kind of media items a scan creates."},"scan_interval_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"auto_categories":{"type":"boolean","description":"Library sources: after each complete scan, every folder directly under the prefix that holds media and has no category yet gets a shared filter category named after it (`Rock`, `Rock (2)` when the name is taken), once per folder."},"last_scanned_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the last complete scan finished; null if the source was never scanned."},"media_counts":{"$ref":"#/components/schemas/MediaStatusCounts"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","storage_connection_id","prefix","purpose","default_kind","scan_interval_seconds","auto_categories","last_scanned_at","media_counts","created_at","updated_at"],"additionalProperties":false,"description":"A prefix of a storage connection's bucket that media is scanned from, with its media items by status.","examples":[{"id":"0192f0c9-0000-7000-8000-000000000001","name":"Library","storage_connection_id":"0192f0d2-0000-7000-8000-000000000001","prefix":"music/","purpose":"library","default_kind":"music","scan_interval_seconds":3600,"auto_categories":true,"last_scanned_at":"2026-10-01T13:12:40.000Z","media_counts":{"pending":0,"analyzing":2,"ready":1240,"error":3,"missing":1,"deleted":5},"created_at":"2026-09-01T08:50:00.000Z","updated_at":"2026-09-01T08:50:00.000Z"},{"id":"0192f0c9-0000-7000-8000-000000000002","name":"Feeds","storage_connection_id":"0192f0d2-0000-7000-8000-000000000001","prefix":"feeds/","purpose":"feed","default_kind":"news","scan_interval_seconds":30,"auto_categories":false,"last_scanned_at":"2026-10-01T13:59:41.000Z","media_counts":{"pending":0,"analyzing":0,"ready":718,"error":0,"missing":0,"deleted":0},"created_at":"2026-09-01T08:52:00.000Z","updated_at":"2026-09-01T08:52:00.000Z"}]},"SourceFolder":{"type":"object","properties":{"name":{"type":"string","description":"The folder's own name"},"path":{"type":"string","description":"Its path below the source's prefix, ending in `/`: the `path` of its own subfolders, and the `folder` filter of `GET /v1/media`"},"item_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Media items in it and in its subfolders, deleted ones left out"},"has_subfolders":{"type":"boolean","description":"Whether it has subfolders (listed with its `path`)"}},"required":["name","path","item_count","has_subfolders"],"additionalProperties":false,"description":"A folder of a source: a path that its media items' keys share.","examples":[{"name":"Rock","path":"import/Rock/","item_count":1824,"has_subfolders":true}]},"Station":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"timezone":{"type":"string","description":"IANA time zone. Clocks, schedule rules and dayparts are local to it."},"status":{"type":"string","enum":["active","paused","disabled"],"description":"Whether the station is deployed: `active` (playing), `paused` (process stopped) or `disabled` (not deployed). What it is doing is in `runtime`."},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The stream server that runs the station."},"default_clock_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The clock that applies where no schedule rule does."},"fallback_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Plays where no clock applies. The node also gets up to 50 of its items, which the station plays when its log has nothing to play."},"filler_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Fills underruns before hard anchors. Null: underruns are accepted."},"target_lufs":{"type":"number"},"default_transition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"cut"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"crossfade"},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}],"description":"The transition into each item, unless its clock slot sets one: a cut or a crossfade."},"hard_fade_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How long the playing item fades out before a hard start."},"max_overrun_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The overrun the planner accepts at a hard anchor; the playing item is faded there."},"max_underrun_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The underrun the planner accepts before a hard anchor; the filler category, if set, fills it."},"plan_horizon_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How far ahead the planner writes the log."},"lock_window_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The planner doesn't change items that start within this many seconds."},"require_synced":{"type":"boolean","description":"The planner picks only media already synced to the station's node."},"silence_threshold_dbfs":{"type":"number"},"silence_max_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Output below `silence_threshold_dbfs` for this long while an item plays skips to the next item (`station.silence`)."},"video_slate_media_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The slate: what the station's video outputs show while an audio item plays or nothing is on air, a video item looped from its start. Null: black."},"log_generation":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped whenever the station's log is written."},"runtime":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"What the station process last reported, or null until it first reports. It is the engine's latest `station.status` (engine-protocol.md §Station channel) plus `connected`:\n\n- `state`: `starting`, `playing`, `fallback` or `stopping`;\n- `current`: `{log_item_id, media_item_id, started_at, position_ms}` of the item on air, or null (`log_item_id` is null while a fallback or filler item plays);\n- `buffer_ahead_ms`: audio mixed ahead of the encoders; `drift_ms`: the station clock against UTC;\n- `outputs`: `[{output_id, state, restarts}]`, `state` being `connected`, `reconnecting` or `failed`;\n- `connected`: false once the station's connection to the API closed.\n\nThe station reports every 5 s and the API stores it at most every 15 s unless the state changes, so read it with `runtime_updated_at`: the API counts a runtime last written more than 60 s ago as not connected (a skip then returns `409 station_not_connected`). The schema leaves it open because it holds what the engine sent, whatever its version.","examples":[{"state":"playing","current":{"log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","started_at":"2026-10-01T13:58:12.400Z","position_ms":95300},"buffer_ahead_ms":1500,"drift_ms":3,"outputs":[{"output_id":"0192f0ce-0000-7000-8000-000000000001","state":"connected","restarts":0},{"output_id":"0192f0ce-0000-7000-8000-000000000002","state":"connected","restarts":0}],"connected":true}]},"runtime_updated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When `runtime` was last written."},"source_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The sources whose media the station's filter categories pick from (`PUT /v1/stations/{id}/sources`)."},"public_urls":{"type":"array","items":{"$ref":"#/components/schemas/StationPublicUrl"},"description":"Listener URLs, from the enabled outputs and the node's `public_base_url`: each Icecast mount, the HLS master playlist of the audio-only HLS outputs, and the video master playlist of the video outputs (`video: true`). Empty without a node."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","slug","name","description","timezone","status","node_id","default_clock_id","fallback_category_id","filler_category_id","target_lufs","default_transition","hard_fade_ms","max_overrun_ms","max_underrun_ms","plan_horizon_minutes","lock_window_seconds","require_synced","silence_threshold_dbfs","silence_max_ms","video_slate_media_id","log_generation","runtime","runtime_updated_at","source_ids","public_urls","created_at","updated_at"],"additionalProperties":false,"description":"A radio station: its settings, its node, its sources, what its process last reported (`runtime`) and where listeners reach it (`public_urls`).","examples":[{"id":"0192f0c4-0000-7000-8000-000000000001","slug":"rock","name":"Rock FM","description":"Classic and modern rock, news on the hour.","timezone":"Europe/Berlin","status":"active","node_id":"0192f0cf-0000-7000-8000-000000000001","default_clock_id":"0192f0cb-0000-7000-8000-000000000001","fallback_category_id":"0192f0ca-0000-7000-8000-000000000001","filler_category_id":"0192f0ca-0000-7000-8000-000000000002","target_lufs":-16,"default_transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"hard_fade_ms":2000,"max_overrun_ms":8000,"max_underrun_ms":2000,"plan_horizon_minutes":180,"lock_window_seconds":120,"require_synced":true,"silence_threshold_dbfs":-50,"silence_max_ms":10000,"video_slate_media_id":null,"log_generation":412,"runtime":{"state":"playing","current":{"log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","started_at":"2026-10-01T13:58:12.400Z","position_ms":95300},"buffer_ahead_ms":1500,"drift_ms":3,"outputs":[{"output_id":"0192f0ce-0000-7000-8000-000000000001","state":"connected","restarts":0},{"output_id":"0192f0ce-0000-7000-8000-000000000002","state":"connected","restarts":0}],"connected":true},"runtime_updated_at":"2026-10-01T13:59:45.012Z","source_ids":["0192f0c9-0000-7000-8000-000000000001"],"public_urls":[{"kind":"icecast","url":"https://stream1.example.com/rock-mp3","output_ids":["0192f0ce-0000-7000-8000-000000000001"],"video":false},{"kind":"hls","url":"https://stream1.example.com/hls/rock/master.m3u8","output_ids":["0192f0ce-0000-7000-8000-000000000002"],"video":false}],"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-28T16:20:31.000Z"}]},"StationDiagnosis":{"type":"object","properties":{"state":{"type":"string","enum":["playing","fallback","starting","stopping","offline","paused","disabled"],"description":"The live state: `disabled` and `paused` from the station's status; for an active station the state it reports (`playing`, `fallback`, `starting`, `stopping`), or `offline` while it isn't connected or hasn't reported for 45 s (no `station.status` for 30 s, as `runtime_updated_at` may lag 15 s behind)."},"summary":{"type":"string","description":"One sentence, from the state and the most severe cause, e.g. \"Playing its log\" or \"Not reporting since 21:03: dev-node is online but says the station process stopped at 21:03\". Times are in the station's zone."},"since":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the state began, as far as the API knows: the station's latest `station.state_changed` to it; for `offline`, when it last reported (or its connection closed). Null when unknown (and for `paused` and `disabled`)."},"causes":{"type":"array","items":{"$ref":"#/components/schemas/DiagnosisCause"},"description":"Most severe first (`critical`, `warning`, `info`). Empty while the station plays its log with every output connected."},"node":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"online":{"type":"boolean","description":"Its agent is connected: a heartbeat in the last 60 s (`nodes.status`)."},"last_heartbeat_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","name","online","last_heartbeat_at"],"additionalProperties":false},{"type":"null"}],"description":"The station's node, or null without one."},"last_report_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the station last reported its status (`runtime_updated_at`: the last stored `station.status`, at most 15 s behind, or when its connection closed). Null if it never has."},"next_item_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the log's next item (planned or loaded) starts. Null when nothing is upcoming."}},"required":["state","summary","since","causes","node","last_report_at","next_item_at"],"additionalProperties":false,"description":"Whether a station is on air and, if not, why, with the fixes (`GET /v1/stations/{id}/diagnosis`).","examples":[{"state":"playing","summary":"Playing its log","since":"2026-10-01T12:00:04.210Z","causes":[],"node":{"id":"0192f0cf-0000-7000-8000-000000000001","name":"dev-node","online":true,"last_heartbeat_at":"2026-10-01T13:59:52.000Z"},"last_report_at":"2026-10-01T13:59:45.012Z","next_item_at":"2026-10-01T14:01:27.000Z"},{"state":"offline","summary":"Not reporting since 21:03: dev-node says the station process is running","since":"2026-10-10T19:03:35.595Z","causes":[{"code":"not_reporting","severity":"critical","message":"dev-node says the station process is running, but the station has sent no status since 21:03","actions":[{"kind":"restart","label":"Restart process"},{"kind":"start","label":"Start again"},{"kind":"open_node","label":"Open node"}]}],"node":{"id":"0192f0cf-0000-7000-8000-000000000001","name":"dev-node","online":true,"last_heartbeat_at":"2026-10-10T19:09:12.000Z"},"last_report_at":"2026-10-10T19:03:35.595Z","next_item_at":"2026-10-10T19:10:02.000Z"}]},"StationFeed":{"type":"object","properties":{"feed":{"$ref":"#/components/schemas/Feed"},"status":{"$ref":"#/components/schemas/StationFeedStatus"},"slots":{"type":"array","items":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clock_name":{"type":"string"},"slot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The slot's position in its clock, 0-based."},"anchor_offset_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Where the slot is anchored, from the start of the clock instance. Null: it follows the previous item."},"anchor_mode":{"anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"window_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The slot's window: its segment ends this long after the anchor. Null: none."},"max_length_ms":{"description":"The slot's cap: the feed's item plays at most this long, faded at its end. Null: none. Always present in responses.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pad_category_id":{"description":"The category the window is padded from first (a bed), before the station's filler and fallback categories. Null: none. Always present in responses.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":["string","null"]}},"required":["clock_id","clock_name","slot_id","position","anchor_offset_ms","anchor_mode","window_ms","label"],"additionalProperties":false,"description":"A slot of one of the station's clocks that plays the feed."},"description":"The slots of the station's clocks that play the feed, by clock name and position."},"log_items":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The station's upcoming log items (`planned`, `loaded`, `playing`) that play the feed and came from no clock slot: manual inserts."}},"required":["feed","status","slots","log_items"],"additionalProperties":false,"description":"A feed a station uses, with the station's status of it and where it plays.","examples":[{"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)","source_id":"0192f0c9-0000-7000-8000-000000000002","watch_prefix":false,"default_kind":"news","default_ttl_minutes":60,"on_missing":"skip","fallback_media_item_id":null,"reuse_grace_minutes":0,"expected_interval_minutes":60,"alert_lead_minutes":5,"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"},"status":{"current_item":{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}},"age_ms":330000,"expires_at":"2026-10-01T14:20:00.000Z","expires_in_ms":900000,"next_slot_at":"2026-10-01T15:00:00.000Z","next_item_expected_at":"2026-10-01T14:59:30.000Z","synced":true},"slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000001","position":0,"anchor_offset_ms":0,"anchor_mode":"hard","window_ms":90000,"max_length_ms":90000,"pad_category_id":"0192f0ca-0000-7000-8000-000000000006","label":"News"}],"log_items":0}]},"StationFeedStatus":{"type":"object","properties":{"current_item":{"anyOf":[{"$ref":"#/components/schemas/FeedItemWithMedia"},{"type":"null"}],"description":"What the station would play now: its newest valid item (by `valid_from`, then id) whose media is ready. Null when there is none."},"age_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Time since the current item's `valid_from`."},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The current item's `expires_at`."},"expires_in_ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Time until the current item expires."},"next_slot_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The start of the next feed slot in the station's planned log. Null when none is planned."},"next_item_expected_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the next item is due: the newest item's `valid_from` plus the feed's `expected_interval_minutes`. Null without an interval or without items."},"synced":{"description":"Whether the station's node holds the current item (`feed.synced`, or its sync report). Null when there is no current item or the station has no node.","type":["boolean","null"]}},"required":["current_item","age_ms","expires_at","expires_in_ms","next_slot_at","next_item_expected_at","synced"],"additionalProperties":false,"description":"The station's entry of `GET /v1/feeds/{id}/status`: its current item, that item's age and expiry, the next planned feed slot and when the next item is due, plus whether its node holds the current item.","examples":[{"current_item":{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}},"age_ms":330000,"expires_at":"2026-10-01T14:20:00.000Z","expires_in_ms":900000,"next_slot_at":"2026-10-01T15:00:00.000Z","next_item_expected_at":"2026-10-01T14:59:30.000Z","synced":true}]},"StationFeeds":{"type":"object","properties":{"feeds":{"type":"array","items":{"$ref":"#/components/schemas/StationFeed"},"description":"Ordered by feed name."}},"required":["feeds"],"additionalProperties":false,"description":"The feeds a station uses: a slot of its clocks names the feed, or an upcoming log item plays it.","examples":[{"feeds":[{"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)","source_id":"0192f0c9-0000-7000-8000-000000000002","watch_prefix":false,"default_kind":"news","default_ttl_minutes":60,"on_missing":"skip","fallback_media_item_id":null,"reuse_grace_minutes":0,"expected_interval_minutes":60,"alert_lead_minutes":5,"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"},"status":{"current_item":{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}},"age_ms":330000,"expires_at":"2026-10-01T14:20:00.000Z","expires_in_ms":900000,"next_slot_at":"2026-10-01T15:00:00.000Z","next_item_expected_at":"2026-10-01T14:59:30.000Z","synced":true},"slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000001","position":0,"anchor_offset_ms":0,"anchor_mode":"hard","window_ms":90000,"max_length_ms":90000,"pad_category_id":"0192f0ca-0000-7000-8000-000000000006","label":"News"}],"log_items":0},{"feed":{"id":"0192f0c5-0000-7000-8000-000000000002","slug":"traffic","name":"Traffic","source_id":"0192f0c9-0000-7000-8000-000000000002","watch_prefix":false,"default_kind":"news","default_ttl_minutes":30,"on_missing":"skip","fallback_media_item_id":null,"reuse_grace_minutes":0,"expected_interval_minutes":30,"alert_lead_minutes":5,"created_at":"2026-09-20T07:00:00.000Z","updated_at":"2026-09-20T07:00:00.000Z"},"status":{"current_item":null,"age_ms":null,"expires_at":null,"expires_in_ms":null,"next_slot_at":"2026-10-01T14:15:00.000Z","next_item_expected_at":"2026-10-01T14:14:00.000Z","synced":null},"slots":[],"log_items":1}]}]},"StationImaging":{"type":"object","properties":{"categories":{"type":"array","items":{"$ref":"#/components/schemas/StationImagingCategory"},"description":"Ordered by name."}},"required":["categories"],"additionalProperties":false,"description":"A station's imaging categories: its own and the shared ones that pick only jingles, station IDs, sweepers or beds.","examples":[{"categories":[{"category":{"id":"0192f0ca-0000-7000-8000-000000000002","station_id":null,"name":"Idents","mode":"static","filter":null,"rotation":"least_recent","color":"#ca8a04","created_at":"2026-09-01T09:20:00.000Z","updated_at":"2026-09-12T15:41:07.000Z"},"members":2,"plays_30d":1412,"slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000002","position":1,"every_n":null,"segment_end":false,"anchor_offset_ms":null,"anchor_mode":null,"transition_out":{"type":"overlay","duck_db":9,"lead_ms":2000,"fit_intro":true},"max_length_ms":null,"label":"Ident"},{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000004","position":3,"every_n":null,"segment_end":false,"anchor_offset_ms":1800000,"anchor_mode":"soft","transition_out":null,"max_length_ms":15000,"label":"Half-hour ident"}]},{"category":{"id":"0192f0ca-0000-7000-8000-000000000003","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"Sweepers","mode":"filter","filter":{"kinds":["sweeper"]},"rotation":"shuffle","color":"#7c3aed","created_at":"2026-09-14T10:02:00.000Z","updated_at":"2026-09-14T10:02:00.000Z"},"members":14,"plays_30d":960,"slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000007","position":5,"every_n":3,"segment_end":false,"anchor_offset_ms":null,"anchor_mode":null,"transition_out":{"type":"overlay","duck_db":6},"max_length_ms":null,"label":"Every 3 songs"}]}]}]},"StationImagingCategory":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/Category"},"members":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Its ready members as the station sees them: a filter category matches only the station's sources; a static list plays wherever its items are."},"plays_30d":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The station's plays of those members in the last 30 days, counted as `GET /v1/reports/top` counts plays."},"slots":{"type":"array","items":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clock_name":{"type":"string"},"slot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The slot's position in its clock, 0-based."},"every_n":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The slot plays after every N songs of the segment's other category slots."},"segment_end":{"type":"boolean","description":"The slot plays last in its segment."},"anchor_offset_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"anchor_mode":{"anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"transition_out":{"description":"The transition into the item after this slot's: an `overlay` plays the next song under this one (with `fit_intro`, so that this one ends where the song's vocals start). Null: none. Always present in responses.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"cut"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"crossfade"},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"overlay"},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}]},{"type":"null"}]},"max_length_ms":{"description":"The slot's cap: each pick plays at most this long. Null: none. Always present in responses.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"label":{"type":["string","null"]}},"required":["clock_id","clock_name","slot_id","position","every_n","segment_end","anchor_offset_ms","anchor_mode","label"],"additionalProperties":false,"description":"A slot of one of the station's clocks that picks from the category."},"description":"The slots of the station's clocks that pick from it, by clock name and position."}},"required":["category","members","plays_30d","slots"],"additionalProperties":false,"description":"An imaging category of a station: how much it holds, how often it plays, where.","examples":[{"category":{"id":"0192f0ca-0000-7000-8000-000000000002","station_id":null,"name":"Idents","mode":"static","filter":null,"rotation":"least_recent","color":"#ca8a04","created_at":"2026-09-01T09:20:00.000Z","updated_at":"2026-09-12T15:41:07.000Z"},"members":2,"plays_30d":1412,"slots":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000002","position":1,"every_n":null,"segment_end":false,"anchor_offset_ms":null,"anchor_mode":null,"transition_out":{"type":"overlay","duck_db":9,"lead_ms":2000,"fit_intro":true},"max_length_ms":null,"label":"Ident"},{"clock_id":"0192f0cb-0000-7000-8000-000000000001","clock_name":"Standard hour","slot_id":"0192f0c3-0000-7000-8000-000000000004","position":3,"every_n":null,"segment_end":false,"anchor_offset_ms":1800000,"anchor_mode":"soft","transition_out":null,"max_length_ms":15000,"label":"Half-hour ident"}]}]},"StationNotReadyProblem":{"type":"object","properties":{"type":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"status":{"type":"integer","minimum":400,"maximum":599},"code":{"type":"string","minLength":1},"detail":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string","minLength":1}},"required":["path","message"],"additionalProperties":false}},"checks":{"description":"With `station_not_ready`: every readiness check, as `GET /v1/stations/{id}/readiness` returns them. The `blocking` ones stop the start.","type":"array","items":{"$ref":"#/components/schemas/ReadinessCheck"}}},"required":["type","title","status","code","detail"],"additionalProperties":false,"description":"A conflict when starting a station. `station_not_ready` carries the readiness `checks`; `station_disabled` and `station_no_node` don't.","examples":[{"type":"about:blank","title":"Conflict","status":409,"code":"station_not_ready","detail":"Station jazz can't play yet (outputs). Fix the blocking checks, or start it with force=true.","checks":[{"key":"outputs","status":"blocking","message":"No enabled output: listeners can't hear it","subject":{"type":"station","id":"0192f0c4-0000-7000-8000-000000000002"}}]}]},"StationPreview":{"type":"object","properties":{"resolved":{"description":"The entry of `GET /v1/stations/{id}/schedule` that covers `at`: which clock applies, and why (`source`: a schedule rule, the default clock, or the fallback category).","$ref":"#/components/schemas/ScheduleInstance"},"preview":{"anyOf":[{"$ref":"#/components/schemas/ClockPreview"},{"type":"null"}],"description":"The dry run of that clock instance, as `GET /v1/clocks/{id}/preview?at=` returns it. Null when the fallback category plays (`source` is `fallback`)."}},"required":["resolved","preview"],"additionalProperties":false,"description":"What airs at a time on a station: the clock that applies, and its dry run.","examples":[{"resolved":{"clock_id":"0192f0cb-0000-7000-8000-000000000001","rule_id":"0192f0cc-0000-7000-8000-000000000001","source":"rule","instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"},"preview":{"clock_id":"0192f0cb-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","instance":{"instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"},"items":[{"planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":57000,"start_mode":"hard","type":"feed","media_item_id":null,"feed_id":"0192f0c5-0000-7000-8000-000000000001","transition":{"type":"cut"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000001","category_id":null,"notes":null,"media":null,"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"}},{"planned_start_at":"2026-10-01T14:00:57.000Z","planned_duration_ms":4200,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000002","category_id":"0192f0ca-0000-7000-8000-000000000002","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000003","title":"Rock FM Jingle","artist":null,"album":null,"kind":"jingle","duration_ms":5000},"feed":null},{"planned_start_at":"2026-10-01T14:01:01.200Z","planned_duration_ms":206000,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000001","title":"Northern Lights","artist":"The Wanderers","album":"Open Road","kind":"music","duration_ms":214000},"feed":null},{"planned_start_at":"2026-10-01T14:04:27.200Z","planned_duration_ms":4200,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-00000000000a","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000002","category_id":"0192f0ca-0000-7000-8000-000000000002","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-00000000000a","title":"Station ID","artist":null,"album":null,"kind":"station_id","duration_ms":5000},"feed":null},{"planned_start_at":"2026-10-01T14:04:31.400Z","planned_duration_ms":236500,"start_mode":"sequential","type":"media","media_item_id":"0192f0c1-0000-7000-8000-000000000002","feed_id":null,"transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"origin":"scheduler","clock_slot_id":"0192f0c3-0000-7000-8000-000000000003","category_id":"0192f0ca-0000-7000-8000-000000000001","notes":null,"media":{"id":"0192f0c1-0000-7000-8000-000000000002","title":"Long Way Home","artist":"Harbor Lights","album":null,"kind":"music","duration_ms":243000},"feed":null}],"stats":{"fill_error_ms":4200,"relaxations":0,"segments":[{"start_at":"2026-10-01T14:00:00.000Z","target_end_at":"2026-10-01T14:30:00.000Z","end_mode":"soft","end_at":"2026-10-01T14:30:04.200Z","error_ms":4200,"within_tolerance":true,"item_count":17,"filler_count":0},{"start_at":"2026-10-01T14:30:04.200Z","target_end_at":"2026-10-01T15:00:00.000Z","end_mode":"hard","end_at":"2026-10-01T14:59:58.500Z","error_ms":-1500,"within_tolerance":true,"item_count":9,"filler_count":0}]},"warnings":[]}},{"resolved":{"clock_id":null,"rule_id":null,"source":"fallback","instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"},"preview":null}]},"StationPublicUrl":{"type":"object","properties":{"kind":{"type":"string","enum":["icecast","hls"]},"url":{"type":"string","description":"The node's `public_base_url` followed by the Icecast mount, by `/hls/<station slug>/master.m3u8` for the audio-only HLS outputs, or by `/hls/<station slug>/video.m3u8` for the video outputs."},"output_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The outputs behind the URL: one Icecast output, every enabled audio-only HLS output, or every enabled video output."},"video":{"type":"boolean","description":"Whether the URL carries the station's picture: the video master playlist."}},"required":["kind","url","output_ids","video"],"additionalProperties":false,"description":"Where listeners reach a station: one URL per enabled Icecast output, one HLS master playlist for its enabled audio-only HLS outputs, and one for its enabled video outputs.","examples":[{"kind":"icecast","url":"https://stream1.example.com/rock-mp3","output_ids":["0192f0ce-0000-7000-8000-000000000001"],"video":false},{"kind":"hls","url":"https://stream1.example.com/hls/rock/video.m3u8","output_ids":["0192f0ce-0000-7000-8000-000000000003"],"video":true}]},"StationReadiness":{"type":"object","properties":{"ready":{"type":"boolean","description":"True when no check is `blocking`."},"checks":{"type":"array","items":{"$ref":"#/components/schemas/ReadinessCheck"},"description":"Every check, in a fixed order."}},"required":["ready","checks"],"additionalProperties":false,"description":"Whether a station can play, check by check, with what to fix.","examples":[{"ready":true,"checks":[{"key":"node","status":"ok","message":"Node dev-node is assigned","subject":{"type":"node","id":"0192f0cf-0000-7000-8000-000000000001"}},{"key":"node_online","status":"warning","message":"Node dev-node is offline: its agent isn't connected","subject":{"type":"node","id":"0192f0cf-0000-7000-8000-000000000001"}},{"key":"outputs","status":"ok","message":"2 enabled outputs","subject":{"type":"output","id":"0192f0ce-0000-7000-8000-000000000001"}},{"key":"sources","status":"ok","message":"1 source","subject":{"type":"station","id":"0192f0c4-0000-7000-8000-000000000001"}},{"key":"media","status":"ok","message":"Its sources have ready media","subject":{"type":"station","id":"0192f0c4-0000-7000-8000-000000000001"}},{"key":"programme","status":"ok","message":"Default clock Standard hour, and 1 schedule rule","subject":{"type":"clock","id":"0192f0cb-0000-7000-8000-000000000001"}},{"key":"slots","status":"warning","message":"Feed news-hourly (clock Standard hour) has no current item","subject":{"type":"clock","id":"0192f0cb-0000-7000-8000-000000000001"},"details":{"categories":[],"node_id":"0192f0cf-0000-7000-8000-000000000001"}},{"key":"padding","status":"ok","message":"1 window can be padded","subject":{"type":"station","id":"0192f0c4-0000-7000-8000-000000000001"}},{"key":"fallback","status":"ok","message":"Fallback category Music has members","subject":{"type":"category","id":"0192f0ca-0000-7000-8000-000000000001"}}]}]},"StationRestartAccepted":{"type":"object","properties":{},"additionalProperties":false,"description":"Nothing more: the node's agent restarts the process; the station's state follows in its events and diagnosis.","examples":[{}]},"StorageConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"endpoint":{"type":"string","description":"The S3 endpoint, e.g. `https://fsn1.your-objectstorage.com`."},"region":{"type":"string"},"bucket":{"type":"string"},"access_key_id":{"type":"string"},"force_path_style":{"type":"boolean","description":"Path-style addressing (`https://host/bucket/key`) instead of `https://bucket.host/key`."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","endpoint","region","bucket","access_key_id","force_path_style","created_at","updated_at"],"additionalProperties":false,"description":"An S3-compatible bucket and its credentials. The secret access key is never returned.","examples":[{"id":"0192f0d2-0000-7000-8000-000000000001","name":"hetzner-media","endpoint":"https://fsn1.your-objectstorage.com","region":"fsn1","bucket":"radioengine-media","access_key_id":"AKIAIOSFODNN7EXAMPLE","force_path_style":false,"created_at":"2026-09-01T08:40:00.000Z","updated_at":"2026-09-01T08:40:00.000Z"}]},"StorageConnectionTest":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"description":"Why the test failed, when `ok` is false. Never contains credentials.","type":"string"}},"required":["ok"],"additionalProperties":false,"examples":[{"ok":true},{"ok":false,"error":"Bucket radioengine-media does not exist at https://fsn1.your-objectstorage.com"}]},"StoragePrefix":{"type":"object","properties":{"prefix":{"type":"string","description":"The folder's whole key prefix, ending in `/`: a source's `prefix` as it is."},"name":{"type":"string","description":"Its last segment, without the `/`."}},"required":["prefix","name"],"additionalProperties":false,"description":"A folder of a bucket.","examples":[{"prefix":"music/Rock/","name":"Rock"}]},"StoragePrefixes":{"type":"object","properties":{"prefixes":{"type":"array","items":{"$ref":"#/components/schemas/StoragePrefix"},"description":"Sorted by name, ignoring case."},"truncated":{"type":"boolean","description":"Whether there are more than the 1000 listed (or so many files directly under the prefix that the listing stopped)."}},"required":["prefixes","truncated"],"additionalProperties":false,"description":"The folders directly under a prefix of a storage connection's bucket.","examples":[{"prefixes":[{"prefix":"music/Jazz/","name":"Jazz"},{"prefix":"music/Rock/","name":"Rock"}],"truncated":false}]},"Tag":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","description":"Lowercase and trimmed. Unique."},"color":{"description":"A hex color such as `#16a34a`, or null.","type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","color","created_at"],"additionalProperties":false,"description":"A label for media items, shared by every station. Category filters and daypart rules name tags by `name`.","examples":[{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z"}]},"TagWithCount":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","description":"Lowercase and trimmed. Unique."},"color":{"description":"A hex color such as `#16a34a`, or null.","type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"media_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many media items have the tag, deleted ones left out."}},"required":["id","name","color","created_at","media_count"],"additionalProperties":false,"description":"A tag as `GET /v1/tags` lists it: with the number of media items that have it.","examples":[{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z","media_count":9}]},"TopArtist":{"type":"object","properties":{"artist":{"type":"string","description":"Spelled as in its latest play."},"plays":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_played_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["artist","plays","last_played_at"],"additionalProperties":false,"description":"An artist of the top report (`by=artist`), counted ignoring case.","examples":[{"artist":"The Night Signals","plays":31,"last_played_at":"2026-10-01T13:58:12.400Z"}]},"TopReport":{"type":"object","properties":{"items":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TopTrack"},{"$ref":"#/components/schemas/TopArtist"}]},"description":"Most plays first: `TopTrack`s for `by=track`, `TopArtist`s for `by=artist`."}},"required":["items"],"additionalProperties":false,"examples":[{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000001","title":"Neon Harbor","artist":"The Night Signals","plays":14,"last_played_at":"2026-10-01T13:58:12.400Z"},{"media_item_id":"0192f0c1-0000-7000-8000-000000000002","title":"Paper Satellites","artist":"Juniper Road","plays":12,"last_played_at":"2026-10-01T14:01:01.800Z"}]},{"items":[{"artist":"The Night Signals","plays":31,"last_played_at":"2026-10-01T13:58:12.400Z"}]}]},"TopTrack":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"description":"As its latest play stored it (or the item's title).","type":["string","null"]},"artist":{"description":"As its latest play stored it (or the item's artist).","type":["string","null"]},"plays":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_played_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["media_item_id","title","artist","plays","last_played_at"],"additionalProperties":false,"description":"A media item of the top report (`by=track`).","examples":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000001","title":"Neon Harbor","artist":"The Night Signals","plays":14,"last_played_at":"2026-10-01T13:58:12.400Z"}]},"UpcomingLogItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The log item id."},"planned_start_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"planned_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Play length until the next item starts (for the item before a hard start, at most the time until it)."},"start_mode":{"type":"string","enum":["sequential","hard"]},"type":{"type":"string","enum":["media","feed"]},"status":{"type":"string","enum":["planned","loaded","playing","played","skipped","failed","cancelled"]},"origin":{"type":"string","enum":["scheduler","manual","api"]},"pinned":{"type":"boolean"},"media":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":["string","null"]},"artist":{"type":["string","null"]},"album":{"type":["string","null"]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"duration_ms":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's duration. Null until analyzed."},"intro_ms":{"description":"Where a song's vocals start, set by hand (api.md §Media and tags). Null when unknown; absent where the summary doesn't carry it.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","title","artist","album","kind","duration_ms"],"additionalProperties":false},{"type":"null"}]},"feed":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},{"type":"null"}]},"feed_item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valid_from":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","media_item_id","valid_from","expires_at"],"additionalProperties":false},{"type":"null"}],"description":"The feed item the station resolved for this slot, once it reported `item.loaded`. Null before that, and for media items."}},"required":["id","planned_start_at","planned_duration_ms","start_mode","type","status","origin","pinned","media","feed","feed_item"],"additionalProperties":false,"description":"A log item still to play. `media` is what will play: the media item, or for a feed item the resolved feed item's media (null until the station resolves it). `feed` is the feed, for feed items.","examples":[{"id":"0192f0c2-0000-7000-8000-000000000003","planned_start_at":"2026-10-01T14:00:00.000Z","planned_duration_ms":61800,"start_mode":"hard","type":"feed","status":"loaded","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-00000000000b","title":"News 14:00","artist":null,"album":null,"kind":"news","duration_ms":62000},"feed":{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)"},"feed_item":{"id":"0192f0c6-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z"}},{"id":"0192f0c2-0000-7000-8000-000000000004","planned_start_at":"2026-10-01T14:01:01.800Z","planned_duration_ms":205000,"start_mode":"sequential","type":"media","status":"planned","origin":"scheduler","pinned":false,"media":{"id":"0192f0c1-0000-7000-8000-000000000002","title":"Paper Satellites","artist":"Juniper Road","album":"Low Orbit","kind":"music","duration_ms":211300},"feed":null,"feed_item":null}]},"User":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string","description":"Stored lowercase. The user logs in with it."},"name":{"type":"string"},"role":{"type":"string","enum":["admin","editor","viewer"],"description":"`viewer` gets the `read` scope, `editor` every scope but `admin`, `admin` every scope (api.md §Scopes)."},"disabled_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the user was disabled (`DELETE /v1/users/{id}`); disabled users can't log in. Null for an active user."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","email","name","role","disabled_at","created_at","updated_at"],"additionalProperties":false,"description":"A dashboard user. The password hash is never returned.","examples":[{"id":"0192f0d0-0000-7000-8000-000000000001","email":"admin@example.com","name":"Admin","role":"admin","disabled_at":null,"created_at":"2026-09-01T08:30:00.000Z","updated_at":"2026-09-01T08:30:00.000Z"}]},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"url":{"type":"string","description":"Where deliveries are POSTed."},"event_types":{"type":"array","items":{"type":"string","enum":["media.ready","media.failed","source.scanned","log.updated","track.started","track.ended","feed_item.created","feed_item.synced","feed_item.withdrawn","station.state_changed","station.silence","output.state_changed","node.online","node.offline","alert.opened","alert.resolved","alert.acknowledged","pad.updated","programming.changed","config.changed","*"]},"description":"`[\"*\"]` means every event type."},"station_ids":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"Only events of these stations (then never events without a station). Null means every event, with or without a station."},"enabled":{"type":"boolean","description":"A disabled webhook receives no events (only test deliveries), and events that occur meanwhile are never delivered. The worker disables it after 100 consecutive failures."},"consecutive_failures":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Deliveries in a row that failed after all their retries. 100 disables the webhook; a success resets it."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","url","event_types","station_ids","enabled","consecutive_failures","created_at","updated_at"],"additionalProperties":false,"description":"A signed HTTP callback for events: `POST <url>` with the event envelope (docs/api-guide/webhooks.md).","examples":[{"id":"0192f0d4-0000-7000-8000-000000000001","name":"Website now playing","url":"https://www.example.com/hooks/radioengine","event_types":["track.started","track.ended"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"enabled":true,"consecutive_failures":0,"created_at":"2026-09-20T09:00:00.000Z","updated_at":"2026-09-20T09:00:00.000Z"}]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Sent as `X-RadioEngine-Delivery`; the same on every attempt."},"webhook_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event_type":{"type":"string","description":"The event's type, or `webhook.test` for a test delivery."},"status":{"type":"string","enum":["pending","succeeded","failed"],"description":"`pending` until an attempt succeeds (`succeeded`) or the last retry fails (`failed`)."},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Attempts made so far."},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the next attempt is due, while `pending`."},"response_status":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The HTTP status of the last attempt, if the receiver answered."},"last_error":{"description":"Why the last attempt failed.","type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","webhook_id","event_id","event_type","status","attempts","next_attempt_at","response_status","last_error","created_at","updated_at"],"additionalProperties":false,"description":"One event's delivery to one webhook, with its attempts so far.","examples":[{"id":"0192f0d5-0000-7000-8000-000000000002","webhook_id":"0192f0d4-0000-7000-8000-000000000001","event_id":"0192f0c8-0000-7000-8000-000000000003","event_type":"webhook.test","status":"pending","attempts":0,"next_attempt_at":"2026-10-01T15:02:00.000Z","response_status":null,"last_error":null,"created_at":"2026-10-01T15:02:00.000Z","updated_at":"2026-10-01T15:02:00.000Z"},{"id":"0192f0d5-0000-7000-8000-000000000001","webhook_id":"0192f0d4-0000-7000-8000-000000000001","event_id":"0192f0c8-0000-7000-8000-000000000001","event_type":"track.started","status":"succeeded","attempts":1,"next_attempt_at":null,"response_status":200,"last_error":null,"created_at":"2026-10-01T14:00:00.020Z","updated_at":"2026-10-01T14:00:00.245Z"}]}},"responses":{"ServerError":{"description":"Server error (`application/problem+json`). `503 database_unavailable` (the database doesn't answer) and `503 storage_unavailable` (an upload to S3 makes no progress for 30 s) carry `Retry-After`: retry after that many seconds. Anything else is `500 internal_error`.","headers":{"Retry-After":{"description":"On a `503`: the seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"examples":{"database_unavailable":{"summary":"The database isn't answering (Retry-After: 5)","value":{"type":"about:blank","title":"Service Unavailable","status":503,"code":"database_unavailable","detail":"The database isn't answering. Try again shortly."}},"internal_error":{"summary":"An unexpected error","value":{"type":"about:blank","title":"Internal Server Error","status":500,"code":"internal_error","detail":"An unexpected error occurred"}}}}}}}},"paths":{"/healthz":{"get":{"summary":"Liveness: the process is up","tags":["health"],"description":"Answers as long as the process runs, without checking the database (use `/readyz` for that). Also returns the API's version (the dashboard's system information shows it). Needs no authentication.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"version":{"type":"string","description":"The API's version, e.g. `1.2.0`"}},"required":["status","version"],"additionalProperties":false},"example":{"status":"ok","version":"0.1.0"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/readyz":{"get":{"summary":"Readiness: the database is reachable","tags":["health"],"description":"Runs `select 1` against the database. Returns `503 not_ready` when the database is unreachable or doesn't answer within 3 s. Needs no authentication.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"],"additionalProperties":false},"example":{"status":"ok"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/auth/login":{"post":{"summary":"Log in","tags":["auth"],"description":"Checks the email and password and sets the `re_session` cookie (httpOnly, Secure, SameSite=Lax), valid for 14 days and renewed on use. A session the browser already had is ended. An unknown email, a wrong password and a disabled user all return `401 invalid_credentials`. Rate-limited to 10 per minute per IP (`429 rate_limited`). `Idempotency-Key` doesn't apply: a replay couldn't set the cookie. Automation uses API keys instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":320,"description":"Case doesn't matter."},"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["email","password"],"additionalProperties":false},"example":{"email":"admin@example.com","password":"correct horse battery staple"}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/auth/logout":{"post":{"summary":"Log out","tags":["auth"],"description":"Ends the session and clears the `re_session` cookie. Does nothing for API keys (revoke one with `DELETE /v1/api-keys/{id}`). Rate-limited to 600 per minute per principal.\n\nRequires authentication (any scope).","security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Logged out"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/auth/password":{"post":{"summary":"Change your password","tags":["auth"],"description":"The signed-in user changes their own password: `current_password` must be the password now (else `422` at `current_password`), and `new_password` follows the rules of `POST /v1/users`. Ends the user's other sessions and keeps this one. Rate-limited as login: 10 per minute per IP (`429 rate_limited`). API keys have no password: `403 user_required`.\n\nRequires authentication (any scope).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"current_password":{"type":"string","minLength":1,"maxLength":1024,"description":"The password now."},"new_password":{"type":"string","minLength":8,"maxLength":1024,"description":"8 to 1024 characters, as for `POST /v1/users`."}},"required":["current_password","new_password"],"additionalProperties":false},"example":{"current_password":"correct horse battery staple","new_password":"tr0mbone-orbit-lantern"}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Changed"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/auth/me":{"get":{"summary":"Who am I","tags":["auth"],"description":"`{user, scopes}` for a session; `{api_key, scopes, station_ids}` for an API key, `station_ids` being null for a key that may touch every station. Returns `401 unauthenticated` without valid credentials. Rate-limited to 600 per minute per principal.\n\nRequires authentication (any scope).","security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MeUser"},{"$ref":"#/components/schemas/MeApiKey"}]},"examples":{"example1":{"value":{"user":{"id":"0192f0d0-0000-7000-8000-000000000001","email":"admin@example.com","name":"Admin","role":"admin","disabled_at":null,"created_at":"2026-09-01T08:30:00.000Z","updated_at":"2026-09-01T08:30:00.000Z"},"scopes":["read","content:write","schedule:write","feeds:write","log:write","control","admin"]}},"example2":{"value":{"api_key":{"id":"0192f0d1-0000-7000-8000-000000000001","name":"News automation","prefix":"rek_T3xg9Qm2","scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"created_by":"0192f0d0-0000-7000-8000-000000000001","last_used_at":"2026-10-01T13:55:02.000Z","revoked_at":null,"created_at":"2026-09-15T10:12:44.000Z"},"scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"]}}}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/users":{"get":{"summary":"List users","tags":["users"],"description":"Every user, disabled ones included, ordered by id. Page with `next_cursor` until it is null. Password hashes are never returned.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d0-0000-7000-8000-000000000001","email":"admin@example.com","name":"Admin","role":"admin","disabled_at":null,"created_at":"2026-09-01T08:30:00.000Z","updated_at":"2026-09-01T08:30:00.000Z"},{"id":"0192f0d0-0000-7000-8000-000000000002","email":"editor@example.com","name":"Morning Editor","role":"editor","disabled_at":null,"created_at":"2026-09-02T07:15:00.000Z","updated_at":"2026-09-02T07:15:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a user","tags":["users"],"description":"Creates a dashboard user who logs in with this email and password. The role sets the user's scopes (api.md §Scopes). Returns `409 email_taken` if another user has the email (emails are compared lowercase).\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Stored lowercase. Unique among users."},"name":{"type":"string","minLength":1,"maxLength":200},"password":{"type":"string","minLength":8,"maxLength":1024,"description":"8 to 1024 characters. Stored as a hash."},"role":{"type":"string","enum":["admin","editor","viewer"]}},"required":["email","name","password","role"],"additionalProperties":false},"example":{"email":"editor@example.com","name":"Morning Editor","password":"correct horse battery staple","role":"editor"}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/users/{id}":{"patch":{"summary":"Update a user","tags":["users"],"description":"Changes only the fields sent. Changing the password ends the user's sessions (all but the current one, when admins change their own). `disabled_at: null` re-enables a disabled user. Demoting an admin revokes the invitations they made that are still open. Demoting the last active admin returns `409 last_admin`; an email another user has returns `409 email_taken`; an unknown id `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Stored lowercase. Unique among users."},"name":{"type":"string","minLength":1,"maxLength":200},"password":{"description":"Changing it ends the user's other sessions.","type":"string","minLength":8,"maxLength":1024},"role":{"type":"string","enum":["admin","editor","viewer"]},"disabled_at":{"description":"`null` re-enables a disabled user. Disable a user with `DELETE`.","type":"null"}},"additionalProperties":false},"examples":{"example1":{"value":{"name":"Morning Editor","role":"viewer"}},"example2":{"value":{"disabled_at":null}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Disable a user","tags":["users"],"description":"Sets `disabled_at` and ends the user's sessions; the user can't log in any more, and the invitations they made that are still open are revoked. The row is kept, and `PATCH` with `disabled_at: null` re-enables it (their invitations stay revoked). Disabling a disabled user does nothing. Disabling the last active admin returns `409 last_admin`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Disabled"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/invitations":{"get":{"summary":"List invitations","tags":["users"],"description":"The invitations not accepted (and not revoked), newest first, each with `expired`. Page with `next_cursor` until it is null. Links are never listed: resend one for a new link.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d9-0000-7000-8000-000000000001","email":"editor@example.com","name":"Morning Editor","role":"editor","invited_by":{"id":"0192f0d0-0000-7000-8000-000000000001","name":"Admin"},"created_at":"2026-10-01T14:00:00.000Z","expires_at":"2026-10-08T14:00:00.000Z","accepted_at":null,"expired":false},{"id":"0192f0d9-0000-7000-8000-000000000002","email":"night@example.com","name":null,"role":"viewer","invited_by":{"id":"0192f0d0-0000-7000-8000-000000000001","name":"Admin"},"created_at":"2026-09-20T09:00:00.000Z","expires_at":"2026-09-27T09:00:00.000Z","accepted_at":null,"expired":true}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Invite a person by email","tags":["users"],"description":"Makes an invitation with a link that works for 7 days: whoever opens it chooses a name and password and becomes a user with this role, signed in. `accept_url` is the link, shown only here and in a resend's response. `delivery` is `email` when the platform can send email (the worker's `BIRD_API_KEY` or `SMTP_URL`, else the oldest enabled `email` notification channel): the worker then emails the link, saying who invited and until when it works. Otherwise it is `link`: pass the link on yourself. `409 email_taken` when a user has the email or an open invitation does (resend that one); an expired invitation to the email is revoked and replaced.\n\nThe link works only while whoever invited can still invite: disabling or demoting that user, or revoking that API key, revokes their open invitations.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Stored lowercase. Must belong to no user and no open invitation (`409 email_taken`)."},"name":{"description":"Suggested for the new user; they may change it.","type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["admin","editor","viewer"]}},"required":["email","role"],"additionalProperties":false},"example":{"email":"editor@example.com","name":"Morning Editor","role":"editor"}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSent"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/invitations/{id}/resend":{"post":{"summary":"Resend an invitation","tags":["users"],"description":"Makes a new link (the old one stops working) that works for 7 days from now, and sends it as `POST /v1/invitations` does: `accept_url` and `delivery` as there. Whoever resends becomes the inviter (`invited_by`): the new link works only while they can invite. `409 invitation_accepted` once the invitation was accepted; `409 email_taken` when a user got the email meanwhile; `404 not_found` for an unknown or revoked invitation.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSent"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["users"],"description":"Its link stops working, and it leaves the list. Revoking a revoked invitation does nothing. `409 invitation_accepted` once accepted (disable the user instead, with `DELETE /v1/users/{id}`); `404 not_found` for an unknown id.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Revoked"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/auth/invitations/{token}":{"get":{"summary":"Read an invitation link","tags":["auth"],"description":"The invitation behind a link, for the page that accepts it: the email, the suggested name, the role, who invited and until when the link works. `404 not_found` when the token is unknown, or the invitation was accepted, revoked, resent (a new link) or has expired, or when whoever invited can no longer invite (a disabled or demoted user, a revoked key). No authentication. Rate-limited as login: 10 per minute per IP (`429 rate_limited`).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"path","name":"token","required":true,"description":"The token at the end of the invitation's link."}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationLink"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/auth/invitations/{token}/accept":{"post":{"summary":"Accept an invitation","tags":["auth"],"description":"Creates the user with the invitation's email and role, marks the invitation accepted, and signs the user in as `POST /v1/auth/login` does: sets the `re_session` cookie (a session the browser had is ended) → `{user}`. `name` defaults to the invitation's, else the email's local part; `password` follows the rules of `POST /v1/users` (`422` at `password`). `404 not_found` for a link that isn't valid (as `GET /v1/auth/invitations/{token}`); `409 email_taken` when a user got the email meanwhile. No authentication. Rate-limited as login: 10 per minute per IP (`429 rate_limited`). `Idempotency-Key` doesn't apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The new user's name. Default: the invitation's, else the email's local part.","type":"string","minLength":1,"maxLength":200},"password":{"type":"string","minLength":8,"maxLength":1024,"description":"8 to 1024 characters. Stored as a hash."}},"required":["password"],"additionalProperties":false},"example":{"name":"Morning Editor","password":"correct horse battery staple"}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"in":"path","name":"token","required":true,"description":"The token at the end of the invitation's link."}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/api-keys":{"get":{"summary":"List API keys","tags":["api-keys"],"description":"Every key, revoked ones included, ordered by id. Page with `next_cursor` until it is null. Secrets are never returned: `prefix` identifies a key.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d1-0000-7000-8000-000000000001","name":"News automation","prefix":"rek_T3xg9Qm2","scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"created_by":"0192f0d0-0000-7000-8000-000000000001","last_used_at":"2026-10-01T13:55:02.000Z","revoked_at":null,"created_at":"2026-09-15T10:12:44.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create an API key","tags":["api-keys"],"description":"Returns the key's secret (`rek_…`). It is shown only once; only its hash is stored. A key's scopes are literal, and `station_ids` restricts it to those stations: other stations return `403 station_forbidden`, and a restricted key can't use the routes marked as not available to station-restricted keys (users, API keys, nodes, …). Unknown station ids return `422 validation_failed`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["read","content:write","schedule:write","feeds:write","log:write","control","admin"]},"description":"Literal: unlike the admin role, `admin` doesn't include `read`, so list every scope the key needs."},"station_ids":{"description":"Restrict the key to these stations. Omit or null for all stations.","anyOf":[{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]}},"required":["name","scopes"],"additionalProperties":false},"example":{"name":"News automation","scopes":["read","feeds:write"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"]}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/api-keys/{id}":{"delete":{"summary":"Revoke an API key","tags":["api-keys"],"description":"Sets `revoked_at`. The key stops working at once; an event stream opened with it is closed with 4401 at its next ping, and the invitations it made that are still open are revoked. The key stays in the list. Revoking a revoked key does nothing; an unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Revoked"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/events":{"get":{"summary":"Event history","tags":["events"],"description":"Events of the last 30 days, oldest first: a polling alternative to the WebSocket stream, and the way to catch up after a disconnect (`cursor` = the last event id received). Page with `next_cursor` until it is null. An unknown type in `types` returns `422 validation_failed`. Station-restricted API keys see their stations' events and events without a station; asking for another station returns `403 station_forbidden`. `config.changed` events about users, invitations, API keys, storage connections, nodes, webhooks and notification channels are listed only for principals with `admin`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false,"description":"An event id: returns the events after it. Pass `next_cursor`, or the id of the last event received over the WebSocket (or the `last_event_id` of its `subscribed` message) to catch up after a disconnect."},{"schema":{"type":"string"},"in":"query","name":"types","required":false,"description":"Comma-separated event types, e.g. `track.started,track.ended`"},{"schema":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}]},"in":"query","name":"station_id","required":false,"description":"Only events of these stations (repeat the parameter for several, up to 100). Events without a station are then left out."},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPage"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/activity":{"get":{"summary":"Activity","tags":["events"],"description":"Who changed what: the events of the last 30 days that a user or an API key caused (those with an `actor`), newest first. Configuration changes are `config.changed` (api.md §Events); programming changes `programming.changed`; the rest are what the person's requests set off (`log.updated`, `feed_item.created`, `alert.acknowledged`, …). Page with `next_cursor` until it is null.\n\nFilters, combined: `station_id` (repeatable) keeps those stations' events and leaves out the events without a station; `actor_id` a user's or key's; `object` (repeatable) the `config.changed` events about those kinds of object; `types` (comma-separated) event types. An unknown type or object is `422 validation_failed`.\n\nStation-restricted API keys see their stations' events and events without a station; asking for another station returns `403 station_forbidden`. `config.changed` events about users, invitations, API keys, storage connections, nodes, webhooks and notification channels are listed only for principals with `admin`.\n\nRequires the `read` scope.","parameters":[{"schema":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}]},"in":"query","name":"station_id","required":false,"description":"Only events of these stations (repeat the parameter for several, up to 100). Events without a station are then left out."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"actor_id","required":false,"description":"Only what this user or API key did (its id)."},{"schema":{"anyOf":[{"type":"string","enum":["station","output","source","storage_connection","node","user","invitation","api_key","webhook","notification_channel","feed","media","tag"]},{"minItems":1,"maxItems":13,"type":"array","items":{"type":"string","enum":["station","output","source","storage_connection","node","user","invitation","api_key","webhook","notification_channel","feed","media","tag"]}}]},"in":"query","name":"object","required":false,"description":"Only `config.changed` events about these kinds of object (repeat the parameter for several)."},{"schema":{"type":"string"},"in":"query","name":"types","required":false,"description":"Comma-separated event types, e.g. `config.changed,programming.changed`"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page: the older events follow."},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityPage"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations":{"get":{"summary":"List stations","tags":["stations"],"description":"Lists the stations in id order, each with its settings, `source_ids`, last reported `runtime` and listener `public_urls`. Station-restricted API keys see only their stations.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Station"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0c4-0000-7000-8000-000000000001","slug":"rock","name":"Rock FM","description":"Classic and modern rock, news on the hour.","timezone":"Europe/Berlin","status":"active","node_id":"0192f0cf-0000-7000-8000-000000000001","default_clock_id":"0192f0cb-0000-7000-8000-000000000001","fallback_category_id":"0192f0ca-0000-7000-8000-000000000001","filler_category_id":"0192f0ca-0000-7000-8000-000000000002","target_lufs":-16,"default_transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"hard_fade_ms":2000,"max_overrun_ms":8000,"max_underrun_ms":2000,"plan_horizon_minutes":180,"lock_window_seconds":120,"require_synced":true,"silence_threshold_dbfs":-50,"silence_max_ms":10000,"video_slate_media_id":null,"log_generation":412,"runtime":{"state":"playing","current":{"log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","started_at":"2026-10-01T13:58:12.400Z","position_ms":95300},"buffer_ahead_ms":1500,"drift_ms":3,"outputs":[{"output_id":"0192f0ce-0000-7000-8000-000000000001","state":"connected","restarts":0},{"output_id":"0192f0ce-0000-7000-8000-000000000002","state":"connected","restarts":0}],"connected":true},"runtime_updated_at":"2026-10-01T13:59:45.012Z","source_ids":["0192f0c9-0000-7000-8000-000000000001"],"public_urls":[{"kind":"icecast","url":"https://stream1.example.com/rock-mp3","output_ids":["0192f0ce-0000-7000-8000-000000000001"],"video":false},{"kind":"hls","url":"https://stream1.example.com/hls/rock/master.m3u8","output_ids":["0192f0ce-0000-7000-8000-000000000002"],"video":false}],"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-28T16:20:31.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a station","tags":["stations"],"description":"Creates a station; settings left out get their defaults. It is `disabled` unless `status` says otherwise, and `active` and `paused` need a `node_id`. Its fallback and filler categories can only be shared ones, since it has none of its own yet; set `default_clock_id` with `PATCH` once it has clocks. Then give it sources (`PUT /v1/stations/{id}/sources`) and outputs (`POST /v1/stations/{id}/outputs`).\n\nWith `defaults: true` it gets, in the same transaction, what it needs to play: its own filter category `Music` (`{kinds: [\"music\"]}`, rotation `least_recent`), a clock `Standard hour` (60 min) with one slot that plays it, and `default_clock_id` and `fallback_category_id` set to them (a `fallback_category_id` in the body is kept); every source with purpose `library` as its sources; an `artist_separation` rotation rule of 60 minutes; and two enabled outputs, `mp3` (Icecast, MP3, 128 kbit/s, 44100 Hz, 2 channels, public, `stream_name` the station's name, mount `/<slug>`, or `/<slug>-mp3` when another output on its node already has `/<slug>`) and `hls` (HLS, AAC, 64 kbit/s, 44100 Hz, 2 channels, 6 s segments, a list of 10, `mpegts`). `GET /v1/stations/{id}/readiness` then lists what is still missing, typically the node.\n\nPushes the node's config, and queues a plan for an `active` station.\n\nErrors: `409 slug_taken`; `422 validation_failed` for a slug that looks like a uuid, an unknown node or category, a category of another station, a `lock_window_seconds` not shorter than `plan_horizon_minutes`, an `active` or `paused` station without a node, or a `video_slate_media_id` that isn't a `ready` video item of at most 60 s.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string","minLength":1,"maxLength":200},"timezone":{"type":"string","description":"IANA time zone name, e.g. `Europe/Berlin`"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","disabled"],"description":"`active` and `paused` need a `node_id`. Setting it pushes the node's config."},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Setting it pushes the config of the old and the new node."},"fallback_category_id":{"description":"A shared category: the station has none of its own yet.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"filler_category_id":{"description":"A shared category: the station has none of its own yet.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"target_lufs":{"type":"number","minimum":-70,"maximum":0},"default_transition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},"hard_fade_ms":{"type":"integer","minimum":0,"maximum":30000},"max_overrun_ms":{"type":"integer","minimum":0,"maximum":300000},"max_underrun_ms":{"type":"integer","minimum":0,"maximum":300000},"plan_horizon_minutes":{"type":"integer","minimum":60,"maximum":1440},"lock_window_seconds":{"type":"integer","minimum":0,"maximum":3600,"description":"Shorter than the plan horizon."},"require_synced":{"type":"boolean"},"silence_threshold_dbfs":{"type":"number","minimum":-120,"maximum":0},"silence_max_ms":{"type":"integer","minimum":1000,"maximum":600000},"video_slate_media_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The slate of the station's video outputs: a `ready` video item at most 60 s long (422 otherwise), looped while an audio item plays or nothing is on air. Null shows black. Setting it pushes the node's config."},"defaults":{"description":"Also create, in the same transaction, what the station needs to play: its own filter category `Music` (`{kinds: [\"music\"]}`, rotation `least_recent`), a clock `Standard hour` (60 min) with one slot that plays it, and `default_clock_id` and `fallback_category_id` set to them (a `fallback_category_id` in the body is kept); every `library` source attached; an `artist_separation` rotation rule of 60 minutes; and the outputs `mp3` (Icecast, MP3 128 kbit/s, mount `/<slug>`, or `/<slug>-mp3` when its node already has `/<slug>`) and `hls` (AAC 64 kbit/s). Default false.","type":"boolean"}},"required":["slug","name","timezone"],"additionalProperties":false},"examples":{"example1":{"value":{"slug":"rock","name":"Rock FM","timezone":"Europe/Berlin","description":"Classic and modern rock, news on the hour.","status":"active","node_id":"0192f0cf-0000-7000-8000-000000000001","fallback_category_id":"0192f0ca-0000-7000-8000-000000000001","filler_category_id":"0192f0ca-0000-7000-8000-000000000002"}},"example2":{"value":{"slug":"jazz","name":"Jazz FM","timezone":"Europe/Berlin","defaults":true}}}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}":{"get":{"summary":"Get a station","tags":["stations"],"description":"`:id` is the station's uuid or slug. Returns its settings, `source_ids`, listener `public_urls` and what its process last reported (`runtime`, as fresh as `runtime_updated_at`). An unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a station","tags":["stations"],"description":"Changes the fields sent; the others keep their values. `POST /v1/stations/{id}/start` and `/stop` also set `status`, with the `control` scope. To take a station off its node, set `status` to `disabled` and `node_id` to null.\n\nChanging a field of the engine's station config (`slug`, `name`, `timezone`, `status`, `node_id`, `target_lufs`, `default_transition`, `hard_fade_ms`, the silence settings, `fallback_category_id`, `video_slate_media_id`) pushes the config of the old and the new node. Changing a planning setting (`timezone`, `status`, `node_id`, the default clock, the fallback and filler categories, `default_transition`, `hard_fade_ms`, the overrun and underrun tolerances, `plan_horizon_minutes`, `lock_window_seconds`, `require_synced`) re-plans an `active` station.\n\nErrors: `404 not_found`; `409 slug_taken`; `422 validation_failed` for an unknown node, clock or category, a clock or category of another station, a `lock_window_seconds` not shorter than `plan_horizon_minutes`, an `active` or `paused` station without a node, (on `node_id`) a node where another station already uses one of this station's Icecast mounts, or (on `video_slate_media_id`) a slate that isn't a `ready` video item of at most 60 s.\n\nRequires the `admin` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"timezone":{"type":"string","description":"IANA time zone name, e.g. `Europe/Berlin`"},"status":{"type":"string","enum":["active","paused","disabled"],"description":"`active` and `paused` need a `node_id`. Setting it pushes the node's config."},"node_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Setting it pushes the config of the old and the new node."},"default_clock_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"A clock of this station."},"fallback_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"A category of this station, or a shared one."},"filler_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"A category of this station, or a shared one."},"target_lufs":{"type":"number","minimum":-70,"maximum":0},"default_transition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},"hard_fade_ms":{"type":"integer","minimum":0,"maximum":30000},"max_overrun_ms":{"type":"integer","minimum":0,"maximum":300000},"max_underrun_ms":{"type":"integer","minimum":0,"maximum":300000},"plan_horizon_minutes":{"type":"integer","minimum":60,"maximum":1440},"lock_window_seconds":{"type":"integer","minimum":0,"maximum":3600,"description":"Shorter than the plan horizon."},"require_synced":{"type":"boolean"},"silence_threshold_dbfs":{"type":"number","minimum":-120,"maximum":0},"silence_max_ms":{"type":"integer","minimum":1000,"maximum":600000},"video_slate_media_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The slate of the station's video outputs: a `ready` video item at most 60 s long (422 otherwise), looped while an audio item plays or nothing is on air. Null shows black. Setting it pushes the node's config."}},"additionalProperties":false},"examples":{"example1":{"value":{"default_clock_id":"0192f0cb-0000-7000-8000-000000000001","default_transition":{"type":"crossfade","duration_ms":3000,"curve":"equal_power"},"lock_window_seconds":120}},"example2":{"value":{"video_slate_media_id":"0192f0c1-0000-7000-8000-00000000000d"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a station","tags":["stations"],"description":"Deletes the station with everything that is its own: outputs, categories (shared ones stay), clocks, rotation and schedule rules, log, play history and listener samples. Pushes its node's config, so the node stops the station. An unknown station is `404 not_found`.\n\nRequires the `admin` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/programming":{"patch":{"summary":"Set a station's programming defaults","tags":["stations"],"description":"Sets the default clock (where no schedule rule applies), the fallback category (where no clock applies) and the filler category (underruns before hard anchors), with the `schedule:write` scope, so editors who may not change the station's other settings can program it. The fields sent change; null clears one. Validation and effects are those of `PATCH /v1/stations/{id}`: an `active` station is re-planned, and a changed fallback category pushes the node's config. Returns the station.\n\nErrors: `404 not_found`; `422 validation_failed` for an unknown clock or category, or a clock or category of another station.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"default_clock_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"A clock of this station."},"fallback_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"A category of this station, or a shared one."},"filler_category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"A category of this station, or a shared one."}},"additionalProperties":false},"examples":{"example1":{"value":{"default_clock_id":"0192f0cb-0000-7000-8000-000000000001","fallback_category_id":"0192f0ca-0000-7000-8000-000000000001","filler_category_id":"0192f0ca-0000-7000-8000-000000000002"}},"example2":{"value":{"filler_category_id":null}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/readiness":{"get":{"summary":"Check whether a station can play","tags":["stations"],"description":"The station's setup checks, in order, each `ok`, `warning` or `blocking`, with a message and the `subject` to look at (the station's settings, its node, an output, a clock or a category):\n\n- `node`: a node is assigned (blocking);\n- `node_online`: its agent is connected;\n- `outputs`: at least one enabled output (blocking);\n- `sources`: at least one source;\n- `media`: ready items in its sources;\n- `programme`: a default clock, or at least one schedule rule;\n- `slots`: every category slot of the clocks it uses (the default clock's and those of rules that still apply) has members, and every feed slot's feed has a current item;\n- `padding`: every window of those clocks can be padded: its slot has a padding category, or the station has a filler or fallback category. A warning names the first window without, with its clock as `subject`;\n- `fallback`: a fallback category with members. Blocking when no category slot has members either: then nothing can play.\n\n`slots` and `fallback` carry `details` when they aren't `ok`: every category the message is about (`subject` names the first), each with `members` as the station sees them and `held`, how many of them its node holds (null unless the station requires synced media), and `node_id`, that node.\n\n`ready` is true when nothing is blocking; `POST /v1/stations/{id}/start` refuses a station that isn't (`409 station_not_ready`, unless `force=true`). A check whose input an earlier check already reports missing is `ok` and says so: `node_online` without a node, and `media` without sources. Members are counted as `GET /v1/categories/{id}/items` counts them, a filter category's within the station's sources: without sources a filter category has no members (`slots` says `has no members: the station has no sources`), so a station whose programme is only filter categories is blocking, with the `fallback` message `No sources: nothing can play` and the station as `subject`. When the station requires synced media (`require_synced`), `slots` and `fallback` also count the members its node holds in their current version: a category whose members aren't all on the node yet is a `warning` naming it, for example `DubaiPopALL: 199 members, none on stream1 yet` or `DubaiPopALL: 12 of 199 on stream1`, with the category as `subject`. It is never `blocking`, since the node fetches them by itself. Nothing is planned.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationReadiness"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/preview":{"get":{"summary":"Preview what airs at a time","tags":["schedule"],"description":"What the station plays at `at` (default now), following its schedule: `resolved` is the entry of `GET /v1/stations/{id}/schedule` that covers `at` (the clock, and whether a schedule rule, the default clock or the fallback category applies), and `preview` the dry run of that clock instance, as `GET /v1/clocks/{id}/preview?at=` returns it: the items the planner would pick, with the real rotation, history and rules. `preview` is null where the fallback category plays. Nothing is planned or saved: `GET /v1/stations/{id}/log` has what is planned.\n\nAn unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"at","required":false,"description":"The time to look at. Default: now."},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationPreview"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/sources":{"put":{"summary":"Set a station's sources","tags":["stations"],"description":"Replaces the list of sources whose media the station's filter categories pick from (static categories and media slots may use media from any source). Returns the station. Re-plans an `active` station when the list changes; when it gains a source, its node's agent also walks its whole manifest at once (`sync.full`), so the new media reach the node without waiting for its next walk.\n\nErrors: `404 not_found` for the station; `422 validation_failed` (on `source_ids.<i>`) for an unknown or repeated source.\n\nRequires the `admin` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_ids":{"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Every source of the station: sources left out are removed from it."}},"required":["source_ids"],"additionalProperties":false},"example":{"source_ids":["0192f0c9-0000-7000-8000-000000000001"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/feeds":{"get":{"summary":"List the feeds a station uses","tags":["stations"],"description":"The feeds the station uses (a slot of its clocks names the feed, or an upcoming log item plays it), ordered by feed name. For each: the feed; `status`, the station's entry of `GET /v1/feeds/{id}/status` (the current item, its age and expiry, the next planned feed slot and when the next item is due) plus `synced`, whether the station's node holds the current item; `slots`, the slots of its clocks that play the feed, with the clock's name and the slot's placement (anchor, window, cap `max_length_ms`, the window's bed `pad_category_id`); and `log_items`, how many of its upcoming log items (`planned`, `loaded`, `playing`) play the feed without coming from a clock slot.\n\n`:id` is the station's uuid or slug; an unknown station is `404 not_found`. Station-restricted API keys get `403 station_forbidden` for other stations.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationFeeds"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/imaging":{"get":{"summary":"List a station's imaging","tags":["stations"],"description":"The station's imaging categories, ordered by name: its own and the shared ones that pick only imaging, a filter whose `kinds` are all of `jingle`, `station_id`, `sweeper` and `bed`, or a static list with at least one member, all of those kinds. For each: `members`, its ready members as the station sees them (a filter category matches only the station's sources); `plays_30d`, the station's plays of them in the last 30 days, counted as `GET /v1/reports/top` counts; and `slots`, the slots of the station's clocks that pick from it, with the clock's name and the slot's placement (`every_n`, `segment_end`, its anchor, `transition_out`, `max_length_ms`).\n\n`:id` is the station's uuid or slug; an unknown station is `404 not_found`. Station-restricted API keys get `403 station_forbidden` for other stations.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationImaging"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/diagnosis":{"get":{"summary":"Diagnose a station","tags":["stations"],"description":"Whether the station is on air and, if not, why, for a status line and its fix buttons. From the station's status and last report (`runtime`, `runtime_updated_at`), its node's status, heartbeat and reported process states, its log's next item, its open `station.playback_failed` and `output.failed` alerts and its blocking readiness checks:\n\n- `state`: the live state, `disabled` or `paused` from the status, else what the station reports (`playing`, `fallback`, `starting`, `stopping`), or `offline` while it isn't connected or hasn't reported for 45 s;\n- `summary`: one sentence, from the state and the most severe cause, with times in the station's zone;\n- `causes`, most severe first: `not_deployed` (paused or disabled), `no_node`, `node_offline` (no heartbeat for 60 s), `process_not_running` (the node's last heartbeat lists the station's process `stopped` or `failed`, or doesn't list the active station), `not_reporting` (no `station.status` for 30 s while the node is online and runs the process), `fallback_empty_log` (on fallback with nothing upcoming in the log), `fallback_playback_failing` (on fallback with an open `station.playback_failed` alert), `outputs_failing` (an enabled output not `connected`), `not_ready` (a `blocking` readiness check). Each has `actions`: `start`, `restart` (on `not_reporting` and `process_not_running` while the node's agent is connected at protocol 3 or more), `replan`, `sync_node` (requests), `open_node`, `open_readiness`, `open_outputs`, `open_log` (pages); offer only those the client's scopes allow. `causes` is empty while the station plays its log with every output connected.\n\nNothing is changed. An unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationDiagnosis"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/restart":{"post":{"summary":"Restart a station's process","tags":["control"],"description":"Ends the station's process on its node and starts it again: the API sends `station.restart` to the node's agent (engine-protocol.md §Agent channel), which stops the process (SIGTERM, then SIGKILL after its grace) and starts it with its current configuration, resetting its crash backoff. For a process that hangs or stopped; `POST /v1/stations/{id}/start` only sends the configuration again. Returns 202 at once: the station's state follows in its events (`station.state_changed`) and `GET /v1/stations/{id}/diagnosis`.\n\nErrors, in this order: `409 station_not_active` unless the station is `active`; `409 node_offline` when its node's agent isn't connected (no heartbeat for 60 s); `409 agent_outdated` when the agent speaks protocol 2 or less (an older engine, which can't restart one station: upgrade the stream server). An unknown station is `404 not_found`.\n\nRequires the `control` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationRestartAccepted"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/outputs":{"get":{"summary":"List a station's outputs","tags":["outputs"],"description":"Lists the station's Icecast and HLS outputs in id order, disabled ones included. An unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Output"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0ce-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"mp3","kind":"icecast","codec":"mp3","bitrate_kbps":128,"sample_rate":44100,"channels":2,"enabled":true,"config":{"mount":"/rock-mp3","public":true,"stream_name":"Rock FM","description":"Classic and modern rock, news on the hour.","genre":"Rock"},"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"},{"id":"0192f0ce-0000-7000-8000-000000000002","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"hls","kind":"hls","codec":"aac","bitrate_kbps":64,"sample_rate":44100,"channels":2,"enabled":true,"config":{"segment_seconds":6,"list_size":10,"segment_type":"mpegts"},"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Add an output","tags":["outputs"],"description":"Adds an Icecast mount or an HLS rendition to the station. `config` has the shape of `kind` (`IcecastOutputConfig` or `HlsOutputConfig`). HLS outputs use `aac`, and `opus` needs `sample_rate` 48000. An Icecast mount must be unique on the station and on its node, disabled outputs included. An HLS output with `config.video: true` is a video output: it carries the station's picture too, and reaches only nodes at protocol 4 or more. Pushes the node's config.\n\nErrors: `404 not_found` for the station; `409 name_taken` when the station already has an output with this name; `422 validation_failed` on `codec`, `sample_rate` or `config.*`, including a mount already in use (`config.mount`).\n\nRequires the `admin` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},"kind":{"type":"string","enum":["icecast","hls"]},"codec":{"type":"string","enum":["mp3","aac","opus"],"description":"HLS outputs must use `aac`."},"bitrate_kbps":{"type":"integer","minimum":16,"maximum":320},"sample_rate":{"description":"Default 48000 for `opus` (which requires it), else 44100.","type":"number","enum":[22050,44100,48000]},"channels":{"description":"Default 2.","type":"number","enum":[1,2]},"enabled":{"description":"Default true.","type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"`IcecastOutputConfig` when `kind` is `icecast`, `HlsOutputConfig` when it is `hls`"}},"required":["name","kind","codec","bitrate_kbps","config"],"additionalProperties":false},"examples":{"example1":{"value":{"name":"mp3","kind":"icecast","codec":"mp3","bitrate_kbps":128,"sample_rate":44100,"config":{"mount":"/rock-mp3","public":true,"stream_name":"Rock FM","description":"Classic and modern rock, news on the hour.","genre":"Rock"}}},"example2":{"value":{"name":"video","kind":"hls","codec":"aac","bitrate_kbps":128,"sample_rate":48000,"config":{"segment_seconds":4,"list_size":10,"segment_type":"mpegts","video":true}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Output"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/outputs/{id}":{"patch":{"summary":"Update an output","tags":["outputs"],"description":"Changes the fields sent; the others keep their values. `config` replaces the whole config and is required when `kind` changes. The merged values follow the same rules as a new output. Pushes the node's config.\n\nErrors: `404 not_found`; `409 name_taken`; `422 validation_failed` on `codec`, `sample_rate` or `config.*`, including a mount already in use (`config.mount`).\n\nRequires the `admin` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},"kind":{"type":"string","enum":["icecast","hls"]},"codec":{"type":"string","enum":["mp3","aac","opus"]},"bitrate_kbps":{"type":"integer","minimum":16,"maximum":320},"sample_rate":{"type":"number","enum":[22050,44100,48000]},"channels":{"type":"number","enum":[1,2]},"enabled":{"type":"boolean"},"config":{"description":"Replaces the whole config. Required when `kind` changes.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"example":{"config":{"mount":"/rock-mp3","public":true,"stream_name":"Rock FM","description":"Classic and modern rock, news on the hour.","genre":"Rock"}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Output"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete an output","tags":["outputs"],"description":"Deletes the output and its listener samples. Pushes the node's config. An unknown output is `404 not_found`.\n\nRequires the `admin` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/categories":{"get":{"summary":"List a station's categories","tags":["categories"],"description":"The station's categories and the shared ones (`station_id` null), ordered by id. `:id` is the station's uuid or slug.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0ca-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"Rock","mode":"filter","filter":{"kinds":["music"],"tags_all":["rock"],"min_duration_ms":120000},"rotation":"least_recent","color":"#dc2626","created_at":"2026-09-01T09:30:00.000Z","updated_at":"2026-09-01T09:30:00.000Z"},{"id":"0192f0ca-0000-7000-8000-000000000002","station_id":null,"name":"Idents","mode":"static","filter":null,"rotation":"least_recent","color":"#ca8a04","created_at":"2026-09-01T09:20:00.000Z","updated_at":"2026-09-12T15:41:07.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a category","tags":["categories"],"description":"A category of this station, or with `shared: true` a category every station can use. Names are unique per station (and among shared categories), ignoring case: `409 name_taken`. A `filter` category needs a `filter` whose `source_ids` and `folders` name existing sources (and folder paths, as `GET /v1/sources/{id}/folders` lists them); a `static` one has none (422 otherwise). Filter tags are stored lowercase and trimmed; artists, albums and genres trimmed, in their case.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"mode":{"type":"string","enum":["static","filter"]},"filter":{"description":"Required for `filter` categories; absent or null for `static` ones.","anyOf":[{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}},"tags_all":{"type":"array","items":{"type":"string","minLength":1}},"tags_any":{"type":"array","items":{"type":"string","minLength":1}},"tags_none":{"type":"array","items":{"type":"string","minLength":1}},"source_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"folders":{"type":"array","items":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"type":"string","maxLength":1024}},"required":["source_id","path"],"additionalProperties":false}},"artists":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"albums":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"genres":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"year_min":{"type":"integer","minimum":0,"maximum":9999},"year_max":{"type":"integer","minimum":0,"maximum":9999},"min_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"video":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"rotation":{"description":"Default: `least_recent`.","type":"string","enum":["least_recent","weighted_random","shuffle","sequential"]},"color":{"anyOf":[{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"},{"type":"null"}]},"shared":{"description":"Create a shared category (`station_id` null) instead of one of this station. Not available to station-restricted API keys.","type":"boolean"}},"required":["name","mode"],"additionalProperties":false},"example":{"name":"Rock","mode":"filter","filter":{"kinds":["music"],"tags_all":["rock"],"min_duration_ms":120000},"rotation":"least_recent","color":"#dc2626"}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/categories/{id}":{"get":{"summary":"Get a category","tags":["categories"],"description":"A category of a station, or a shared one. Its members are at `GET /v1/categories/{id}/items`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a category","tags":["categories"],"description":"Changing `mode` to `filter` needs a `filter` and removes the static items; changing it to `static` clears the filter. Changes to the mode, filter or rotation re-plan the station if it is active, or every active station that uses a shared category. `409 name_taken` for a duplicate name. Station-restricted API keys can't change shared categories (403).\n\nSharing: `shared: true` makes a station's category shared (`station_id` null), so every station can use it; it keeps its id, so the station's slots, pad buttons, rotation rules, fallback and filler keep using it. `409 name_taken` when a shared category has its name. `shared: false` with `station_id` makes a shared category that station's; `409 category_in_use` while another station uses it (through its clocks, pad, rotation rules, fallback or filler), with those stations in `details.stations`, and `409 name_taken` when the station has a category of that name. Both re-plan the station concerned if it is active, publish `programming.changed` without a station (every station's categories changed), and both are only for principals without a station restriction (403 otherwise). Asking for what already is (sharing a shared category, or giving a station its own) changes nothing. 422 at `station_id` for `shared: false` without it, for `station_id` without `shared: false`, for an unknown station, and for a category of another station.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"mode":{"description":"Changing `static` to `filter` needs a `filter` and removes the static items.","type":"string","enum":["static","filter"]},"filter":{"anyOf":[{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}},"tags_all":{"type":"array","items":{"type":"string","minLength":1}},"tags_any":{"type":"array","items":{"type":"string","minLength":1}},"tags_none":{"type":"array","items":{"type":"string","minLength":1}},"source_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"folders":{"type":"array","items":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"type":"string","maxLength":1024}},"required":["source_id","path"],"additionalProperties":false}},"artists":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"albums":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"genres":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"year_min":{"type":"integer","minimum":0,"maximum":9999},"year_max":{"type":"integer","minimum":0,"maximum":9999},"min_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"video":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}]},"rotation":{"type":"string","enum":["least_recent","weighted_random","shuffle","sequential"]},"color":{"anyOf":[{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"},{"type":"null"}]},"shared":{"description":"`true`: a station's category becomes shared, keeping its id (its slots, pad buttons, rotation rules and station defaults stay). `false`, with `station_id`: a shared category becomes that station's. Not available to station-restricted API keys.","type":"boolean"},"station_id":{"description":"With `shared: false`, and only then: the station the shared category becomes the category of.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false},"examples":{"example1":{"value":{"filter":{"kinds":["music"],"tags_all":["rock"],"tags_none":["chill"],"min_duration_ms":120000}}},"example2":{"value":{"shared":true}},"example3":{"value":{"shared":false,"station_id":"0192f0c4-0000-7000-8000-000000000001"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"409":{"description":"`name_taken`, or `category_in_use` with the stations in `details.stations` (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/CategoryInUseProblem"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a category","tags":["categories"],"description":"Returns `409 category_in_use` while a clock slot uses it, to pick from or to pad its window with (`pad_category_id`). Stations that use it as their fallback or filler category lose that setting; active ones are re-planned. Its rotation rules and pad buttons are deleted, and each pad that loses a button publishes `pad.updated`. Station-restricted API keys can't delete shared categories (403).\n\nRequires the `content:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/categories/{id}/items":{"get":{"summary":"List a category's members","tags":["categories"],"description":"Static categories: the listed media items in position order. Filter categories: the media items (not deleted) that match the filter, by id; for a station's category, only those in the station's sources. `count` is the total.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryMembersPage"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"put":{"summary":"Set a static category's items","tags":["categories"],"description":"Replaces every item in one transaction; the list order sets `position`. Static categories only (`409 category_not_static`). Each media item must exist, not be deleted, and be listed once (422 otherwise); at most 10000 items (`422 list_too_large`). Station-restricted API keys can only add items of their stations' sources (403 otherwise); items already in the list may stay. Re-plans the active stations that use the category, and sends the items new to the list to the nodes of those stations at once (`sync.hint`), so they can play them soon. To add or remove some items, use `POST /v1/categories/{id}/items/bulk`.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"weight":{"description":"For `weighted_random`. Default 1.","type":"number","exclusiveMinimum":0,"maximum":1000}},"required":["media_item_id"],"additionalProperties":false},"description":"The category's items, in order: at most 10000 (`422 list_too_large`). An empty list removes them all."}},"required":["items"],"additionalProperties":false},"example":{"items":[{"media_item_id":"0192f0c1-0000-7000-8000-000000000003"},{"media_item_id":"0192f0c1-0000-7000-8000-000000000005","weight":2}]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryItems"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/categories":{"get":{"summary":"List the shared categories","tags":["categories"],"description":"The shared categories (`station_id` null), which every station can use, ordered by name and not paginated. Each has `usage`: how many stations use it (through their clocks, pad, rotation rules, fallback or filler) and how many clocks have slots that pick from it or pad their window with it; station-restricted API keys count only their stations. `shared=true` is required: without it, or with `shared=false`, `422 validation_failed`. A station's own categories are at `GET /v1/stations/{id}/categories`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","enum":["true"]},"in":"query","name":"shared","required":true,"description":"Required: `true` lists the shared categories."}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedCategoryList"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/categories/{id}/items/bulk":{"post":{"summary":"Add and remove many of a static category's items","tags":["categories"],"description":"Static categories only (`409 category_not_static`). `remove` takes items out of the list (the rest keep their order, with positions 0, 1, 2, … as `PUT` writes them), then `add` appends the items that aren't in it yet, after the last one, with weight 1: `ids` in the order given, or a `filter` (the filters of `GET /v1/media`) in its `sort` order, `title` by default. So every item of a folder is `{add: {filter: {source_id, folder}}}`. Deleted items are skipped; an unknown id is 422 at `add.ids.<i>`. The list holds at most 10000 items (`422 list_too_large`, and nothing changes). Give `add`, `remove` or both, each with exactly one of `ids` and `filter`. Station-restricted API keys can't change shared categories, and can only add items of their stations' sources (a filter selects only those; other ids are 403). A change re-plans the stations that use the category, and the items added go to the nodes of those stations at once (`sync.hint`, 100 ids per message).\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"add":{"description":"Items to append: `{ids}` or `{filter}`. Items already in the list and deleted items are skipped.","type":"object","properties":{"ids":{"description":"Media item ids, at most 10000","minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"filter":{"description":"Or: the media items that match these filters","type":"object","properties":{"q":{"type":"string","maxLength":200,"description":"Search title, artist and album (trigram similarity, or contained). Sorted by relevance unless `sort` is given: an exact artist match first."},"kind":{"description":"Repeat for several kinds: items of any of them","anyOf":[{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}}]},"tag":{"description":"Repeat for several tags: items with all of them","anyOf":[{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}}]},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"description":"Repeat for several statuses: items in any of them. Default: every status but `deleted`","anyOf":[{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]}}]},"station_id":{"description":"Items that the station can use: those of its sources","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"s3_key":{"description":"Exact object key. Needs `source_id`.","type":"string","minLength":1,"maxLength":1024},"folder":{"description":"Items in this folder of the source and in its subfolders: `''` for the source's root, or a path below its prefix ending in `/`, e.g. `import/Rock/` (see `GET /v1/sources/{id}/folders`). Needs `source_id`.","type":"string"},"has_video":{"description":"`true`: only video items (`has_video`); `false`: only audio items. Default: both.","anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]},"sort":{"description":"The order `add` appends the items in. Default `title`; `relevance` needs `q`. `remove` ignores it.","type":"string","enum":["relevance","title","-title","artist","-artist","album","-album","year","-year","duration_ms","-duration_ms","created_at","-created_at","updated_at","-updated_at"]}},"additionalProperties":false}},"additionalProperties":false},"remove":{"description":"Items to take out of the list: `{ids}` or `{filter}`. Runs before `add`.","type":"object","properties":{"ids":{"description":"Media item ids, at most 10000","minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"filter":{"description":"Or: the media items that match these filters","type":"object","properties":{"q":{"type":"string","maxLength":200,"description":"Search title, artist and album (trigram similarity, or contained). Sorted by relevance unless `sort` is given: an exact artist match first."},"kind":{"description":"Repeat for several kinds: items of any of them","anyOf":[{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}}]},"tag":{"description":"Repeat for several tags: items with all of them","anyOf":[{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}}]},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"description":"Repeat for several statuses: items in any of them. Default: every status but `deleted`","anyOf":[{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]}}]},"station_id":{"description":"Items that the station can use: those of its sources","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"s3_key":{"description":"Exact object key. Needs `source_id`.","type":"string","minLength":1,"maxLength":1024},"folder":{"description":"Items in this folder of the source and in its subfolders: `''` for the source's root, or a path below its prefix ending in `/`, e.g. `import/Rock/` (see `GET /v1/sources/{id}/folders`). Needs `source_id`.","type":"string"},"has_video":{"description":"`true`: only video items (`has_video`); `false`: only audio items. Default: both.","anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]},"sort":{"description":"The order `add` appends the items in. Default `title`; `relevance` needs `q`. `remove` ignores it.","type":"string","enum":["relevance","title","-title","artist","-artist","album","-album","year","-year","duration_ms","-duration_ms","created_at","-created_at","updated_at","-updated_at"]}},"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false},"examples":{"example1":{"value":{"add":{"filter":{"source_id":"0192f0c9-0000-7000-8000-000000000001","folder":"import/Rock/80s/"}}}},"example2":{"value":{"remove":{"ids":["0192f0c1-0000-7000-8000-000000000001"]},"add":{"ids":["0192f0c1-0000-7000-8000-000000000002","0192f0c1-0000-7000-8000-000000000003"]}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryItemsBulkResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/categories/filter-preview":{"post":{"summary":"Preview a category filter","tags":["categories"],"description":"A dry run of `filter` before it is saved: how many media items a filter category of this station would have (items that aren't deleted, in the station's sources), their average audible length, and the first 10 by title. The filter is checked as when a category is saved (422 for unknown sources or invalid folders). Nothing is written, so the `read` scope is enough. `:id` is the station's uuid or slug.\n\nRequires the `read` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filter":{"type":"object","properties":{"kinds":{"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}},"tags_all":{"type":"array","items":{"type":"string","minLength":1}},"tags_any":{"type":"array","items":{"type":"string","minLength":1}},"tags_none":{"type":"array","items":{"type":"string","minLength":1}},"source_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"folders":{"type":"array","items":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"path":{"type":"string","maxLength":1024}},"required":["source_id","path"],"additionalProperties":false}},"artists":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"albums":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"genres":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"year_min":{"type":"integer","minimum":0,"maximum":9999},"year_max":{"type":"integer","minimum":0,"maximum":9999},"min_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"video":{"type":"boolean"}},"additionalProperties":false,"description":"The filter to try, as a filter category would store it."}},"required":["filter"],"additionalProperties":false},"example":{"filter":{"kinds":["music"],"folders":[{"source_id":"0192f0c9-0000-7000-8000-000000000001","path":"import/Rock/"}],"genres":["Rock","Hard Rock"],"year_min":1980,"year_max":1989}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryFilterPreview"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/categories/{id}/usage":{"get":{"summary":"Where a category is used","tags":["categories"],"description":"The clocks whose slots pick from the category or pad their window with it (with how many slots), the rotation rules scoped to it, and the stations whose fallback or filler category it is. Station-restricted API keys see only their stations' clocks, rules and stations.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryUsage"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/rotation-rules":{"get":{"summary":"List a station's rotation rules","tags":["rotation-rules"],"description":"Lists the station's rotation rules in id order, disabled ones included. An unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RotationRule"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0cd-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":"0192f0ca-0000-7000-8000-000000000001","kind":"artist_separation","params":{"minutes":45},"priority":10,"enabled":true,"created_at":"2026-09-01T09:10:00.000Z","updated_at":"2026-09-01T09:10:00.000Z"},{"id":"0192f0cd-0000-7000-8000-000000000002","station_id":"0192f0c4-0000-7000-8000-000000000001","category_id":null,"kind":"song_separation","params":{"minutes":180},"priority":20,"enabled":true,"created_at":"2026-09-01T09:11:00.000Z","updated_at":"2026-09-01T09:11:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a rotation rule","tags":["rotation-rules"],"description":"Creates a rule that the planner's rotation picks follow: a minimum time between plays of the same song, artist or title, a daily play limit (`max_plays_per_day`), or a `daypart` window for tagged items, optionally only on some dates (`dates`, e.g. a season). `params` is checked against `kind`; daypart tags are stored lowercase. When no candidate is left for a pick, the planner relaxes the rules in ascending `priority`: it first halves a rule (a daily limit is doubled), then drops it; a daypart rule is only dropped. Re-plans an `active` station.\n\nErrors: `404 not_found` for the station; `422 validation_failed` on `params.*` (for example `params.dates.to` for a day that doesn't exist, such as `02-30`), or on `category_id` for an unknown category or a category of another station.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["song_separation","artist_separation","title_separation","max_plays_per_day","daypart"]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Depends on `kind` (api.md §Rotation rule params): `{minutes}` for `song_separation`, `artist_separation` and `title_separation`; `{count}` per station-local day for `max_plays_per_day`; `{tags_any, days_of_week, from, to, action, dates?}` for `daypart`, where `dates` `{from, to}` (`MM-DD`, inclusive; `to` before `from` wraps the year; `02-29` allowed) limits the rule to those station-local dates."},"category_id":{"description":"A category of the station or a shared one. Null or absent: every category of the station.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"description":"Default 0.","type":"integer","minimum":-1000000,"maximum":1000000},"enabled":{"description":"Default true.","type":"boolean"}},"required":["kind","params"],"additionalProperties":false},"examples":{"example1":{"value":{"kind":"artist_separation","params":{"minutes":45},"category_id":"0192f0ca-0000-7000-8000-000000000001","priority":10}},"example2":{"value":{"kind":"daypart","params":{"tags_any":["explicit"],"days_of_week":[1,2,3,4,5,6,7],"from":"06:00","to":"22:00","action":"exclude"}}},"example3":{"value":{"kind":"daypart","params":{"tags_any":["christmas"],"days_of_week":[1,2,3,4,5,6,7],"from":"00:00","to":"00:00","action":"only","dates":{"from":"12-01","to":"12-26"}},"priority":30}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotationRule"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/rotation-rules/{id}":{"patch":{"summary":"Update a rotation rule","tags":["rotation-rules"],"description":"Changes the fields sent. `params` replaces the whole object and is required when `kind` changes. Re-plans an `active` station.\n\nErrors: `404 not_found`; `422 validation_failed` as for creating a rule.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["song_separation","artist_separation","title_separation","max_plays_per_day","daypart"]},"params":{"description":"Replaces the whole params object. Required when `kind` changes.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"type":"integer","minimum":-1000000,"maximum":1000000},"enabled":{"type":"boolean"}},"additionalProperties":false},"example":{"params":{"minutes":45}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotationRule"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a rotation rule","tags":["rotation-rules"],"description":"Deletes the rule. Re-plans an `active` station. An unknown rule is `404 not_found`.\n\nRequires the `schedule:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/rotation-rules/batch":{"post":{"summary":"Change many rotation rules at once","tags":["rotation-rules"],"description":"Applies `delete`, then `update`, then `create` in one transaction, as `POST /v1/stations/{id}/schedule-rules/batch` does: if any entry is invalid, nothing changes. Entries are checked as for the single-rule routes, with errors at `create.<i>.<field>` and `update.<i>.<field>` (for example `create.0.params.minutes` or `update.1.category_id`); an id that isn't a rule of this station is an error at `update.<i>.id` or `delete.<i>`, as is an id listed twice or both updated and deleted. Re-plans an `active` station once. Returns every rotation rule of the station afterwards.\n\nErrors: `404 not_found` for the station; `422 validation_failed` as above.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"create":{"description":"New rules, as for `POST /v1/stations/{id}/rotation-rules`.","maxItems":500,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["song_separation","artist_separation","title_separation","max_plays_per_day","daypart"]},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Depends on `kind` (api.md §Rotation rule params): `{minutes}` for `song_separation`, `artist_separation` and `title_separation`; `{count}` per station-local day for `max_plays_per_day`; `{tags_any, days_of_week, from, to, action, dates?}` for `daypart`, where `dates` `{from, to}` (`MM-DD`, inclusive; `to` before `from` wraps the year; `02-29` allowed) limits the rule to those station-local dates."},"category_id":{"description":"A category of the station or a shared one. Null or absent: every category of the station.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"description":"Default 0.","type":"integer","minimum":-1000000,"maximum":1000000},"enabled":{"description":"Default true.","type":"boolean"}},"required":["kind","params"],"additionalProperties":false,"example":{"kind":"artist_separation","params":{"minutes":45},"category_id":"0192f0ca-0000-7000-8000-000000000001","priority":10}}},"update":{"description":"Changes to rules of this station, as for `PATCH /v1/rotation-rules/{id}`.","maxItems":500,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["song_separation","artist_separation","title_separation","max_plays_per_day","daypart"]},"params":{"description":"Replaces the whole params object. Required when `kind` changes.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"category_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"priority":{"type":"integer","minimum":-1000000,"maximum":1000000},"enabled":{"type":"boolean"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A rule of this station."}},"required":["id"],"additionalProperties":false}},"delete":{"description":"Rules of this station to delete.","maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"additionalProperties":false},"example":{"delete":["0192f0cd-0000-7000-8000-000000000002"],"update":[{"id":"0192f0cd-0000-7000-8000-000000000001","params":{"minutes":60}}],"create":[{"kind":"title_separation","params":{"minutes":120},"priority":5}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotationRuleBatchResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/clocks":{"get":{"summary":"List a station's clocks","tags":["clocks"],"description":"Lists the station's clocks in id order, without their slots (`GET /v1/clocks/{id}` includes them). An unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Clock"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0cb-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","name":"Standard hour","color":"#16a34a","duration_minutes":60,"notes":"News at :00 (hard anchor), an ident at :30 (soft anchor), music around them.","created_at":"2026-09-01T09:05:00.000Z","updated_at":"2026-09-01T09:05:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a clock","tags":["clocks"],"description":"Creates a clock for the station, optionally with its slots, checked as for `PUT /v1/clocks/{id}/slots` (new slots have no `id`). `duration_minutes` defaults to 60. The clock plays once a schedule rule or the station's `default_clock_id` uses it, so creating it re-plans nothing; what its slots name (a media slot's item, a static category's members) goes to an active station's node at once (`sync.hint`).\n\nErrors: `404 not_found` for the station; `409 name_taken` when the station already has a clock with this name; `409 conflict` when something a slot references is deleted meanwhile; `422 validation_failed` for an invalid slot (at `slots.<i>.<field>`).\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"color":{"anyOf":[{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"},{"type":"null"}]},"duration_minutes":{"type":"integer","minimum":5,"maximum":1440,"description":"5 to 1440, and divides 1440 evenly. Default 60."},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"slots":{"description":"The clock's slots, in playing order, as for `PUT /v1/clocks/{id}/slots` (without ids).","maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"description":"An existing slot of this clock to keep, so its id (and the log items planned from it) stay. Omit for a new slot.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["category","media","feed"]},"category_id":{"description":"Required for `category` slots, otherwise absent or null. A category of the station or a shared one.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"media_item_id":{"description":"Required for `media` slots, otherwise absent or null. Not a deleted item.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"feed_id":{"description":"Required for `feed` slots, otherwise absent or null.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"anchor_offset_ms":{"description":"Offset from the start of the clock, less than its duration, and greater than the anchors of earlier slots. Set together with `anchor_mode`.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"anchor_mode":{"description":"Set together with `anchor_offset_ms`.","anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"transition":{"description":"The transition into this slot's item: a cut or a crossfade. Null means the station's default.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},{"type":"null"}]},"transition_out":{"description":"The transition into the item the planner places after this slot's item, in place of that item's own: a cut, a crossfade, or an `overlay` (the next song starts under this jingle, ducked until it ends; with `fit_intro`, so that this jingle ends where the song's vocals start). A pinned item and a hard-anchored slot's item keep their own. Default null: none.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["overlay"]},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}]},{"type":"null"}]},"segment_end":{"description":"Default false. True: the slot plays once per segment as its last item, ending at the segment's end (the next anchor, or the end of the clock), with its time reserved; it never repeats with the category slots. Only on category and media slots without an anchor.","type":"boolean"},"window_ms":{"description":"Hard-anchored slots only, 5000 to 1800000; the anchor plus the window ends at or before the next anchored slot (or the end of the clock). The slot's segment ends exactly this long after its anchor and the item after it starts hard there. The slot's item plays once; what's left is padded from the station's filler category (else its fallback category; plan warning `window_unpadded` without either), and an item longer than the window is faded at its end (plan warning `window_overrun`). Null: no window.","anyOf":[{"type":"integer","minimum":5000,"maximum":1800000},{"type":"null"}]},"every_n":{"description":"Category slots without an anchor or `segment_end`, 1 to 12. The slot is left out of the slot order: in each segment, after every N songs (picks of kind `music`) from the segment's other category slots, one pick from this slot's category plays. Null: an ordinary slot.","anyOf":[{"type":"integer","minimum":1,"maximum":12},{"type":"null"}]},"max_length_ms":{"description":"Feed, media and category slots, 5000 to 1800000. The slot's item plays at most this long: its log item gets `max_play_ms`, and the engine fades it and ends it there. For a feed, the item the station resolves is capped; for a category slot, every pick is capped, and the planner fits picks by their capped length. Null: no cap.","anyOf":[{"type":"integer","minimum":5000,"maximum":1800000},{"type":"null"}]},"pad_category_id":{"description":"Only with `window_ms`: a category of the station or a shared one. The window is padded from it first, then the station's filler category, then its fallback category. Null: the filler category.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type"],"additionalProperties":false}}},"required":["name"],"additionalProperties":false},"example":{"name":"Standard hour","color":"#16a34a","duration_minutes":60,"notes":"News at :00 (hard anchor), an ident at :30 (soft anchor), music around them.","slots":[{"type":"feed","feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","label":"News"},{"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","label":"Ident"},{"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","anchor_offset_ms":1800000,"anchor_mode":"soft","label":"Half-hour ident"},{"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockWithSlots"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/clocks/{id}":{"get":{"summary":"Get a clock with its slots","tags":["clocks"],"description":"Returns the clock with its slots in playing order. An unknown clock is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockWithSlots"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a clock","tags":["clocks"],"description":"Changes the fields sent; the slots change with `PUT /v1/clocks/{id}/slots`. Changing `duration_minutes` re-plans an `active` station, and every anchor must stay within the new duration.\n\nErrors: `404 not_found`; `409 name_taken`; `422 validation_failed` for a duration that doesn't divide 24 hours or that an anchored slot doesn't fit in.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"color":{"anyOf":[{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"},{"type":"null"}]},"duration_minutes":{"description":"5 to 1440, and divides 1440 evenly. Every anchor must stay within the new duration.","type":"integer","minimum":5,"maximum":1440},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]}},"additionalProperties":false},"example":{"color":"#16a34a","notes":"News at :00 (hard anchor), an ident at :30 (soft anchor), music around them."}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockWithSlots"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a clock","tags":["clocks"],"description":"Deletes the clock with its slots and the schedule rules that use it. A station with it as `default_clock_id` loses that setting, and log items planned from it stay, without their clock. Re-plans an `active` station. An unknown clock is `404 not_found`.\n\nRequires the `schedule:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/clocks/{id}/slots":{"put":{"summary":"Replace a clock's slots","tags":["clocks"],"description":"Replaces every slot in one transaction: if any slot is invalid, nothing changes. The list order sets `position` (from 0). Send a slot's `id` to keep it (and the log items planned from it); slots left out are deleted. Re-plans an `active` station. What the slots name that the clock didn't (a media slot's item, a static category's members, a window's bed) goes to the station's node at once (`sync.hint`) if it is active.\n\nEach slot references exactly what its `type` names: a category of the station or a shared one, a media item that isn't deleted, or a feed; `pad_category_id`, a window's bed, is a category of the station or a shared one too. `anchor_mode` is set if and only if `anchor_offset_ms` is, and anchor offsets are less than the clock's duration and increase with position. `segment_end` (default false) is allowed only on category and media slots without an anchor; `transition_out` is a transition or null (the default). `window_ms` (5000 to 1800000) only on hard-anchored slots, the anchor plus the window at most the next anchor (or the clock's end); `every_n` (1 to 12) only on category slots without an anchor or `segment_end`.\n\nPlacement: a `segment_end` slot plays once per segment as its last item, ending at the next anchor or the end of the clock, its time reserved before the rest is filled; a segment too short to hold it skips it (plan warning `segment_end_skipped`). `transition_out` is the transition into the item the planner places after the slot's item, in place of that item's own; pinned and hard-anchored items keep theirs. A slot with `window_ms` plays its item once, its segment ends exactly that long after the anchor, and the item after it starts hard there: a shorter item is padded from the slot's `pad_category_id`, else the station's filler category, else its fallback category (plan warning `window_unpadded` when none fills it), a longer one is faded at the window's end (plan warning `window_overrun`). An `every_n` slot plays one pick after every N picks of its segment's other category slots, never first, and not in the slot order.\n\nErrors: `404 not_found`; `409 conflict` when something a slot references is deleted meanwhile; `422 validation_failed` at `slots.<i>.<field>`, for example a slot id that isn't one of this clock's or is listed twice, `slots.<i>.segment_end` on a feed slot or an anchored slot, `slots.<i>.window_ms` on a slot without a hard anchor or reaching past the next anchor, `slots.<i>.every_n` on a feed, media, anchored or `segment_end` slot, or `slots.<i>.pad_category_id` on a slot without a window or for a category of another station.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slots":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"description":"An existing slot of this clock to keep, so its id (and the log items planned from it) stay. Omit for a new slot.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["category","media","feed"]},"category_id":{"description":"Required for `category` slots, otherwise absent or null. A category of the station or a shared one.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"media_item_id":{"description":"Required for `media` slots, otherwise absent or null. Not a deleted item.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"feed_id":{"description":"Required for `feed` slots, otherwise absent or null.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"anchor_offset_ms":{"description":"Offset from the start of the clock, less than its duration, and greater than the anchors of earlier slots. Set together with `anchor_mode`.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"anchor_mode":{"description":"Set together with `anchor_offset_ms`.","anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"transition":{"description":"The transition into this slot's item: a cut or a crossfade. Null means the station's default.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},{"type":"null"}]},"transition_out":{"description":"The transition into the item the planner places after this slot's item, in place of that item's own: a cut, a crossfade, or an `overlay` (the next song starts under this jingle, ducked until it ends; with `fit_intro`, so that this jingle ends where the song's vocals start). A pinned item and a hard-anchored slot's item keep their own. Default null: none.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["overlay"]},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}]},{"type":"null"}]},"segment_end":{"description":"Default false. True: the slot plays once per segment as its last item, ending at the segment's end (the next anchor, or the end of the clock), with its time reserved; it never repeats with the category slots. Only on category and media slots without an anchor.","type":"boolean"},"window_ms":{"description":"Hard-anchored slots only, 5000 to 1800000; the anchor plus the window ends at or before the next anchored slot (or the end of the clock). The slot's segment ends exactly this long after its anchor and the item after it starts hard there. The slot's item plays once; what's left is padded from the station's filler category (else its fallback category; plan warning `window_unpadded` without either), and an item longer than the window is faded at its end (plan warning `window_overrun`). Null: no window.","anyOf":[{"type":"integer","minimum":5000,"maximum":1800000},{"type":"null"}]},"every_n":{"description":"Category slots without an anchor or `segment_end`, 1 to 12. The slot is left out of the slot order: in each segment, after every N songs (picks of kind `music`) from the segment's other category slots, one pick from this slot's category plays. Null: an ordinary slot.","anyOf":[{"type":"integer","minimum":1,"maximum":12},{"type":"null"}]},"max_length_ms":{"description":"Feed, media and category slots, 5000 to 1800000. The slot's item plays at most this long: its log item gets `max_play_ms`, and the engine fades it and ends it there. For a feed, the item the station resolves is capped; for a category slot, every pick is capped, and the planner fits picks by their capped length. Null: no cap.","anyOf":[{"type":"integer","minimum":5000,"maximum":1800000},{"type":"null"}]},"pad_category_id":{"description":"Only with `window_ms`: a category of the station or a shared one. The window is padded from it first, then the station's filler category, then its fallback category. Null: the filler category.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type"],"additionalProperties":false},"description":"Every slot of the clock, in playing order. Slots left out are deleted."}},"required":["slots"],"additionalProperties":false},"examples":{"example1":{"value":{"slots":[{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000004","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","anchor_offset_ms":1800000,"anchor_mode":"soft","label":"Half-hour ident"},{"id":"0192f0c3-0000-7000-8000-000000000005","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"}]}},"example2":{"value":{"slots":[{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","transition_out":{"type":"crossfade","duration_ms":1500,"curve":"linear"},"label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000004","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","anchor_offset_ms":1800000,"anchor_mode":"soft","label":"Half-hour ident"},{"id":"0192f0c3-0000-7000-8000-000000000005","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000006","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","segment_end":true,"label":"Station ID before the news"}]}},"example3":{"value":{"slots":[{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","window_ms":90000,"label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000004","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","anchor_offset_ms":1800000,"anchor_mode":"soft","label":"Half-hour ident"},{"id":"0192f0c3-0000-7000-8000-000000000005","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000007","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","every_n":3,"label":"Station ID every 3 songs"}]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockWithSlots"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/clocks/{id}/preview":{"post":{"summary":"Preview one instance of a clock, with unsaved slots","tags":["schedule"],"description":"The dry run of `GET /v1/clocks/{id}/preview`, for an editor before saving: `slots` (the body of `PUT /v1/clocks/{id}/slots`) stand in for the saved slots, checked the same way, and the categories, media and feeds they name are loaded as if saved. Without `slots` it previews the saved ones. Items of a slot sent without an `id` carry a slot id that exists only in this preview; `slot_ids` lists the id of each slot sent, in the order sent (its own `id`, or that temporary one), so an editor can match the items to its slots. Nothing is saved: the clock and its slots stay as they are. Needs only the `read` scope. The preview follows every slot field: a window's padding items carry `notes.filler`, the item after it starts `hard` at its end, `stats.segments` has the window as a segment of its own, and `warnings` has `window_overrun` and `window_unpadded`.\n\nErrors: `404 not_found`; `422 validation_failed` at `slots.<i>.<field>`, as for `PUT /v1/clocks/{id}/slots`.\n\nRequires the `read` scope.","requestBody":{"required":false,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"at":{"description":"A time inside the instance to preview. Default: now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"slots":{"description":"Slots that stand in for the saved ones, as the body of `PUT /v1/clocks/{id}/slots` and checked the same way. Default: the saved slots.","maxItems":500,"type":"array","items":{"type":"object","properties":{"id":{"description":"An existing slot of this clock to keep, so its id (and the log items planned from it) stay. Omit for a new slot.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["category","media","feed"]},"category_id":{"description":"Required for `category` slots, otherwise absent or null. A category of the station or a shared one.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"media_item_id":{"description":"Required for `media` slots, otherwise absent or null. Not a deleted item.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"feed_id":{"description":"Required for `feed` slots, otherwise absent or null.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"anchor_offset_ms":{"description":"Offset from the start of the clock, less than its duration, and greater than the anchors of earlier slots. Set together with `anchor_mode`.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"anchor_mode":{"description":"Set together with `anchor_offset_ms`.","anyOf":[{"type":"string","enum":["hard","soft"]},{"type":"null"}]},"transition":{"description":"The transition into this slot's item: a cut or a crossfade. Null means the station's default.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},{"type":"null"}]},"transition_out":{"description":"The transition into the item the planner places after this slot's item, in place of that item's own: a cut, a crossfade, or an `overlay` (the next song starts under this jingle, ducked until it ends; with `fit_intro`, so that this jingle ends where the song's vocals start). A pinned item and a hard-anchored slot's item keep their own. Default null: none.","anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type","duration_ms","curve"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["overlay"]},"duck_db":{"type":"number","minimum":0,"maximum":30},"lead_ms":{"type":"integer","minimum":0,"maximum":10000},"fade_in_ms":{"type":"integer","minimum":0,"maximum":15000},"fit_intro":{"description":"Only on an `overlay` (`422` at `slots.<i>.transition_out.fit_intro` on a cut or a crossfade). True: the next song starts so that this item ends where the song's intro marker (`intro_ms`, where its vocals start) is: the planner sets the next log item's `lead_ms` to `clamp(audible − (intro_ms − cue_in), 0, min(audible, 10000))`, with this item's audible length (after any cap) and the song's effective cue in. A next item without an intro marker after its cue in, or that isn't media, starts at this overlay's `lead_ms`. Log items carry the resolved overlay without `fit_intro`.","type":"boolean"}},"required":["type","duck_db"],"additionalProperties":false}]},{"type":"null"}]},"segment_end":{"description":"Default false. True: the slot plays once per segment as its last item, ending at the segment's end (the next anchor, or the end of the clock), with its time reserved; it never repeats with the category slots. Only on category and media slots without an anchor.","type":"boolean"},"window_ms":{"description":"Hard-anchored slots only, 5000 to 1800000; the anchor plus the window ends at or before the next anchored slot (or the end of the clock). The slot's segment ends exactly this long after its anchor and the item after it starts hard there. The slot's item plays once; what's left is padded from the station's filler category (else its fallback category; plan warning `window_unpadded` without either), and an item longer than the window is faded at its end (plan warning `window_overrun`). Null: no window.","anyOf":[{"type":"integer","minimum":5000,"maximum":1800000},{"type":"null"}]},"every_n":{"description":"Category slots without an anchor or `segment_end`, 1 to 12. The slot is left out of the slot order: in each segment, after every N songs (picks of kind `music`) from the segment's other category slots, one pick from this slot's category plays. Null: an ordinary slot.","anyOf":[{"type":"integer","minimum":1,"maximum":12},{"type":"null"}]},"max_length_ms":{"description":"Feed, media and category slots, 5000 to 1800000. The slot's item plays at most this long: its log item gets `max_play_ms`, and the engine fades it and ends it there. For a feed, the item the station resolves is capped; for a category slot, every pick is capped, and the planner fits picks by their capped length. Null: no cap.","anyOf":[{"type":"integer","minimum":5000,"maximum":1800000},{"type":"null"}]},"pad_category_id":{"description":"Only with `window_ms`: a category of the station or a shared one. The window is padded from it first, then the station's filler category, then its fallback category. Null: the filler category.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["type"],"additionalProperties":false}}},"additionalProperties":false},{"type":"null"}]},"examples":{"example1":{"value":{"at":"2026-10-01T14:25:00.000Z","slots":[{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000004","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","anchor_offset_ms":1800000,"anchor_mode":"soft","label":"Half-hour ident"},{"id":"0192f0c3-0000-7000-8000-000000000005","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","segment_end":true}]}},"example2":{"value":{"at":"2026-10-01T14:25:00.000Z","slots":[{"id":"0192f0c3-0000-7000-8000-000000000001","type":"feed","feed_id":"0192f0c5-0000-7000-8000-000000000001","anchor_offset_ms":0,"anchor_mode":"hard","window_ms":90000,"label":"News"},{"id":"0192f0c3-0000-7000-8000-000000000002","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","label":"Ident"},{"id":"0192f0c3-0000-7000-8000-000000000003","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000004","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","anchor_offset_ms":1800000,"anchor_mode":"soft","label":"Half-hour ident"},{"id":"0192f0c3-0000-7000-8000-000000000005","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000001","label":"Music"},{"id":"0192f0c3-0000-7000-8000-000000000007","type":"category","category_id":"0192f0ca-0000-7000-8000-000000000002","every_n":3,"label":"Station ID every 3 songs"}]}},"example3":{"value":{"at":"2026-10-01T14:25:00.000Z"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockDraftPreview"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"get":{"summary":"Preview one instance of a clock","tags":["schedule"],"description":"A dry-run plan of the clock's instance that contains `at` (default now), with the real rotation: as if the clock applied all day, from the instance's start with an empty log, over the station's catalog, categories, rotation rules and state, and its as-played history. Nothing is saved. `stats.segments` has the fill of each segment between anchors (a window, `window_ms`, is a segment of its own, and so are the slots after it), and `warnings` what the planner couldn't do, such as an empty category.\n\nAn unknown clock is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"at","required":false,"description":"A time inside the instance to preview. Default: now."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockPreview"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/clocks/{id}/duplicate":{"post":{"summary":"Duplicate a clock","tags":["clocks"],"description":"Creates a copy of the clock under a new `name`: its color, duration, notes and slots (with their `segment_end`, `transition_out`, `window_ms`, `every_n`, `max_length_ms` and `pad_category_id`), the slots with new ids. The copy goes to the clock's station, or to `station_id`, where every slot must be usable: a category (and a window's bed) of that station or a shared one (a category of the clock's own station isn't), a media item that isn't deleted, a feed. Like a new clock, the copy plays once a schedule rule or a default uses it, so nothing is re-planned; what its slots name goes to an active station's node at once (`sync.hint`).\n\nErrors: `404 not_found` for the clock; `403 station_forbidden` for a `station_id` the principal can't touch; `409 name_taken` when the station already has a clock with this name; `422 validation_failed` on `station_id` for an unknown station, and at `slots.<i>.category_id`, `slots.<i>.pad_category_id`, `slots.<i>.media_item_id` or `slots.<i>.feed_id` for a slot that can't be copied there.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The copy's name, unique in its station."},"station_id":{"description":"The station to copy the clock to. Default: the clock's own station.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name"],"additionalProperties":false},"examples":{"example1":{"value":{"name":"Standard hour (weekend)"}},"example2":{"value":{"name":"Standard hour","station_id":"0192f0c4-0000-7000-8000-000000000002"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClockWithSlots"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/schedule-rules":{"get":{"summary":"List a station's schedule rules","tags":["schedule-rules"],"description":"Lists the station's schedule rules in id order. `GET /v1/stations/{id}/schedule` shows the clock instances they resolve to. An unknown station is `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleRule"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0cc-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"All week","days_of_week":[1,2,3,4,5,6,7],"start_time":"00:00:00","end_time":"00:00:00","valid_from":null,"valid_until":null,"priority":0,"created_at":"2026-09-01T09:06:00.000Z","updated_at":"2026-09-01T09:06:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a schedule rule","tags":["schedule-rules"],"description":"Creates a rule that plays one of the station's clocks on the given days, from `start_time` to `end_time` (station-local), optionally only between `valid_from` and `valid_until`. An end at or before the start crosses midnight, so `00:00`–`00:00` is the whole day. Where rules overlap, the highest `priority` wins; on a tie, the most recently created rule. Re-plans an `active` station.\n\nErrors: `404 not_found` for the station; `422 validation_failed` for a repeated day, a `valid_until` before `valid_from`, or an unknown clock or a clock of another station (on `clock_id`).\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A clock of the station."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"days_of_week":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"ISO days, 1 = Monday … 7 = Sunday, each at most once: the day the range starts."},"start_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Station-local time of day, `HH:MM` or `HH:MM:SS`"},"end_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Exclusive. At or before `start_time` crosses midnight; equal to it means 24 hours."},"valid_from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"valid_until":{"description":"On or after `valid_from`.","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"priority":{"description":"Default 0.","type":"integer","minimum":-1000000,"maximum":1000000}},"required":["clock_id","days_of_week","start_time","end_time"],"additionalProperties":false},"example":{"clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"All week","days_of_week":[1,2,3,4,5,6,7],"start_time":"00:00","end_time":"00:00"}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRule"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/schedule-rules/{id}":{"patch":{"summary":"Update a schedule rule","tags":["schedule-rules"],"description":"Changes the fields sent; the others keep their values. Re-plans an `active` station.\n\nErrors: `404 not_found`; `422 validation_failed` as for creating a rule.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"days_of_week":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Station-local time of day, `HH:MM` or `HH:MM:SS`"},"end_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Station-local time of day, `HH:MM` or `HH:MM:SS`"},"valid_from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"valid_until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"priority":{"type":"integer","minimum":-1000000,"maximum":1000000}},"additionalProperties":false},"example":{"name":"All week","days_of_week":[1,2,3,4,5,6,7]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRule"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a schedule rule","tags":["schedule-rules"],"description":"Deletes the rule; where no other rule applies, the station's default clock (or without one, the fallback category) takes over. Re-plans an `active` station. An unknown rule is `404 not_found`.\n\nRequires the `schedule:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/schedule-rules/batch":{"post":{"summary":"Change many schedule rules at once","tags":["schedule-rules"],"description":"Applies `delete`, then `update`, then `create` in one transaction: if any entry is invalid, nothing changes. Entries are checked as for the single-rule routes, with errors at `create.<i>.<field>` and `update.<i>.<field>`; an id that isn't a rule of this station is an error at `update.<i>.id` or `delete.<i>`, as is an id listed twice or both updated and deleted. Re-plans an `active` station once. Returns every rule of the station afterwards.\n\nErrors: `404 not_found` for the station; `422 validation_failed` as above.\n\nRequires the `schedule:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"create":{"description":"New rules, as for `POST /v1/stations/{id}/schedule-rules`.","maxItems":500,"type":"array","items":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A clock of the station."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"days_of_week":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"ISO days, 1 = Monday … 7 = Sunday, each at most once: the day the range starts."},"start_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Station-local time of day, `HH:MM` or `HH:MM:SS`"},"end_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Exclusive. At or before `start_time` crosses midnight; equal to it means 24 hours."},"valid_from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"valid_until":{"description":"On or after `valid_from`.","anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"priority":{"description":"Default 0.","type":"integer","minimum":-1000000,"maximum":1000000}},"required":["clock_id","days_of_week","start_time","end_time"],"additionalProperties":false,"example":{"clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"All week","days_of_week":[1,2,3,4,5,6,7],"start_time":"00:00","end_time":"00:00"}}},"update":{"description":"Changes to rules of this station, as for `PATCH /v1/schedule-rules/{id}`.","maxItems":500,"type":"array","items":{"type":"object","properties":{"clock_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"days_of_week":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},"start_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Station-local time of day, `HH:MM` or `HH:MM:SS`"},"end_time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$","description":"Station-local time of day, `HH:MM` or `HH:MM:SS`"},"valid_from":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"valid_until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"Station-local date, `YYYY-MM-DD`"},{"type":"null"}]},"priority":{"type":"integer","minimum":-1000000,"maximum":1000000},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A rule of this station."}},"required":["id"],"additionalProperties":false}},"delete":{"description":"Rules of this station to delete.","maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"additionalProperties":false},"example":{"delete":["0192f0cc-0000-7000-8000-000000000002"],"update":[{"id":"0192f0cc-0000-7000-8000-000000000001","days_of_week":[1,2,3,4,5]}],"create":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","name":"Weekend","days_of_week":[6,7],"start_time":"00:00","end_time":"00:00","priority":10}]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRuleBatchResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/schedule":{"get":{"summary":"Resolve a station's schedule","tags":["schedule"],"description":"The clock instances that overlap `from` to `to` (at most 14 days), in order and without gaps, from the schedule rules, the default clock and the fallback category. `source` is `rule`, `default` or `fallback`; `clock_id` is null for the fallback pseudo-clock. `start_at`/`end_at` are clipped where the clock changes in the middle of an instance, while `instance_start_at` keeps the grid time. Nothing is planned or saved: `GET /v1/stations/{id}/log` has the planned items.\n\nErrors: `404 not_found` for the station; `422 validation_failed` (on `to`) when `to` isn't after `from` or is more than 14 days after it.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"from","required":false,"description":"Default: now"},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"to","required":false,"description":"Default: `from` + 24 h. At most 14 days after `from`."},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleInstance"}},"example":[{"clock_id":"0192f0cb-0000-7000-8000-000000000001","rule_id":"0192f0cc-0000-7000-8000-000000000001","source":"rule","instance_start_at":"2026-10-01T14:00:00.000Z","start_at":"2026-10-01T14:00:00.000Z","end_at":"2026-10-01T15:00:00.000Z"},{"clock_id":"0192f0cb-0000-7000-8000-000000000001","rule_id":"0192f0cc-0000-7000-8000-000000000001","source":"rule","instance_start_at":"2026-10-01T15:00:00.000Z","start_at":"2026-10-01T15:00:00.000Z","end_at":"2026-10-01T16:00:00.000Z"},{"clock_id":"0192f0cb-0000-7000-8000-000000000001","rule_id":"0192f0cc-0000-7000-8000-000000000001","source":"rule","instance_start_at":"2026-10-01T16:00:00.000Z","start_at":"2026-10-01T16:00:00.000Z","end_at":"2026-10-01T17:00:00.000Z"}]}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/log":{"get":{"summary":"Get a station's log","tags":["log"],"description":"The planned log, from now − 10 min through the station's plan horizon by default: every item that overlaps `[from, to)`, in playing order, with a summary of its media, its feed, the feed item the station resolved, and the clock `slot` it was planned from (as the slot is now). Not paginated. Cancelled items only with `include_cancelled=true`. `locked` marks the items that can't change any more (loaded, playing, over, or starting inside the lock window, which ends at `lock_until`). `log_generation` increases with every change and the `log.updated` event carries it, so a client can re-read the log when it changes. `to` must be after `from` and at most 7 days later (422 on `to`).\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"from","required":false,"description":"Default: now − 10 min"},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"to","required":false,"description":"Default: now + the station's plan horizon. At most 7 days after `from`."},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"include_cancelled","required":false,"description":"Also return cancelled items. Default false."},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Log"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/log/items":{"post":{"summary":"Insert an item into a station's log","tags":["log"],"description":"Inserts a media item (`media_item_id`), a feed (`feed_id`) or a pick from a category (`category_id`), exactly one of them, as a pinned item: `origin` is `manual` from the dashboard and `api` with an API key. A category pick is made at once, as a slot of the category would make it at the item's start (the category's rotation, the station's rotation rules over the history and the planned log, relaxing a rule only when nothing else fits, recorded in `notes`), and plays as a media item. `position` places it:\n\n- `next`: right after the locked part of the log (the playing item and whatever starts inside the lock window), so it plays as soon as the log can still change;\n- `after`: where that upcoming item of the station's log ends;\n- `at` a time, `hard` or `soft`. A `hard` item starts exactly then: it is an extra hard anchor, the planner fits the picks before it to end then, and the engine fades out whatever still plays. A `soft` item follows the item before it, which the planner aims to end near that time without cutting anything.\n\nThe log is then re-planned at once, in the same transaction, fitting the picks around the new item, and `log.updated` is published. The response is the item as planned, with the log's new generation. A feed item is planned with the feed's estimated length until the station resolves it. A media item the station's node doesn't hold yet is sent to it at once (`sync.hint`).\n\nErrors: 422 on `media_item_id` unless exactly one of `media_item_id`, `feed_id` and `category_id` is given, or for unknown media or media that isn't `ready`; 422 on `feed_id` for an unknown feed; 422 on `category_id` for an unknown category, a category of another station, or one with no member the station can play; 422 on `position.at` for a time inside the lock window; 422 on `position.log_item_id` for an item that isn't upcoming in this station's log; `409 log_item_locked` after an item whose successor is locked.\n\nRequires the `log:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_item_id":{"description":"The media item to play (`ready`). Give exactly one of `media_item_id`, `feed_id` and `category_id`.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"feed_id":{"description":"The feed to play: the station resolves its current item when it loads the slot.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"description":"A category of the station, or a shared one: the item is picked from it at once, as a slot of it would pick (its rotation, the station's rotation rules, the history and the planned log), and plays as a media item.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["next"]}},"required":["type"],"additionalProperties":false,"description":"Right after the locked part of the log (the playing item and whatever starts inside the lock window)."},{"type":"object","properties":{"type":{"type":"string","enum":["after"]},"log_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"An upcoming item of the station's log."}},"required":["type","log_item_id"],"additionalProperties":false,"description":"Where that item ends."},{"type":"object","properties":{"type":{"type":"string","enum":["at"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"At or after the end of the lock window (now + `lock_window_seconds`)."},"mode":{"type":"string","enum":["hard","soft"],"description":"`hard` starts exactly at `at`; `soft` follows the item before, which aims to end at `at`"}},"required":["type","at","mode"],"additionalProperties":false,"description":"At a time."}],"description":"Where the item goes in the log."},"transition":{"description":"The transition into the item: a cut or a crossfade. Default: the station's.","oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]}},"required":["position"],"additionalProperties":false},"examples":{"example1":{"value":{"media_item_id":"0192f0c1-0000-7000-8000-000000000004","position":{"type":"at","at":"2026-10-01T14:15:00.000Z","mode":"hard"}}},"example2":{"value":{"media_item_id":"0192f0c1-0000-7000-8000-000000000003","position":{"type":"next"}}},"example3":{"value":{"category_id":"0192f0ca-0000-7000-8000-000000000002","position":{"type":"next"}}},"example4":{"value":{"media_item_id":"0192f0c1-0000-7000-8000-000000000004","position":{"type":"after","log_item_id":"0192f0c2-0000-7000-8000-000000000004"}}},"example5":{"value":{"feed_id":"0192f0c5-0000-7000-8000-000000000001","position":{"type":"at","at":"2026-10-01T14:30:00.000Z","mode":"soft"},"transition":{"type":"cut"}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEditResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/log-items/{id}":{"patch":{"summary":"Move, re-time or replace a log item","tags":["log"],"description":"`position` moves the item, as for an insert (`next`, `after` an item, or `at` a time, `hard` or `soft`); `transition` changes the transition into it; `media_item_id` replaces what a `media` item plays, in its place (the scheduler's notes about how the old item was picked are dropped). The item becomes pinned, the log is re-planned at once in the same transaction, and `log.updated` is published. A new media item the station's node doesn't hold yet is sent to it at once (`sync.hint`). The response is the item as planned, with the log's new generation; an empty body changes nothing and returns the item as it is.\n\nErrors: 404 for an unknown item; `409 log_item_locked` for an item that isn't `planned` (loaded, playing, over or cancelled) or that starts inside the lock window or before a loaded or playing item, and for a move after an item whose successor is locked; 422 on `position.at` for a time inside the lock window, and on `position.log_item_id` for the item itself or an item that isn't upcoming in the station's log; 422 on `media_item_id` for a feed item, unknown media, or media that isn't `ready`.\n\nRequires the `log:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"position":{"description":"Moves the item, as for an insert.","oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["next"]}},"required":["type"],"additionalProperties":false,"description":"Right after the locked part of the log (the playing item and whatever starts inside the lock window)."},{"type":"object","properties":{"type":{"type":"string","enum":["after"]},"log_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"An upcoming item of the station's log."}},"required":["type","log_item_id"],"additionalProperties":false,"description":"Where that item ends."},{"type":"object","properties":{"type":{"type":"string","enum":["at"]},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"At or after the end of the lock window (now + `lock_window_seconds`)."},"mode":{"type":"string","enum":["hard","soft"],"description":"`hard` starts exactly at `at`; `soft` follows the item before, which aims to end at `at`"}},"required":["type","at","mode"],"additionalProperties":false,"description":"At a time."}]},"transition":{"description":"The transition into the item: a cut or a crossfade.","oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]},"media_item_id":{"description":"Replaces what a `media` item plays (a `ready` media item), in its place.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"additionalProperties":false},"examples":{"example1":{"value":{"position":{"type":"at","at":"2026-10-01T14:15:00.000Z","mode":"soft"}}},"example2":{"value":{"media_item_id":"0192f0c1-0000-7000-8000-000000000002"}},"example3":{"value":{"transition":{"type":"crossfade","duration_ms":5000,"curve":"linear","fade_in_ms":500}}},"example4":{"value":{"position":{"type":"after","log_item_id":"0192f0c2-0000-7000-8000-000000000004"},"transition":{"type":"cut"}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEditResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Cancel a log item","tags":["log"],"description":"Sets the item's status to `cancelled`, re-plans the log at once in the same transaction, and publishes `log.updated`. Cancelling a cancelled item does nothing and returns 204 again. The item of a media or feed slot is marked `notes.suppressed: true`, and the planner doesn't place that slot again in that clock instance; the next instance plays it as usual. To drop a slot for good, change the clock. Errors: 404 for an unknown item; `409 log_item_locked` for an item that is loaded, playing, over, or starts inside the lock window or before a loaded or playing item.\n\nRequires the `log:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Cancelled"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/log-items/{id}/restore":{"post":{"summary":"Restore a cancelled log item","tags":["log"],"description":"A `cancelled` item becomes `planned` again, pinned at its place (its start and start mode; its `notes.suppressed` removed), the log is re-planned at once in the same transaction, fitting the picks around it, and `log.updated` is published. The response is the item as planned, with the log's new generation. The inverse of `DELETE /v1/log-items/{id}`, for an undo.\n\nErrors: 404 for an unknown item; `409 log_item_not_cancelled` for an item that isn't cancelled; `409 log_item_locked` for a cancelled item whose planned start is inside the lock window, has passed, or is before a loaded or playing item.\n\nRequires the `log:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEditResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/log/replan":{"post":{"summary":"Re-plan a station's log","tags":["log"],"description":"Re-plans the log at once, picking every unpinned item that starts at or after `from` (default now) and after the lock window again, and planning through the horizon. Pinned items (inserts and edited items) and locked items stay. The body may be omitted. When anything changed, the log's generation increases and `log.updated` is published. Returns the new generation, the counts of added, updated and cancelled items, and where the planned log now ends.\n\nRequires the `log:write` scope.","requestBody":{"required":false,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"from":{"description":"Re-pick unpinned items starting at or after this time (never inside the lock window). Default: now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"additionalProperties":false},{"type":"null"}]},"examples":{"example1":{"value":{"from":"2026-10-01T15:00:00.000Z"}},"example2":{"value":{}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogReplanResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/now-playing":{"get":{"summary":"Get what a station is playing","tags":["now-playing"],"description":"`current` is the most recently started play while it hasn't ended (and at most 10 min past its planned end), with its position from the station's last status. `next` lists the next 3 items of the log after the one on air. `recent` lists the last 5 plays that ended. Listener samples and runtimes older than 60 s count as stale. The `track.started` and `track.ended` events carry the same data live.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NowPlaying"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/skip":{"post":{"summary":"Skip the current item","tags":["control"],"description":"Sends a `skip` command to the station, which fades the current item out over 1 s and starts the next one; `track.ended` (`skipped`) and `track.started` events follow. Returns `409 station_not_connected` when the station's runtime says it isn't connected: `connected` is false, or it was last written more than 60 s ago, or the station never reported.\n\nRequires the `control` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandAccepted"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/start":{"post":{"summary":"Start a station","tags":["control"],"description":"Sets the status to `active`, pushes the node's config (its agent starts the station process) and re-plans the station. Starting an active station pushes the config and re-plans again.\n\nErrors, in this order: `409 station_disabled` for a disabled station; `409 station_no_node` for one without a node; `409 station_not_ready` while a readiness check is `blocking` (no enabled output, or nothing it can play: `GET /v1/stations/{id}/readiness`), with every check in `checks`. `force=true` starts it anyway.\n\nRequires the `control` scope.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"force","required":false,"description":"`true` starts the station even when a readiness check is blocking. Default false."},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"409":{"description":"`station_disabled`, `station_no_node`, or `station_not_ready` with the readiness `checks` (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/StationNotReadyProblem"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/stop":{"post":{"summary":"Stop a station","tags":["control"],"description":"Sets the status to `paused` and pushes the node's config, so its agent stops the station process. The station stays on its node, and its log is kept. Stopping a paused station pushes the config again. Returns `409 station_disabled` for a disabled station and `409 station_no_node` for one without a node.\n\nRequires the `control` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/pad":{"get":{"summary":"Get a station's pad","tags":["log"],"description":"The station's pad: its buttons in position order. Each plays a media item (`media` summarizes it) or a pick from a category (`category`), with `POST /v1/stations/{id}/play`. A button whose media item was deleted is left out.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pad"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"put":{"summary":"Replace a station's pad","tags":["log"],"description":"Replaces every button of the pad with `buttons`, whose list order is their position; an empty list clears the pad. A button sent with its `id` (one of this pad's) keeps it; buttons left out are removed. Each button plays exactly one of `media_item_id` (an item that isn't deleted) and `category_id` (a category of the station, or a shared one). Returns the pad, and publishes `pad.updated` for the station.\n\nErrors: 422 at `buttons` for more than 48; at `buttons.<i>.label` for a label that isn't 1 to 40 characters; at `buttons.<i>.color` for a colour that isn't `#rrggbb`; at `buttons.<i>.media_item_id` unless exactly one source is given, or for an unknown or deleted item; at `buttons.<i>.category_id` for an unknown category or one of another station; at `buttons.<i>.id` for an id that isn't one of this pad's buttons, or that appears twice.\n\nRequires the `log:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buttons":{"maxItems":48,"type":"array","items":{"type":"object","properties":{"id":{"description":"A button of this pad: sent with its id, it keeps it.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":40},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"`#rrggbb` (stored lowercase)."},{"type":"null"}]},"media_item_id":{"description":"The media item to play (not deleted). Give exactly one of `media_item_id` and `category_id`.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"description":"A category of the station, or a shared one.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["label"],"additionalProperties":false,"description":"A button, at the position of its place in the list."},"description":"Every button of the pad, in order: positions are the list order."}},"required":["buttons"],"additionalProperties":false},"examples":{"example1":{"value":{"buttons":[{"id":"0192f0da-0000-7000-8000-000000000001","label":"Station ID","color":"#e4572e","media_item_id":"0192f0c1-0000-7000-8000-000000000003"},{"label":"Any ID","category_id":"0192f0ca-0000-7000-8000-000000000002"},{"label":"Sponsor","color":"#2e86ab","media_item_id":"0192f0c1-0000-7000-8000-000000000004"}]}},"example2":{"value":{"buttons":[]}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pad"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/play":{"post":{"summary":"Play an item next or now","tags":["log"],"description":"Plays a media item (`media_item_id`), a pick from a category (`category_id`) or a pad button's (`pad_button_id`), exactly one of them, on the running station, even inside the lock window. It becomes a pinned log item (`origin` `manual` from the dashboard, `api` with an API key):\n\n- `next`: right after the item on air, at its segue point (the item on air keeps playing to it, with `transition` into the new item);\n- `now`: at once; the item on air ends with the skip fade, as `POST /v1/stations/{id}/skip` ends it. Needs the `control` scope as well.\n\nWith nothing on air (the station plays its fallback or filler), both start it at once. The locked items after it, and pinned ones it would overlap (an earlier `next`), move to where it ends (hard items keep their times; an item that would then start inside a hard item's fade is cancelled, as the station would skip it), the log is re-planned in the same transaction, and `log.updated` is published. The station then gets the new `log.snapshot` and the `play` command, in that order. A category pick is made among the members the station's node holds in their current version, by the category's pick order and the station's rotation rules, as an insert's pick is, and recorded in the item's `notes` as `category_id`.\n\nReturns 202 with the item, the log's new generation and the command's id; the station answers the command with `command.result`, which the API logs.\n\nErrors: `403 insufficient_scope` for `now` without `control`; 422 on `media_item_id` unless exactly one source is given, or for unknown media or media that isn't `ready`; 422 on `category_id` for an unknown category, one of another station, or one with no member on the station's node; `404 not_found` for a pad button that isn't on this station's pad; `409 station_not_connected` when the station isn't connected or hasn't reported for 60 s; `409 media_not_on_node` when the station's node doesn't hold the file, or holds an older version: the item is then sent to the node (`sync.hint`) if its stations need it (in their sources, a static category, a clock slot or the log), so a later attempt can play it.\n\nRequires the `log:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_item_id":{"description":"A media item to play (`ready`, and on the station's node). Give exactly one of `media_item_id`, `category_id` and `pad_button_id`.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category_id":{"description":"A category of the station, or a shared one: one of its members that the station's node holds is picked, by the category's pick order and the station's rules.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"pad_button_id":{"description":"A button of the station's pad (`GET /v1/stations/{id}/pad`): plays its item or a pick from its category.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"when":{"type":"string","enum":["next","now"],"description":"`next`: right after the item on air. `now`: at once, ending the item on air with the skip fade (needs the `control` scope)."},"transition":{"description":"The transition into the item: a cut or a crossfade. Default: the station's.","oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["cut"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["crossfade"]},"duration_ms":{"type":"integer","minimum":0,"maximum":15000},"curve":{"type":"string","enum":["linear","equal_power"]},"fade_in_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","duration_ms","curve"],"additionalProperties":false}]}},"required":["when"],"additionalProperties":false},"examples":{"example1":{"value":{"pad_button_id":"0192f0da-0000-7000-8000-000000000001","when":"next"}},"example2":{"value":{"media_item_id":"0192f0c1-0000-7000-8000-000000000003","when":"now"}},"example3":{"value":{"category_id":"0192f0ca-0000-7000-8000-000000000002","when":"next","transition":{"type":"cut"}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlayResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/history":{"get":{"summary":"List what a station played","tags":["history"],"description":"The station's as-played history, newest first (by `started_at`), including the item playing now (its `ended_at` is null). `from` is inclusive and `to` exclusive; without them the whole history is paged. The other filters combine with AND. `to` must be after `from` (422 on `to`), and a cursor that doesn't come from this endpoint is 422 on `cursor`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"from","required":false,"description":"Plays that started at or after this time"},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"to","required":false,"description":"Plays that started before this time"},{"schema":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"in":"query","name":"kind","required":false,"description":"Only plays of this media kind"},{"schema":{"type":"string","enum":["log","fallback","filler"]},"in":"query","name":"origin","required":false,"description":"Only plays from the log, the fallback or the filler"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"media_item_id","required":false,"description":"Only plays of this media item"},{"schema":{"type":"string","minLength":1,"maxLength":500},"in":"query","name":"artist","required":false,"description":"Only plays of this artist (exact match, case-insensitive)"},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page"},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AsPlayed"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0c7-0000-7000-8000-000000000002","station_id":"0192f0c4-0000-7000-8000-000000000001","node_id":"0192f0cf-0000-7000-8000-000000000001","log_item_id":"0192f0c2-0000-7000-8000-000000000002","media_item_id":"0192f0c1-0000-7000-8000-000000000001","feed_item_id":null,"origin":"log","started_at":"2026-10-01T13:58:12.400Z","ended_at":null,"duration_ms":null,"end_reason":null,"title":"Neon Harbor","artist":"The Night Signals","isrc":"DEZ652600117","kind":"music","created_at":"2026-10-01T13:58:12.437Z"},{"id":"0192f0c7-0000-7000-8000-000000000001","station_id":"0192f0c4-0000-7000-8000-000000000001","node_id":"0192f0cf-0000-7000-8000-000000000001","log_item_id":"0192f0c2-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-000000000003","feed_item_id":null,"origin":"log","started_at":"2026-10-01T13:58:07.200Z","ended_at":"2026-10-01T13:58:15.400Z","duration_ms":8200,"end_reason":"completed","title":"Rock FM Station ID","artist":null,"isrc":null,"kind":"station_id","created_at":"2026-10-01T13:58:07.228Z"}],"next_cursor":"MjAyNi0xMC0wMVQxMzo1ODowNy4yMDBaLDAxOTJmMGM3LTAwMDAtNzAwMC04MDAwLTAwMDAwMDAwMDAwMQ"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/reports/plays":{"get":{"summary":"Export plays","tags":["reports"],"description":"Every play that started in `[from, to)`, oldest first, for one station or for every station you can see (station-restricted API keys: their stations). The range is at most 31 days. `kind`, `origin`, `media_item_id` and `artist` filter as `GET /v1/stations/{id}/history` does, so an export matches a filtered history. Columns: `started_at, ended_at, duration_ms, station, title, artist, isrc, kind, origin, end_reason`; `station` is the station's slug, and fields of a play that hasn't ended are empty (CSV) or null (JSON). `format=csv` returns RFC 4180 CSV (UTF-8, CRLF line ends, a header record) as an attachment named `plays-<station slug or all>-<from>-<to>.csv`; text a spreadsheet would run as a formula gets a leading apostrophe. The body is streamed. Errors: 422 on `to` when it isn't after `from` or is more than 31 days later; `404 not_found` for an unknown `station_id`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"query","name":"station_id","required":false,"description":"The station's id (uuid) or slug. Without it, the report covers every station you can see."},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"from","required":true,"description":"Plays that started at or after this time"},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"to","required":true,"description":"Plays that started before this time; at most 31 days after from"},{"schema":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"in":"query","name":"kind","required":false,"description":"Only plays of this media kind"},{"schema":{"type":"string","enum":["log","fallback","filler"]},"in":"query","name":"origin","required":false,"description":"Only plays from the log, the fallback or the filler"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"media_item_id","required":false,"description":"Only plays of this media item"},{"schema":{"type":"string","minLength":1,"maxLength":500},"in":"query","name":"artist","required":false,"description":"Only plays of this artist (exact match, case-insensitive)"},{"schema":{"default":"json","type":"string","enum":["json","csv"]},"in":"query","name":"format","required":false,"description":"Default `json`"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"The plays","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaysReport"}},"text/csv":{"schema":{"type":"string","description":"RFC 4180 CSV (UTF-8, CRLF line ends) with the header `started_at,ended_at,duration_ms,station,title,artist,isrc,kind,origin,end_reason`","examples":["started_at,ended_at,duration_ms,station,title,artist,isrc,kind,origin,end_reason\r\n2026-10-01T13:58:07.200Z,2026-10-01T13:58:15.400Z,8200,rock,Rock FM Station ID,,,station_id,log,completed\r\n2026-10-01T13:58:12.400Z,2026-10-01T14:00:00.000Z,107600,rock,Neon Harbor,The Night Signals,DEZ652600117,music,log,faded\r\n2026-10-01T14:00:00.000Z,2026-10-01T14:01:01.800Z,61800,rock,News 14:00,,,news,log,completed\r\n2026-10-01T14:01:01.800Z,,,rock,Paper Satellites,Juniper Road,GBX7L2600342,music,log,\r\n"]}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/reports/top":{"get":{"summary":"Most played tracks or artists","tags":["reports"],"description":"The most played media items (`by=track`) or artists (`by=artist`, ignoring case) among the plays that started in `[from, to)`, most plays first (ties: the most recently played), for one station or for every station you can see (station-restricted API keys: their stations). The range is at most 31 days. Titles and artists are the ones the latest play stored, or the media item's where it stored none; plays without an artist don't count for `by=artist`. `kind` and `origin` filter the plays as `GET /v1/stations/{id}/history` does (`kind=music` leaves out idents and jingles). Errors: 422 on `to` when it isn't after `from` or is more than 31 days later; `404 not_found` for an unknown `station_id`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"query","name":"station_id","required":false,"description":"The station's id (uuid) or slug. Without it, the report covers every station you can see."},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"from","required":true,"description":"Plays that started at or after this time"},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"to","required":true,"description":"Plays that started before this time; at most 31 days after from"},{"schema":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"in":"query","name":"kind","required":false,"description":"Only plays of this media kind, e.g. `music`"},{"schema":{"type":"string","enum":["log","fallback","filler"]},"in":"query","name":"origin","required":false,"description":"Only plays from the log, the fallback or the filler"},{"schema":{"default":"track","type":"string","enum":["track","artist"]},"in":"query","name":"by","required":false,"description":"`track` (the default): media items; `artist`: artists, ignoring case"},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"limit","required":false,"description":"How many, 1 to 200. Default 50."}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopReport"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/stations/{id}/listeners":{"get":{"summary":"Get a station's listener counts over time","tags":["listeners"],"description":"Listener samples in `[from, to)` (the agent reports each output every 15 s), grouped into buckets with `date_bin`. Each output counts with its peak (the maximum of its samples) in the bucket, and `total` is the sum over outputs. Buckets without samples are left out: a gap means no data, not zero listeners. The range may span at most 5000 intervals (about 3.5 days at `1m`, 17 days at `5m`); samples are kept for 90 days. Buckets come oldest first. `to` must be after `from` and within 5000 intervals of it (422 on `to`).\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"from","required":false,"description":"Default: 24 hours before `to`"},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"in":"query","name":"to","required":false,"description":"Exclusive. Default: now"},{"schema":{"default":"5m","type":"string","enum":["1m","5m","1h"]},"in":"query","name":"interval","required":false,"description":"Bucket size. Default `5m`"},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The station's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Buckets with samples, oldest first.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ListenerBucket"},"description":"Buckets with samples, oldest first."},"example":[{"t":"2026-10-01T13:45:00.000Z","total":171,"by_output":{"0192f0ce-0000-7000-8000-000000000001":133,"0192f0ce-0000-7000-8000-000000000002":38}},{"t":"2026-10-01T13:50:00.000Z","total":179,"by_output":{"0192f0ce-0000-7000-8000-000000000001":139,"0192f0ce-0000-7000-8000-000000000002":40}},{"t":"2026-10-01T13:55:00.000Z","total":186,"by_output":{"0192f0ce-0000-7000-8000-000000000001":143,"0192f0ce-0000-7000-8000-000000000002":43}}]}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/public/stations":{"get":{"summary":"List the active stations","tags":["public"],"description":"Every active station, by name, with its listener URLs. Paused and disabled stations are left out. No authentication, and no cookies are set. Sent with `Access-Control-Allow-Origin: *` and `Cache-Control: public, max-age=5`, and a strong `ETag` over the body: a request with a matching `If-None-Match` gets `304 Not Modified` without a body. Rate-limited to 120 requests per minute per client address (`429 rate_limited`); 429 and 5xx responses are `Cache-Control: no-store`.","security":[],"responses":{"200":{"description":"The active stations, by name.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicStation"},"description":"The active stations, by name."},"example":[{"slug":"rock","name":"Rock FM","description":"Classic and modern rock, news on the hour.","streams":[{"kind":"icecast","codec":"mp3","bitrate_kbps":128,"url":"https://stream1.example.com/rock-mp3","video":false},{"kind":"hls","codec":"aac","bitrate_kbps":64,"url":"https://stream1.example.com/hls/rock/master.m3u8","video":false}]},{"slug":"talk","name":"Talk Radio","description":null,"streams":[{"kind":"icecast","codec":"mp3","bitrate_kbps":128,"url":"https://stream1.example.com/talk-mp3","video":false}]}]}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/public/stations/{slug}":{"get":{"summary":"Get an active station","tags":["public"],"description":"An active station with its listener URLs. Paused, disabled and unknown stations are `404 not_found`. No authentication, and no cookies are set. Sent with `Access-Control-Allow-Origin: *` and `Cache-Control: public, max-age=5`, and a strong `ETag` over the body: a request with a matching `If-None-Match` gets `304 Not Modified` without a body. Rate-limited to 120 requests per minute per client address (`429 rate_limited`); 429 and 5xx responses are `Cache-Control: no-store`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"slug","required":true,"description":"The station's slug"}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicStation"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/public/stations/{slug}/now-playing":{"get":{"summary":"Get what an active station is playing","tags":["public"],"description":"Only music, news, traffic and weather items are shown. `current` is the item on air; while a jingle, spot or other item plays, it is the last music item (if it started within the hour), and null when nothing plays. `next` lists the next 3 such items of the log; a bulletin slot whose item isn't chosen yet shows its feed's name. Paused, disabled and unknown stations are `404 not_found`. No authentication, and no cookies are set. Sent with `Access-Control-Allow-Origin: *` and `Cache-Control: public, max-age=5`, and a strong `ETag` over the body: a request with a matching `If-None-Match` gets `304 Not Modified` without a body. Rate-limited to 120 requests per minute per client address (`429 rate_limited`); 429 and 5xx responses are `Cache-Control: no-store`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"slug","required":true,"description":"The station's slug"}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicNowPlaying"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/storage-connections":{"get":{"summary":"List storage connections","tags":["storage-connections"],"description":"Every storage connection, ordered by id. Page with `next_cursor` until it is null. Secret access keys are never returned.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StorageConnection"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d2-0000-7000-8000-000000000001","name":"hetzner-media","endpoint":"https://fsn1.your-objectstorage.com","region":"fsn1","bucket":"radioengine-media","access_key_id":"AKIAIOSFODNN7EXAMPLE","force_path_style":false,"created_at":"2026-09-01T08:40:00.000Z","updated_at":"2026-09-01T08:40:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a storage connection","tags":["storage-connections"],"description":"An S3 bucket and its credentials. `secret_access_key` is stored encrypted and never returned. The credentials aren't checked here: check them with `POST /v1/storage-connections/{id}/test`, then add sources on the bucket. A name another connection has returns `409 name_taken`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"endpoint":{"type":"string","maxLength":2048,"format":"uri","description":"The S3 endpoint, e.g. `https://fsn1.your-objectstorage.com`"},"region":{"type":"string","minLength":1,"maxLength":64},"bucket":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$","description":"3 to 63 lowercase letters, digits, dots and hyphens (S3 bucket naming rules)."},"access_key_id":{"type":"string","minLength":1,"maxLength":256},"secret_access_key":{"type":"string","minLength":1,"maxLength":1024,"description":"Write-only: stored encrypted and never returned."},"force_path_style":{"default":false,"description":"Path-style addressing (`https://host/bucket/key`) instead of bucket subdomains. SeaweedFS (the development S3) needs it.","type":"boolean"}},"required":["name","endpoint","region","bucket","access_key_id","secret_access_key"],"additionalProperties":false},"example":{"name":"hetzner-media","endpoint":"https://fsn1.your-objectstorage.com","region":"fsn1","bucket":"radioengine-media","access_key_id":"AKIAIOSFODNN7EXAMPLE","secret_access_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageConnection"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/storage-connections/{id}":{"patch":{"summary":"Update a storage connection","tags":["storage-connections"],"description":"Changes only the fields sent. Send `secret_access_key` to replace the stored secret; leave it out to keep it. Sources using the connection read from the new settings at their next scan. A name another connection has returns `409 name_taken`; an unknown id `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"endpoint":{"type":"string","maxLength":2048,"format":"uri","description":"The S3 endpoint, e.g. `https://fsn1.your-objectstorage.com`"},"region":{"type":"string","minLength":1,"maxLength":64},"bucket":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$","description":"3 to 63 lowercase letters, digits, dots and hyphens (S3 bucket naming rules)."},"access_key_id":{"type":"string","minLength":1,"maxLength":256},"secret_access_key":{"type":"string","minLength":1,"maxLength":1024,"description":"Write-only: stored encrypted and never returned."},"force_path_style":{"type":"boolean"}},"additionalProperties":false},"example":{"access_key_id":"AKIAI44QH8DHBEXAMPLE","secret_access_key":"je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY"}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageConnection"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a storage connection","tags":["storage-connections"],"description":"Deletes the connection and its stored credentials; the bucket is left as it is. Fails with `409 storage_connection_in_use` while sources use it: delete them or move them to another connection first. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/storage-connections/{id}/test":{"post":{"summary":"Test a storage connection","tags":["storage-connections"],"description":"Lists one object of the bucket (`ListObjectsV2` with max 1) with the stored credentials. Returns `{\"ok\": true}`, or `{\"ok\": false, \"error\": \"…\"}` with the reason. Waits at most 10 s. A failed test is still a 200; an unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageConnectionTest"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/storage-connections/{id}/prefixes":{"get":{"summary":"List a bucket's folders","tags":["storage-connections"],"description":"The folders directly under `prefix` in the connection's bucket (`''`, the default, for the bucket's top; otherwise a folder ending in `/`), for choosing a source's prefix level by level: `ListObjectsV2` with the delimiter `/`. Sorted by name, ignoring case; at most 1000, with `truncated` when there are more. The reserved `_radioengine/` at the top is left out. An error from the bucket (a wrong bucket name, refused credentials) is `422 storage_error` with the message the connection test gives; a bucket that can't be reached or doesn't answer within 10 s is `503 storage_unavailable`. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":"","type":"string","maxLength":1024},"in":"query","name":"prefix","required":false,"description":"`''` (the default) for the bucket's top, or a folder ending in `/`, e.g. `music/`"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoragePrefixes"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/sources":{"get":{"summary":"List sources","tags":["sources"],"description":"Every source, ordered by id, each with `media_counts`, its media items by status. Page with `next_cursor` until it is null. Station-restricted API keys see only the sources their stations use.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Source"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0c9-0000-7000-8000-000000000001","name":"Library","storage_connection_id":"0192f0d2-0000-7000-8000-000000000001","prefix":"music/","purpose":"library","default_kind":"music","scan_interval_seconds":3600,"auto_categories":true,"last_scanned_at":"2026-10-01T13:12:40.000Z","media_counts":{"pending":0,"analyzing":2,"ready":1240,"error":3,"missing":1,"deleted":5},"created_at":"2026-09-01T08:50:00.000Z","updated_at":"2026-09-01T08:50:00.000Z"},{"id":"0192f0c9-0000-7000-8000-000000000002","name":"Feeds","storage_connection_id":"0192f0d2-0000-7000-8000-000000000001","prefix":"feeds/","purpose":"feed","default_kind":"news","scan_interval_seconds":30,"auto_categories":false,"last_scanned_at":"2026-10-01T13:59:41.000Z","media_counts":{"pending":0,"analyzing":0,"ready":718,"error":0,"missing":0,"deleted":0},"created_at":"2026-09-01T08:52:00.000Z","updated_at":"2026-09-01T08:52:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a source","tags":["sources"],"description":"A prefix of a storage connection's bucket. The worker scans it at once, then every `scan_interval_seconds`: audio files (mp3, m4a, aac, flac, wav, ogg, opus) become media items of kind `default_kind`. Feed sources' files are analyzed on the priority queue. A station's categories pick from its media once the station lists the source (`PUT /v1/stations/{id}/sources`). With `auto_categories` (library sources only, `422` otherwise), every scan makes a shared category for each new folder at the top of the prefix. A name another source has returns `409 name_taken`; an unknown `storage_connection_id` `422 validation_failed`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"storage_connection_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prefix":{"default":"","type":"string","maxLength":1024,"description":"`''` for the whole bucket, or a prefix ending in `/`, e.g. `music/`"},"purpose":{"type":"string","enum":["library","feed"]},"default_kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"scan_interval_seconds":{"default":3600,"type":"integer","minimum":30,"maximum":31536000,"description":"How often the source is scanned, in seconds (at least 30)"},"auto_categories":{"default":false,"type":"boolean","description":"Make a shared category for each new folder at the top of the source, at every scan. Library sources only (`422` otherwise). Turning it on starts a scan."}},"required":["name","storage_connection_id","purpose","default_kind"],"additionalProperties":false},"example":{"name":"Library","storage_connection_id":"0192f0d2-0000-7000-8000-000000000001","prefix":"music/","purpose":"library","default_kind":"music","auto_categories":true}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/sources/{id}":{"get":{"summary":"Get a source","tags":["sources"],"description":"Includes `media_counts`, the source's media items by status. A station-restricted API key gets `403 station_forbidden` for a source none of its stations use; an unknown id returns `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a source","tags":["sources"],"description":"A new `scan_interval_seconds` applies from the worker's next check (within 15 s). Changing `prefix` or `storage_connection_id` starts a scan: items that aren't at the new location become `missing`. Turning `auto_categories` on starts a scan too, which makes the categories of the folders already there; it is for library sources only (`422` at `auto_categories`, also when `purpose` changes to `feed` while it is on). `purpose` can't change from `feed` while feeds use the source (`409 source_in_use`). A name another source has returns `409 name_taken`; an unknown `storage_connection_id` `422 validation_failed`; an unknown id `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"storage_connection_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prefix":{"type":"string","maxLength":1024,"description":"`''` for the whole bucket, or a prefix ending in `/`, e.g. `music/`"},"purpose":{"type":"string","enum":["library","feed"]},"default_kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"scan_interval_seconds":{"type":"integer","minimum":30,"maximum":31536000,"description":"How often the source is scanned, in seconds (at least 30)"},"auto_categories":{"type":"boolean","description":"Make a shared category for each new folder at the top of the source, at every scan. Library sources only (`422` otherwise). Turning it on starts a scan."}},"additionalProperties":false},"examples":{"example1":{"value":{"scan_interval_seconds":900}},"example2":{"value":{"auto_categories":true}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Source"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a source","tags":["sources"],"description":"Deletes the source and its media items (the files in the bucket stay). Fails with `409 source_in_use` while a feed uses the source, or while its media items are still referenced: by the log (log items are kept for 7 days), a clock slot, a feed or a feed item. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/sources/{id}/folders":{"get":{"summary":"List a source's folders","tags":["sources"],"description":"The subfolders of `path` (`''`, the default, for the source's root): the folders that its media items' keys share below the source's prefix, as the files lie in the bucket. Each has `item_count`, its media items and those of its subfolders, deleted ones left out; a folder with only deleted items isn't listed. Sorted by name, ignoring case. `q` keeps the names that contain it. Page with `next_cursor`. Open a folder's items with `GET /v1/media?source_id=&folder=`. A station-restricted API key gets `403 station_forbidden` for a source none of its stations use; an unknown id returns `404 not_found`.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":"","type":"string"},"in":"query","name":"path","required":false,"description":"A folder below the source's prefix: `''` for its root, or a path ending in `/`, e.g. `import/Rock/`"},{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false,"description":"Only folders whose name contains this text, ignoring case"},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":4096},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page, with the same `path` and `q`"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SourceFolder"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"name":"Jazz","path":"import/Jazz/","item_count":412,"has_subfolders":true},{"name":"Rock","path":"import/Rock/","item_count":1824,"has_subfolders":true}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/sources/{id}/scan":{"post":{"summary":"Scan a source now","tags":["sources"],"description":"Enqueues a `source-scan` job and returns at once. When the scan completes, a `source.scanned` event reports what it added, updated and marked missing. If a scan of the source is already running, this one runs after it; if one is already queued, `job_id` is null. A station-restricted API key may scan only the sources its stations use (`403 station_forbidden` otherwise). An unknown id returns `404 not_found`.\n\nRequires the `content:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanQueued"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media":{"get":{"summary":"List and search media","tags":["media"],"description":"Every filter must match. `q` searches title, artist and album with trigrams (similar words, or contained text); results are then sorted by relevance, with an exact artist match first. Repeat `tag` for items with all of the tags; repeat `kind` or `status` for items with any of them. Deleted items are left out unless `status` asks for them. `station_id`: the items of the station's sources. `s3_key` (exact) needs `source_id`, as does `folder`: the items in a folder of the source and in its subfolders. `has_video=true` keeps only video items, `false` only audio items. `sort`: `relevance` (the default with `q`), `title`, `artist`, `album`, `year`, `duration_ms`, `created_at` (the default otherwise) or `updated_at`; `-` sorts descending, text ignores case, and empty values come last. Page with `next_cursor`, keeping the filters and sort. Station-restricted API keys see only the items of their stations' sources. `sort=relevance` without `q`, and `s3_key` or `folder` without `source_id`, are 422. With `count=true` the page also has `count`, how many items match the filters in all (at most 10,000), and `count_capped`, true when more match.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false,"description":"Search title, artist and album (trigram similarity, or contained). Sorted by relevance unless `sort` is given: an exact artist match first."},{"schema":{"anyOf":[{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}}]},"in":"query","name":"kind","required":false,"description":"Repeat for several kinds: items of any of them"},{"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}}]},"in":"query","name":"tag","required":false,"description":"Repeat for several tags: items with all of them"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"source_id","required":false},{"schema":{"anyOf":[{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]}}]},"in":"query","name":"status","required":false,"description":"Repeat for several statuses: items in any of them. Default: every status but `deleted`"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"station_id","required":false,"description":"Items that the station can use: those of its sources"},{"schema":{"type":"string","minLength":1,"maxLength":1024},"in":"query","name":"s3_key","required":false,"description":"Exact object key. Needs `source_id`."},{"schema":{"type":"string"},"in":"query","name":"folder","required":false,"description":"Items in this folder of the source and in its subfolders: `''` for the source's root, or a path below its prefix ending in `/`, e.g. `import/Rock/` (see `GET /v1/sources/{id}/folders`). Needs `source_id`."},{"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]},"in":"query","name":"has_video","required":false,"description":"`true`: only video items (`has_video`); `false`: only audio items. Default: both."},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"count","required":false,"description":"`true`: also return `count`, the number of items that match the filters (up to 10,000), and `count_capped`."},{"schema":{"type":"string","enum":["relevance","title","-title","artist","-artist","album","-album","year","-year","duration_ms","-duration_ms","created_at","-created_at","updated_at","-updated_at"]},"in":"query","name":"sort","required":false,"description":"`-` sorts descending. Default: `relevance` with `q`, otherwise `created_at`. Text sorts ignore case and put empty values last."},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":16384},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page, with the same filters and sort"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MediaItem"}},"next_cursor":{"type":["string","null"]},"count":{"description":"With `count=true`: how many items match the filters (the whole result, not this page), at most 10,000.","type":"integer","minimum":0,"maximum":9007199254740991},"count_capped":{"description":"With `count=true`: true when more than 10,000 items match, so `count` stopped there.","type":"boolean"}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0c1-0000-7000-8000-000000000001","source_id":"0192f0c9-0000-7000-8000-000000000001","s3_key":"music/the-sine-waves/highway-static.mp3","etag":"5d41402abc4b2a76b9719d911017c592","size_bytes":8574216,"kind":"music","status":"ready","error":null,"title":"Highway Static","artist":"The Sine Waves","album":"Pure Tones","year":1999,"genre":"Rock","isrc":"DEA629900017","duration_ms":214000,"codec":"mp3","sample_rate":44100,"channels":2,"bitrate_kbps":320,"loudness_lufs":-9.6,"true_peak_dbtp":-0.4,"cue_in_ms":120,"cue_out_ms":212500,"mix_out_ms":208000,"peaks_key":"_radioengine/peaks/0192f0c1-0000-7000-8000-000000000001.json","analyzed_at":"2026-09-01T09:12:31.000Z","cue_in_override_ms":null,"cue_out_override_ms":null,"mix_out_override_ms":null,"gain_override_db":null,"intro_ms":18400,"has_video":false,"video_width":null,"video_height":null,"video_frame_rate":null,"video_codec":null,"video_key":null,"video_etag":null,"video_size_bytes":null,"effective":{"cue_in_ms":120,"cue_out_ms":212500,"mix_out_ms":208000},"tags":[{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z"}],"created_at":"2026-09-01T09:10:02.000Z","updated_at":"2026-09-01T09:12:31.000Z"},{"id":"0192f0c1-0000-7000-8000-000000000002","source_id":"0192f0c9-0000-7000-8000-000000000001","s3_key":"music/Mötley Tönes - Night Drive.mp3","etag":"7d793037a0760186574b0282f2f435e7","size_bytes":7340032,"kind":"music","status":"ready","error":null,"title":"Night Drive","artist":"Mötley Tönes","album":"Ünïcode Sessions","year":2016,"genre":"Rock","isrc":null,"duration_ms":183480,"codec":"mp3","sample_rate":44100,"channels":2,"bitrate_kbps":320,"loudness_lufs":-8.9,"true_peak_dbtp":-0.1,"cue_in_ms":0,"cue_out_ms":182900,"mix_out_ms":176400,"peaks_key":"_radioengine/peaks/0192f0c1-0000-7000-8000-000000000002.json","analyzed_at":"2026-10-01T14:00:41.000Z","cue_in_override_ms":null,"cue_out_override_ms":null,"mix_out_override_ms":178000,"gain_override_db":null,"intro_ms":null,"has_video":false,"video_width":null,"video_height":null,"video_frame_rate":null,"video_codec":null,"video_key":null,"video_etag":null,"video_size_bytes":null,"effective":{"cue_in_ms":0,"cue_out_ms":182900,"mix_out_ms":178000},"tags":[{"id":"0192f0d3-0000-7000-8000-000000000002","name":"chill","color":"#0891b2","created_at":"2026-09-01T09:05:00.000Z"},{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z"}],"created_at":"2026-10-01T14:00:00.000Z","updated_at":"2026-10-01T14:03:12.000Z"}],"next_cursor":"eyJzIjoiY3JlYXRlZF9hdCIsInYiOlsiMjAyNi0xMC0wMVQxNDowMDowMC4wMDBaIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwMDAwMDAyIl19","count":1243,"count_capped":false}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/{id}":{"get":{"summary":"Get a media item","tags":["media"],"description":"Includes its tags and its `effective` cue points. `403 station_forbidden` for a station-restricted API key whose stations don't use the item's source.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaItem"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a media item","tags":["media"],"description":"Descriptive fields, `kind`, the manual overrides (null clears one), the intro marker `intro_ms` (where the vocals start; null clears it) and `tags` (names; replaces the item's tags, creating missing ones). Fields left out keep their values. With the changes applied, cue overrides must lie within the file, cue in before cue out, and mix out and the intro marker between them (422 at the field otherwise). A video item's `cue_in_override_ms` must be a whole second, where its picture has a keyframe (422 at `cue_in_override_ms` otherwise). Stations pick up the change at their next planning run.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"artist":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"album":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"year":{"anyOf":[{"type":"integer","minimum":0,"maximum":9999},{"type":"null"}]},"genre":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"isrc":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"cue_in_override_ms":{"description":"Wins over the analysed cue in. Null clears it.","anyOf":[{"type":"integer","minimum":0,"maximum":86400000},{"type":"null"}]},"cue_out_override_ms":{"description":"Wins over the analysed cue out. Null clears it.","anyOf":[{"type":"integer","minimum":0,"maximum":86400000},{"type":"null"}]},"mix_out_override_ms":{"description":"Wins over the analysed mix out. Null clears it.","anyOf":[{"type":"integer","minimum":0,"maximum":86400000},{"type":"null"}]},"gain_override_db":{"description":"Playback gain on every station instead of loudness normalization. Null clears it.","anyOf":[{"type":"number","minimum":-60,"maximum":24},{"type":"null"}]},"intro_ms":{"description":"The intro marker: where the song's vocals start. Must lie between the effective cue in and cue out. Null clears it.","anyOf":[{"type":"integer","minimum":0,"maximum":86400000},{"type":"null"}]},"tags":{"description":"The item's tags, by name: replaces its tags. Missing tags are created.","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}}},"additionalProperties":false},"examples":{"example":{"value":{"genre":"Classic Rock","mix_out_override_ms":207000,"tags":["rock","driving"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaItem"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a media item","tags":["media"],"description":"Soft delete: the item's status becomes `deleted`, and scans leave its file alone (a different file at its key is a new item). With `delete_object=true`, the file, its waveform peaks and a video item's mezzanine are also deleted from the bucket, and the item gives its key back (database.md `media_items.s3_key`), so a new file can have that name. Deleting a deleted item again succeeds (and deletes the file if asked).\n\nRequires the `content:write` scope.","parameters":[{"schema":{"default":"false","type":"string","enum":["true","false"]},"in":"query","name":"delete_object","required":false,"description":"Also delete the file (and its waveform peaks) from the bucket"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/{id}/reanalyze":{"post":{"summary":"Analyze a media item again","tags":["media"],"description":"Sets the item `pending` and enqueues its analysis (on the priority queue for feed sources); `media.ready` or `media.failed` follows. A video item is transcoded again. Descriptive fields that are set are kept. `409 media_deleted` for a deleted item.\n\nRequires the `content:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAnalysisQueued"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/{id}/audio":{"get":{"summary":"Get a media item's audio","tags":["media"],"description":"Redirects (302) to a presigned GET URL of the item's playout file, valid for 1 h: a video item's mezzanine (an MP4 that `<audio>` plays as sound), else the item's own file. The URL is not cached. `404 not_found` for a video item that isn't transcoded yet.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"302":{"description":"Redirect: the `Location` header is the presigned URL"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/{id}/video":{"get":{"summary":"Get a media item's video","tags":["media"],"description":"Redirects (302) to a presigned GET URL of a video item's mezzanine (1080p, 25 fps, H.264 and AAC in an MP4), valid for 1 h, for a `<video>` preview. The URL is not cached. `404 not_found` when the item has no mezzanine: it isn't a video item, or isn't transcoded yet.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"302":{"description":"Redirect: the `Location` header is the presigned URL"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/{id}/peaks":{"get":{"summary":"Get a media item's waveform peaks","tags":["media"],"description":"The peaks JSON that analysis stored in the bucket, served by the API (so browsers need no access to the bucket): at most 1000 points in 0..1, normalized so the loudest is 1. 404 when the item has none (not analyzed yet); `502 peaks_invalid` when the stored JSON is not valid peaks.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPeaks"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/bulk":{"post":{"summary":"Change many media items","tags":["media"],"description":"Selects items by `ids`, or by `filter` (the filters of `GET /v1/media`), and applies `set_kind`, `add_tags` (creating missing tags), `remove_tags` and `set_mix_out_before_end_ms` (a segue point that long before each item's end, or null to clear it), in one transaction. Returns how many items were selected. Give exactly one of `ids` and `filter`, and at least one change; a tag can't be in both `add_tags` and `remove_tags` (422 otherwise). Station-restricted API keys can only select their stations' items.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"description":"The items to change","minItems":1,"maxItems":10000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"filter":{"description":"Or: the items that match these filters, as `GET /v1/media` selects them","type":"object","properties":{"q":{"type":"string","maxLength":200,"description":"Search title, artist and album (trigram similarity, or contained). Sorted by relevance unless `sort` is given: an exact artist match first."},"kind":{"description":"Repeat for several kinds: items of any of them","anyOf":[{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]}}]},"tag":{"description":"Repeat for several tags: items with all of them","anyOf":[{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}}]},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"description":"Repeat for several statuses: items in any of them. Default: every status but `deleted`","anyOf":[{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]},{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","enum":["pending","analyzing","ready","error","missing","deleted"]}}]},"station_id":{"description":"Items that the station can use: those of its sources","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"s3_key":{"description":"Exact object key. Needs `source_id`.","type":"string","minLength":1,"maxLength":1024},"folder":{"description":"Items in this folder of the source and in its subfolders: `''` for the source's root, or a path below its prefix ending in `/`, e.g. `import/Rock/` (see `GET /v1/sources/{id}/folders`). Needs `source_id`.","type":"string"},"has_video":{"description":"`true`: only video items (`has_video`); `false`: only audio items. Default: both.","anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]}},"additionalProperties":false},"set_kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"add_tags":{"description":"Tag names; missing tags are created","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}},"remove_tags":{"description":"Tag names","maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"}},"set_mix_out_before_end_ms":{"description":"Sets each item's segue point (`mix_out_override_ms`) this long before its end: its effective cue out minus this, never before its effective cue in, so the next item starts that long before it ends. Items without a known length are left as they are. `null` clears the override.","anyOf":[{"type":"integer","minimum":0,"maximum":30000},{"type":"null"}]}},"additionalProperties":false},"examples":{"example1":{"value":{"ids":["0192f0c1-0000-7000-8000-000000000001","0192f0c1-0000-7000-8000-000000000002"],"add_tags":["rock"]}},"example2":{"value":{"filter":{"source_id":"0192f0c9-0000-7000-8000-000000000001","folder":"Imaging/Summer 2026/"},"set_kind":"jingle","set_mix_out_before_end_ms":2000}},"example3":{"value":{"filter":{"source_id":"0192f0c9-0000-7000-8000-000000000001","q":"Mötley Tönes","kind":"music"},"add_tags":["rock"],"remove_tags":["chill"]}}}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaBulkResult"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/uploads":{"post":{"summary":"Start an upload","tags":["media"],"description":"Creates a `pending` media item and returns a presigned PUT URL for its file, valid for 1 h. The file goes to `s3_key` when given (e.g. a folder of the source), otherwise to the top of the source with its own name, `<source prefix><filename>` (characters S3 tools handle badly become `_`). PUT the file there with exactly the returned headers (the content type and length are signed; browsers leave out `content-length`), then call `POST /v1/media/uploads/{media_item_id}/complete`. The filename must end in an audio extension (mp3, m4a, aac, flac, wav, ogg, opus) or a video extension (mp4, m4v, mov, mkv, webm, avi, mpg, mpeg), and `source_id` must name an existing source (422 otherwise). Whether a file is a video item is decided by its analysis, not by its name; a video item is transcoded to its mezzanine before it is `ready`. Asking again for a key whose item is still waiting for its file returns a new URL for the same item; a key that a deleted item had becomes the new upload's; a key that another item holds gives `409 key_taken`. Station-restricted API keys can upload only to their stations' sources.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string","minLength":1,"maxLength":1024,"description":"Must end in an audio extension (mp3, m4a, aac, flac, wav, ogg, opus) or a video extension (mp4, m4v, mov, mkv, webm, avi, mpg, mpeg). Without `s3_key`, the file is stored under this name at the top of the source (characters S3 tools handle badly become `_`)."},"size_bytes":{"type":"integer","minimum":1,"maximum":5368709120,"description":"The exact size of the file"},"content_type":{"type":"string","maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*\\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]*$","description":"Sent with the upload exactly as given, e.g. `audio/mpeg` or `video/mp4`"},"kind":{"description":"Default: the source's `default_kind`","type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"s3_key":{"description":"Store the file at this key instead of `<prefix><filename>`, e.g. in a folder: the source's prefix followed by a file path without empty, `.` or `..` segments or backslashes, not under `_radioengine/`, ending in an audio or video extension. If an item of the source already has the key and is still waiting for its file (an upload that wasn't completed, or status `missing`), that item gets a new URL; a deleted item gives the key to the new upload; any other item there gives `409 key_taken`.","type":"string","minLength":1,"maxLength":1024}},"required":["source_id","filename","size_bytes","content_type"],"additionalProperties":false},"example":{"source_id":"0192f0c9-0000-7000-8000-000000000001","filename":"Mötley Tönes - Night Drive.mp3","size_bytes":7340032,"content_type":"audio/mpeg","kind":"music"}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUpload"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/uploads/{media_item_id}/complete":{"post":{"summary":"Complete an upload","tags":["media"],"description":"Checks that the file exists (`409 upload_missing` otherwise), stores its ETag and size, and enqueues its analysis; `media.ready` or `media.failed` follows. Returns the media item, `pending` until its analysis ends. If a scan of the source registered the file first, returns the item as it is. `409 upload_not_pending` when the item was deleted, or has since become another file.\n\nRequires the `content:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"media_item_id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaItem"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/{id}/usage":{"get":{"summary":"Where a media item is used","tags":["media"],"description":"The static categories that list the item, the media slots of clocks that play it, the feeds whose fallback it is, its planned log items that haven't started (with the earliest), and its plays (with the last). Using an item never blocks editing or deleting it. Station-restricted API keys see their stations' categories (and shared ones), clocks, log items and plays, and get `403 station_forbidden` for an item of another station's sources.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUsage"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/media/matches":{"post":{"summary":"Where media will play","tags":["media"],"description":"For up to 500 media items (`422 list_too_large` above): the categories that hold some of them, with how many, and the stations that use each category. A static category holds the items it lists; a filter category holds the items that match it for a station, from that station's sources only (a station's own category for that station; a shared one for each station that uses it). A station uses a category through a slot of its clocks, a window's padding, its fallback or filler, or its pad; for a filter category only the stations that see the items are listed. `unmatched` counts the items in no listed category. Deleted and unknown items are ignored. Nothing is written, so the `read` scope is enough. Station-restricted API keys see only their stations (and their categories and the shared ones), and get `403 station_forbidden` for items of other stations' sources.\n\nRequires the `read` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The media items, at most 500 (`422 list_too_large`). Repeated ids count once; unknown and deleted items are ignored."}},"required":["ids"],"additionalProperties":false},"example":{"ids":["0192f0c1-0000-7000-8000-000000000001","0192f0c1-0000-7000-8000-000000000002","0192f0c1-0000-7000-8000-000000000003"]}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaMatches"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/tags":{"get":{"summary":"List tags","tags":["tags"],"description":"Every tag, sorted by name, with `media_count`: how many media items have it (deleted ones left out). Tags are shared by all stations, so station-restricted API keys see them all, with counts over every station's media.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":1024},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TagWithCount"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d3-0000-7000-8000-000000000002","name":"chill","color":"#0891b2","created_at":"2026-09-01T09:05:00.000Z","media_count":4},{"id":"0192f0d3-0000-7000-8000-000000000003","name":"ident","color":"#ca8a04","created_at":"2026-09-01T09:05:00.000Z","media_count":2},{"id":"0192f0d3-0000-7000-8000-000000000001","name":"rock","color":"#dc2626","created_at":"2026-09-01T09:05:00.000Z","media_count":9}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a tag","tags":["tags"],"description":"Names are trimmed and lowercased. `409 name_taken` if the tag exists. Tags are also created when a media item is tagged with a new name.\n\nRequires the `content:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A tag name, 1 to 100 characters, matched case-insensitively"},"color":{"description":"A hex color such as `#16a34a`","anyOf":[{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"example":{"name":"rock","color":"#dc2626"}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/tags/{id}":{"patch":{"summary":"Update a tag","tags":["tags"],"description":"Renames the tag on every media item that has it. Category filters (`tags_all`, `tags_any`, `tags_none`) and daypart rules (`tags_any`) refer to tags by name: a rename rewrites them in the same transaction, so they keep their members and their effect, and re-plans the stations concerned (`programming.changed` is published). Names are trimmed and lowercased. `409 name_taken` if another tag has the name.\n\nRequires the `content:write` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Category filters (`tags_all`, `tags_any`, `tags_none`) and daypart rules (`tags_any`) that name the old name are rewritten to the new one","type":"string","minLength":1,"maxLength":100},"color":{"description":"A hex color such as `#16a34a`; null clears it","anyOf":[{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"},{"type":"null"}]}},"additionalProperties":false},"example":{"color":"#dc2626"}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a tag","tags":["tags"],"description":"Removes the tag from every media item. Category filters and daypart rules that name it keep the name (a filter whose `tags_all` names it then matches nothing).\n\nRequires the `content:write` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/feeds":{"get":{"summary":"List feeds","tags":["feeds"],"description":"Every feed, ordered by id. Feeds aren't tied to stations, so station-restricted API keys see them all.\n\nRequires the `read` scope.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Feed"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0c5-0000-7000-8000-000000000001","slug":"news-hourly","name":"News (hourly)","source_id":"0192f0c9-0000-7000-8000-000000000002","watch_prefix":false,"default_kind":"news","default_ttl_minutes":60,"on_missing":"skip","fallback_media_item_id":null,"reuse_grace_minutes":0,"expected_interval_minutes":60,"alert_lead_minutes":5,"created_at":"2026-09-01T09:00:00.000Z","updated_at":"2026-09-01T09:00:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a feed","tags":["feeds"],"description":"A feed of fresh content (news, weather) that clock slots play. Its files live in a source with purpose `feed`, under `<source prefix><slug>/`. With `watch_prefix`, every new object there becomes a feed item when the source is scanned, and a scan is queued at once.\n\nGive the source as `source_id` (a source with purpose `feed`), or give `storage_connection_id` instead: the feed then uses that connection's source with purpose `feed` and prefix `feeds/`, which is created in the same transaction when there is none, as `POST /v1/sources` would create it: named `Feeds`, or `Feeds · <connection name>` when another source has that name, `default_kind` `news`, scanned at once. The response's `source_id` is the source used.\n\nErrors: `422` at `source_id` when neither is given, at `storage_connection_id` when both are, for an unknown connection, for a source without purpose `feed`, and at `fallback_media_item_id` for an unknown or deleted media item; `409 slug_taken` for a duplicate slug (slugs can't look like UUIDs either); `409 name_taken` when other sources already have both names a new feed source would take.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$","description":"Lowercase letters, digits and `-`, 2 to 63 characters. It names the watched prefix and the upload folder."},"name":{"type":"string","minLength":1,"maxLength":200},"source_id":{"description":"A source with purpose `feed`. Give this or `storage_connection_id`, not both.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"storage_connection_id":{"description":"Instead of `source_id`: the feed uses this connection's source with purpose `feed` and prefix `feeds/`, created when there is none (named `Feeds`, or `Feeds · <connection name>` when another source has that name; `default_kind` `news`), as `POST /v1/sources` creates a source.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"watch_prefix":{"default":false,"type":"boolean"},"default_kind":{"default":"news","type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"default_ttl_minutes":{"default":60,"type":"integer","minimum":1,"maximum":527040},"on_missing":{"default":"skip","type":"string","enum":["skip","fallback","reuse_previous"]},"fallback_media_item_id":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reuse_grace_minutes":{"default":0,"type":"integer","minimum":0,"maximum":10080},"expected_interval_minutes":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":44640},{"type":"null"}]},"alert_lead_minutes":{"default":5,"type":"integer","minimum":0,"maximum":1440}},"required":["slug","name"],"additionalProperties":false},"examples":{"example1":{"value":{"slug":"news-hourly","name":"News (hourly)","source_id":"0192f0c9-0000-7000-8000-000000000002","default_kind":"news","default_ttl_minutes":60,"on_missing":"skip","expected_interval_minutes":60}},"example2":{"value":{"slug":"traffic","name":"Traffic","storage_connection_id":"0192f0d2-0000-7000-8000-000000000001","default_kind":"news","default_ttl_minutes":30,"expected_interval_minutes":30}}}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/feeds/{id}":{"get":{"summary":"Get a feed","tags":["feeds"],"description":"`:id` is the feed's uuid or slug.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The feed's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a feed","tags":["feeds"],"description":"Changing the slug moves the watched prefix and the folder of later uploads; existing files stay where they are. Turning `watch_prefix` on, or changing the slug or source of a watched feed, queues a scan of the source. A new `fallback_media_item_id` is hinted to the nodes that play the feed. The same 422s as on create; duplicate slugs return `409 slug_taken`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$","description":"Lowercase letters, digits and `-`, 2 to 63 characters. It names the watched prefix and the upload folder."},"name":{"type":"string","minLength":1,"maxLength":200},"source_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"watch_prefix":{"type":"boolean"},"default_kind":{"type":"string","enum":["music","jingle","station_id","sweeper","spot","bed","news","traffic","weather","other"]},"default_ttl_minutes":{"type":"integer","minimum":1,"maximum":527040},"on_missing":{"type":"string","enum":["skip","fallback","reuse_previous"]},"fallback_media_item_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reuse_grace_minutes":{"type":"integer","minimum":0,"maximum":10080},"expected_interval_minutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":44640},{"type":"null"}]},"alert_lead_minutes":{"type":"integer","minimum":0,"maximum":1440}},"additionalProperties":false},"example":{"on_missing":"reuse_previous","reuse_grace_minutes":30}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The feed's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feed"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a feed","tags":["feeds"],"description":"Deletes the feed and its items; their media items and files stay. Fails with `409 feed_in_use` while a clock slot uses the feed, or log items (kept for 7 days) play it or one of its items.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The feed's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/feeds/{id}/status":{"get":{"summary":"Feed status","tags":["feeds"],"description":"For each station that uses the feed (a clock slot or an upcoming log item names it): the item it would play now, its age and expiry, the next planned feed slot, and when the next item is due (`expected_interval_minutes` after the newest one). For each node of those stations that are active: whether it holds their current items, from its `feed.synced` and sync reports. Station-restricted API keys see their stations only.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The feed's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedStatus"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/feeds/{id}/items":{"post":{"summary":"Create a feed item","tags":["feeds"],"description":"Either a multipart form with the audio or video `file` (mp3, m4a, aac, flac, wav, ogg, opus, mp4, m4v, mov, mkv, webm, avi, mpg or mpeg, else 422; at most `FEED_UPLOAD_MAX_BYTES`, 200 MB by default, else `413 payload_too_large`) and the optional fields, or JSON with an existing `media_item_id` (`pending`, `analyzing` or `ready`). An uploaded file is stored at `<source prefix><slug>/<yyyy>/<mm>/<dd>/<media item id>.<ext>` as a `pending` media item of the feed's `default_kind`, and analyzed on the priority queue. As soon as the media is ready, the item is hinted (`sync.hint`) to the nodes of the active stations that use the feed and that it targets, and `feed_item.created` is published. A video file is transcoded to its mezzanine first, so it takes minutes, not seconds, to reach the nodes. `station_ids` must name stations that use the feed, and `expires_at` must be after `valid_from` (422 otherwise). A station-restricted API key may only target its own stations (403). A body that is neither JSON nor a form is 415. An upload to S3 that makes no progress for 30 s is `503 storage_unavailable`, with `Retry-After`. Supports `Idempotency-Key`: for a form, the request hash covers the fields and the file's SHA-256.\n\nRequires the `feeds:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A media item that is `pending`, `analyzing` or `ready`"},"valid_from":{"description":"When the item may start airing. Default: now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expires_at":{"description":"When it stops airing; after `valid_from`. Default: `valid_from` + the feed's `default_ttl_minutes`.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"station_ids":{"anyOf":[{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Stations that play the item, each using the feed. Null or absent: all of them."},{"type":"null"}]}},"required":["media_item_id"],"additionalProperties":false,"description":"Makes an existing media item a feed item."},"example":{"media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30Z","expires_at":"2026-10-01T16:20:00+02:00"}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The audio or video file: mp3, m4a, aac, flac, wav, ogg, opus, mp4, m4v, mov, mkv, webm, avi, mpg or mpeg. A video item is transcoded to its mezzanine before it is `ready`, which takes minutes."},"valid_from":{"description":"When the item may start airing. Default: now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expires_at":{"description":"When it stops airing; after `valid_from`. Default: `valid_from` + the feed's `default_ttl_minutes`.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"station_ids":{"description":"Repeat the field for several stations, or send a comma-separated list or a JSON array","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["file"],"additionalProperties":false,"description":"Uploads a new file as a feed item: the `file` part, plus the other fields as text parts. `valid_from` and `expires_at` may be sent once each."}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The feed's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedItemCreated"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"get":{"summary":"List a feed's items","tags":["feeds"],"description":"Newest first (by `valid_from`, then id), with their media. `active=true` lists the items that aren't withdrawn or expired: the current and upcoming ones. Station-restricted API keys see the items meant for their stations.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"active","required":false,"description":"`true`: only items that aren't withdrawn or expired (current and upcoming). `false`: only withdrawn or expired ones. Absent: all."},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page"},{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"path","name":"id","required":true,"description":"The feed's id (uuid) or slug"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedItemWithMedia"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0c6-0000-7000-8000-000000000001","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000b","valid_from":"2026-10-01T13:59:30.000Z","expires_at":"2026-10-01T14:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T13:58:47.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000b","status":"ready","kind":"news","title":"News 14:00","artist":null,"duration_ms":62000}},{"id":"0192f0c6-0000-7000-8000-000000000002","feed_id":"0192f0c5-0000-7000-8000-000000000001","media_item_id":"0192f0c1-0000-7000-8000-00000000000c","valid_from":"2026-10-01T12:59:30.000Z","expires_at":"2026-10-01T13:20:00.000Z","station_ids":null,"created_via":"api","created_by":"key:0192f0d1-0000-7000-8000-000000000001","withdrawn_at":null,"created_at":"2026-10-01T12:58:52.000Z","media":{"id":"0192f0c1-0000-7000-8000-00000000000c","status":"ready","kind":"news","title":"News 13:00","artist":null,"duration_ms":60400}}],"next_cursor":"MjAyNi0xMC0wMVQxMjo1OTozMC4wMDBafDAxOTJmMGM2LTAwMDAtNzAwMC04MDAwLTAwMDAwMDAwMDAwMg"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/feed-items/{id}":{"patch":{"summary":"Change a feed item's validity window","tags":["feeds"],"description":"Changes `valid_from` and `expires_at`, the fields sent (times may carry an offset, which is converted to UTC); `expires_at` must stay after `valid_from`. The nodes that hold the item are told at once (`sync.hint`), since their feed indexes carry the window, and the active stations that use the feed re-plan. A station-restricted API key may only change items meant for its stations alone (403 otherwise). Returns the item.\n\nErrors: `404 not_found`; `409 feed_item_withdrawn` for a withdrawn item; `422 validation_failed` on `expires_at` when it isn't after `valid_from`.\n\nRequires the `feeds:write` scope.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"valid_from":{"description":"When the item may start airing. An offset such as `+02:00` is converted to UTC.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expires_at":{"description":"When it stops airing; after `valid_from` (the new one, or the item's).","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"additionalProperties":false},"examples":{"example1":{"value":{"expires_at":"2026-10-01T16:20:00+02:00"}},"example2":{"value":{"valid_from":"2026-10-01T14:00:00Z","expires_at":"2026-10-01T15:00:00Z"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedItem"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Withdraw a feed item","tags":["feeds"],"description":"Sets `withdrawn_at`: the item never airs after that. Publishes `feed_item.withdrawn` and sends a `sync.hint` to the nodes that play it, so their agents rebuild their feed indexes. Withdrawing an item again changes nothing. A station-restricted API key may only withdraw items meant for its stations alone (403 otherwise).\n\nRequires the `feeds:write` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Withdrawn"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/nodes":{"get":{"summary":"List nodes","tags":["nodes"],"description":"Every node, ordered by id, with its status, last heartbeat and media counts (`media`: how many media items its active stations need, how many it holds in their current version, and how many are missing). Page with `next_cursor` until it is null. Tokens are never returned.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Node"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0cf-0000-7000-8000-000000000001","name":"stream1","public_base_url":"https://stream1.example.com","status":"online","hostname":"stream1.example.com","version":"0.1.0","last_heartbeat_at":"2026-10-01T13:59:58.201Z","info":{"disk_free_bytes":828091625472,"disk_total_bytes":1995165736960,"mem_free_bytes":2147483648,"load_avg":[0.42,0.37,0.31],"stations":[{"station_id":"0192f0c4-0000-7000-8000-000000000001","state":"running","since":"2026-10-01T06:00:04.118Z"}],"sync":{"pending_items":0,"pending_bytes":0,"failed_items":0}},"media":{"required":1312,"held":1113,"missing":199},"created_at":"2026-09-01T08:45:00.000Z","updated_at":"2026-10-01T13:59:58.201Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a node","tags":["nodes"],"description":"Registers a stream server. Returns the node's token (`ren_…`) for its `node.env`. It is shown only once; only its hash is stored. The node stays `offline` until its agent connects with the token. A name another node has returns `409 name_taken`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Unique among nodes."},"public_base_url":{"description":"Where listeners reach the node's streams: an http(s) URL, stored without a trailing slash. Stream URLs are `<public_base_url>/<mount>` and `<public_base_url>/hls/<slug>/master.m3u8`.","type":"string","format":"uri"}},"required":["name","public_base_url"],"additionalProperties":false},"examples":{"example":{"value":{"name":"stream1","public_base_url":"https://stream1.example.com"}}}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeWithToken"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/nodes/{id}":{"get":{"summary":"Get a node","tags":["nodes"],"description":"The node as `GET /v1/nodes` lists it: its status, last heartbeat (`info`) and media counts. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Node"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"patch":{"summary":"Update a node","tags":["nodes"],"description":"Renames the node or changes its `public_base_url`; the fields left out keep their value. The `public_urls` of its stations follow the new base URL. A name another node has returns `409 name_taken`; an unknown id `404 not_found`. The token doesn't change: use `rotate-token`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Unique among nodes."},"public_base_url":{"description":"Where listeners reach the node's streams: an http(s) URL, stored without a trailing slash. Stream URLs are `<public_base_url>/<mount>` and `<public_base_url>/hls/<slug>/master.m3u8`.","type":"string","format":"uri"}},"additionalProperties":false},"examples":{"example":{"value":{"public_base_url":"https://stream1.example.com"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Node"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a node","tags":["nodes"],"description":"Returns `409 node_in_use` while stations are assigned to it: move them to another node or delete them first. Its engine connections are closed, and its token stops working. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/nodes/{id}/rotate-token":{"post":{"summary":"Rotate a node's token","tags":["nodes"],"description":"Issues a new token, shown only once. The old token stops working at once, and the node's open engine connections are closed with 4401: the node reconnects once `RADIOENGINE_NODE_TOKEN` in its `node.env` holds the new token. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeToken"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/nodes/{id}/sync":{"post":{"summary":"Sync a node's media now","tags":["nodes"],"description":"Asks the node's agent to walk its whole manifest now (`sync.full`), as it does at startup: it fetches every required media item it doesn't hold in its current version, and `media.missing` falls as it reports them. Agents also walk when their stations change and every hour, and fetch new media as soon as it is required (`sync.hint`); this is for when a node seems behind. Returns 202 at once; the walk runs in the background, one at a time. An unknown id returns `404 not_found`; `409 node_offline` when its agent isn't connected (the node's `status` is `offline`), since it couldn't hear the request.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeSyncRequested"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/alerts":{"get":{"summary":"List alerts","tags":["alerts"],"description":"Newest first, or with `order=severity` critical, then warning, then info, newest first within each. Page with `next_cursor` until it is null; a cursor works only with the order it came from (422 on `cursor` otherwise). Station-restricted API keys see their stations' alerts and alerts without a station; asking for another station returns `403 station_forbidden`. Kinds, severities and when each opens and resolves: api.md §Alerts.\n\nRequires the `read` scope.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"open","required":false,"description":"`true`: only open alerts (not resolved). `false`: only resolved ones. Absent: both."},{"schema":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}]},"in":"query","name":"station_id","required":false,"description":"Only alerts of these stations (repeat the parameter for several, up to 100). Alerts without a station are then left out."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"node_id","required":false,"description":"Only alerts about this node"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"feed_id","required":false,"description":"Only alerts about this feed"},{"schema":{"type":"string"},"in":"query","name":"kind","required":false,"description":"Comma-separated alert kinds, e.g. `feed.late,node.offline`"},{"schema":{"type":"string"},"in":"query","name":"severity","required":false,"description":"Comma-separated severities: `info`, `warning`, `critical`"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"acknowledged","required":false,"description":"`true`: only acknowledged alerts. `false`: only unacknowledged ones. Absent: both."},{"schema":{"default":"newest","type":"string","enum":["newest","severity"]},"example":"severity","in":"query","name":"order","required":false,"description":"`newest` (the default): newest first. `severity`: critical, then warning, then info, newest first within each."},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","minLength":1,"maxLength":2048},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page, with the same filters and `order`"}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertPage"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/alerts/{id}/ack":{"post":{"summary":"Acknowledge an alert","tags":["alerts"],"description":"Sets `acknowledged_at`, and `acknowledged_by` to the user (null for an API key), and publishes `alert.acknowledged`. Acknowledging doesn't resolve the alert. An alert that is acknowledged already is returned unchanged, and nothing is published. A station-restricted API key may acknowledge its stations' alerts and alerts without a station (another station's returns `403 station_forbidden`). An unknown id returns `404 not_found`.\n\nRequires the `control` scope.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/engine/manifest":{"get":{"summary":"Media manifest of a node","tags":["engine"],"description":"Every media item the node should hold, ordered by id, with a presigned GET `url` valid for 6 h: the ready media of its active stations' sources, static categories, clocks, upcoming log and feeds. Pass `next_cursor` as `cursor` until it is null; `complete` is true on the last page. The agent downloads what it lacks; files no longer listed are garbage-collected later. Requires a node token (`401 unauthenticated` otherwise); a `cursor` that isn't a `next_cursor` returns `422 validation_failed`.","parameters":[{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false}],"security":[{"nodeToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineManifestResponse"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/engine/manifest/lookup":{"post":{"summary":"Manifest entries by media id","tags":["engine"],"description":"Entries for up to 1000 media ids, for example after a `sync.hint`. Ids that the node doesn't need, or whose media isn't ready, are left out. More than 1000 ids return `422 validation_failed`. Requires a node token (`401 unauthenticated` otherwise).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"media_item_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["media_item_ids"],"additionalProperties":false},"example":{"media_item_ids":["0192f0c1-0000-7000-8000-00000000000b"]}}}},"security":[{"nodeToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineManifestLookupResponse"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/engine/feeds":{"get":{"summary":"Current feed items of a node","tags":["engine"],"description":"The feeds the node's active stations play, each with its items that aren't expired or withdrawn and whose media is ready, as FeedIndex items plus the `file` to download. In a `reuse_previous` feed, items that expired less than its reuse grace ago are included, since a station may still air them. Items for other nodes' stations only are left out. Agents rebuild their feed indexes from it at startup, and fetch it again on a `sync.hint` with `feed_item_ids`. Media of kind `traffic` or `weather` are listed as `news` unless the node's agent announced protocol 2 or more on its connection to this API instance (engine-protocol.md §Protocol level). Requires a node token (`401 unauthenticated` otherwise).","security":[{"nodeToken":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineFeedsResponse"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhooks":{"get":{"summary":"List webhooks","tags":["webhooks"],"description":"Every webhook, disabled ones included, ordered by id. Page with `next_cursor` until it is null. Secrets are never returned.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d4-0000-7000-8000-000000000001","name":"Website now playing","url":"https://www.example.com/hooks/radioengine","event_types":["track.started","track.ended"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"],"enabled":true,"consecutive_failures":0,"created_at":"2026-09-20T09:00:00.000Z","updated_at":"2026-09-20T09:00:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a webhook","tags":["webhooks"],"description":"Generates the webhook's signing secret and returns it. It is shown only once and stored encrypted. Deliveries are signed with it: `X-RadioEngine-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. The webhook receives events that occur after it is created. `event_types` defaults to every type and `station_ids` to every station. Unknown station ids return `422 validation_failed`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"url":{"type":"string","maxLength":2048,"format":"uri","description":"An http:// or https:// URL. Redirects are not followed, except 307/308 to the same host."},"event_types":{"default":["*"],"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["media.ready","media.failed","source.scanned","log.updated","track.started","track.ended","feed_item.created","feed_item.synced","feed_item.withdrawn","station.state_changed","station.silence","output.state_changed","node.online","node.offline","alert.opened","alert.resolved","alert.acknowledged","pad.updated","programming.changed","config.changed","*"]}},"station_ids":{"default":null,"anyOf":[{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"Only events of these stations; events without a station (media, sources, nodes) are then left out. Null for every event."},"enabled":{"default":true,"type":"boolean"}},"required":["name","url"],"additionalProperties":false},"example":{"name":"Website now playing","url":"https://www.example.com/hooks/radioengine","event_types":["track.started","track.ended"],"station_ids":["0192f0c4-0000-7000-8000-000000000001"]}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhook"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhooks/{id}":{"patch":{"summary":"Update a webhook","tags":["webhooks"],"description":"Changes only the fields sent; the secret can't be changed. `enabled: true` on a disabled webhook resets `consecutive_failures` and resolves its `webhook.disabled` alert. Events that occurred while it was disabled are not delivered. Unknown station ids return `422 validation_failed`; an unknown webhook `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"url":{"type":"string","maxLength":2048,"format":"uri","description":"An http:// or https:// URL. Redirects are not followed, except 307/308 to the same host."},"event_types":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["media.ready","media.failed","source.scanned","log.updated","track.started","track.ended","feed_item.created","feed_item.synced","feed_item.withdrawn","station.state_changed","station.silence","output.state_changed","node.online","node.offline","alert.opened","alert.resolved","alert.acknowledged","pad.updated","programming.changed","config.changed","*"]}},"station_ids":{"anyOf":[{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"Only events of these stations; events without a station (media, sources, nodes) are then left out. Null for every event."},"enabled":{"description":"Re-enabling a disabled webhook resets `consecutive_failures` and resolves its `webhook.disabled` alert. Events that occurred while it was disabled are not delivered.","type":"boolean"}},"additionalProperties":false},"examples":{"example1":{"value":{"enabled":true}},"example2":{"value":{"event_types":["track.started","track.ended","alert.opened"]}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a webhook","tags":["webhooks"],"description":"Deletes its delivery log too; pending deliveries are never sent. An open `webhook.disabled` alert for it is resolved. An unknown id returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhooks/{id}/deliveries":{"get":{"summary":"List a webhook's deliveries","tags":["webhooks"],"description":"Newest first, each with its event's type, optionally only those with one `status`. Page with `next_cursor` until it is null. A delivery is retried after 30 s, 2 min, 10 min, 1 h, 6 h and 24 h, then marked `failed`. Deliveries are kept as long as their events (30 days). An unknown webhook returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false,"description":"`next_cursor` of the previous page"},{"schema":{"type":"string","enum":["pending","succeeded","failed"]},"in":"query","name":"status","required":false,"description":"Only deliveries with this status"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d5-0000-7000-8000-000000000002","webhook_id":"0192f0d4-0000-7000-8000-000000000001","event_id":"0192f0c8-0000-7000-8000-000000000003","event_type":"webhook.test","status":"pending","attempts":0,"next_attempt_at":"2026-10-01T15:02:00.000Z","response_status":null,"last_error":null,"created_at":"2026-10-01T15:02:00.000Z","updated_at":"2026-10-01T15:02:00.000Z"},{"id":"0192f0d5-0000-7000-8000-000000000001","webhook_id":"0192f0d4-0000-7000-8000-000000000001","event_id":"0192f0c8-0000-7000-8000-000000000001","event_type":"track.started","status":"succeeded","attempts":1,"next_attempt_at":null,"response_status":200,"last_error":null,"created_at":"2026-10-01T14:00:00.020Z","updated_at":"2026-10-01T14:00:00.245Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhooks/{id}/deliveries/{delivery_id}":{"get":{"summary":"Get one delivery","tags":["webhooks"],"description":"One delivery of the webhook, with its event's type, e.g. to follow a test delivery until it is `succeeded` or `failed`. An unknown webhook, an unknown delivery and another webhook's delivery all return `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"delivery_id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/webhooks/{id}/test":{"post":{"summary":"Send a test delivery","tags":["webhooks"],"description":"Queues a delivery of a synthetic event, `{type: \"webhook.test\", data: {webhook_id}}`, signed and sent like any other, and returns it while `pending`. It is sent once, without retries, even while the webhook is disabled, and doesn't count toward `consecutive_failures`. Follow its outcome in the delivery log. The event is not part of the catalog: the event stream and `GET /v1/events` never return it. An unknown webhook returns `404 not_found`.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/notification-channels":{"get":{"summary":"List notification channels","tags":["notification-channels"],"description":"Every channel, oldest first, with its config's secrets hidden: the Slack webhook URL's path, the Telegram bot token after the bot id, the SMTP password. Not available to station-restricted keys, since a channel receives every station's alerts.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false,"description":"Page size, 1 to 500. Default 50."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"cursor","required":false}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"],"additionalProperties":false},"example":{"items":[{"id":"0192f0d9-0000-7000-8000-000000000001","name":"#radio-ops","kind":"slack","config":{"webhook_url":"https://hooks.slack.com/…a1B2"},"min_severity":"warning","station_ids":null,"enabled":true,"created_at":"2026-09-02T10:15:00.000Z","updated_at":"2026-09-02T10:15:00.000Z"},{"id":"0192f0d9-0000-7000-8000-000000000002","name":"Rock FM on call","kind":"telegram","config":{"bot_token":"123456789:…","chat_id":"-1001234567890"},"min_severity":"critical","station_ids":["0192f0c4-0000-7000-8000-000000000001"],"enabled":true,"created_at":"2026-09-02T10:20:00.000Z","updated_at":"2026-09-15T08:00:00.000Z"},{"id":"0192f0d9-0000-7000-8000-000000000003","name":"Engineering","kind":"email","config":{"smtp_url":"smtps://alerts%40example.com:…@smtp.example.com:465","from":"RadioEngine <alerts@example.com>","to":["oncall@example.com","studio@example.com"]},"min_severity":"warning","station_ids":null,"enabled":false,"created_at":"2026-09-03T12:00:00.000Z","updated_at":"2026-09-20T17:45:00.000Z"}],"next_cursor":null}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"post":{"summary":"Create a notification channel","tags":["notification-channels"],"description":"Alerts go to Slack (an incoming webhook), Telegram (a bot) or email (SMTP). The config is stored encrypted and shown with its secrets hidden. The channel gets the alerts that open from now on, of `min_severity` and above, of `station_ids` (and alerts without a station); an alert's key gets at most one opened message every 10 minutes. The config must match the kind: `slack` `{webhook_url}`, `telegram` `{bot_token, chat_id}`, `email` `{smtp_url, from, to}` (422 on the invalid `config` fields, or on `station_ids.<n>` for an unknown station). Returns the channel as it is shown from now on, secrets hidden. Send a test message next to check it works.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"kind":{"type":"string","enum":["slack","telegram","email"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"`slack`: `{webhook_url}`; `telegram`: `{bot_token, chat_id}`; `email`: `{smtp_url, from, to: [...]}` (api.md §Notification channels)."},"min_severity":{"default":"warning","description":"Send alerts of this severity and above. Default `warning`.","type":"string","enum":["info","warning","critical"]},"station_ids":{"default":null,"anyOf":[{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"Only alerts of these stations, plus alerts without a station (nodes, feeds, media). Null for every alert."},"enabled":{"default":true,"type":"boolean"}},"required":["name","kind","config"],"additionalProperties":false},"examples":{"example1":{"value":{"name":"#radio-ops","kind":"slack","config":{"webhook_url":"https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXa1B2"},"min_severity":"warning"}},"example2":{"value":{"name":"Rock FM on call","kind":"telegram","config":{"bot_token":"123456789:AAExampleExampleExampleExampleExam","chat_id":"-1001234567890"},"min_severity":"critical","station_ids":["0192f0c4-0000-7000-8000-000000000001"]}},"example3":{"value":{"name":"Engineering","kind":"email","config":{"smtp_url":"smtps://alerts%40example.com:not-a-real-password@smtp.example.com:465","from":"RadioEngine <alerts@example.com>","to":["oncall@example.com","studio@example.com"]},"min_severity":"warning"}}}}}},"security":[{"session":[]},{"apiKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationChannel"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/notification-channels/{id}":{"patch":{"summary":"Update a notification channel","tags":["notification-channels"],"description":"`config` is merged into the stored config: send only the fields to change, and leave a secret out to keep it. The kind can't change. `enabled: false` pauses the channel (test messages still go out). 404 for an unknown channel; 422 as for a create.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"config":{"description":"The fields to change, merged into the stored config: leave a secret out to keep it. The kind can't change.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"min_severity":{"type":"string","enum":["info","warning","critical"]},"station_ids":{"anyOf":[{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}],"description":"Only alerts of these stations, plus alerts without a station (nodes, feeds, media). Null for every alert."},"enabled":{"type":"boolean"}},"additionalProperties":false},"examples":{"example1":{"value":{"min_severity":"critical","station_ids":["0192f0c4-0000-7000-8000-000000000001"]}},"example2":{"value":{"config":{"chat_id":"@rockfm_oncall"}}},"example3":{"value":{"enabled":false}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationChannel"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}},"delete":{"summary":"Delete a notification channel","tags":["notification-channels"],"description":"Deletes the channel. Messages still queued for it are not sent. 404 for an unknown channel.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"204":{"description":"Deleted"},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}},"/v1/notification-channels/{id}/test":{"post":{"summary":"Send a test message","tags":["notification-channels"],"description":"Queues a test message through the channel, even while it is disabled, and answers at once. The worker sends it within seconds, once, without retries: it worked when the message arrives. When it doesn't, the worker's log says why. 404 for an unknown channel.\n\nRequires the `admin` scope. Not available to station-restricted API keys.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"id","required":true}],"security":[{"session":[]},{"apiKey":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationChannelTest"}}}},"4XX":{"description":"Client error (`application/problem+json`)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"5XX":{"$ref":"#/components/responses/ServerError"}}}}},"servers":[{"url":"https://api.zimze.com"}],"tags":[{"name":"health","description":"Liveness and readiness probes."},{"name":"auth","description":"Log in and out, and who am I. The dashboard uses the `re_session` cookie; automation uses `Authorization: Bearer rek_…` API keys. Guide: docs/api-guide/authentication.md."},{"name":"users","description":"Dashboard users. Roles map to scopes (api.md §Scopes)."},{"name":"api-keys","description":"API keys for automation, with scopes and optional station restrictions. Guide: docs/api-guide/authentication.md."},{"name":"events","description":"Event history. Live events stream over the WebSocket `GET /v1/events/ws`: send `{\"type\": \"subscribe\", \"station_ids\": [...] | null, \"types\": [...] | null}` to filter; each subscribe is answered with `{\"type\": \"subscribed\", \"last_event_id\": \"…\" | null}` (a catch-up cursor), then events arrive as `{\"type\": \"event\", \"event\": <Event>}`. Every 20 s the server sends `{\"type\": \"ping\"}` and a WebSocket ping; reconnect after 60 s without any message, and catch up with `GET /v1/events?cursor=`. Guide: docs/api-guide/live-events.md."},{"name":"stations","description":"Radio stations: settings, time zone, node, sources and public stream URLs. `:id` is the uuid or the slug."},{"name":"outputs","description":"A station's streams: Icecast mounts and HLS renditions."},{"name":"categories","description":"Groups of media that clock slots pick from: static lists or saved filters, per station or shared."},{"name":"rotation-rules","description":"Separation, plays-per-day and daypart rules the scheduler applies to its picks."},{"name":"clocks","description":"Templates for a block of time, made of ordered, anchored slots."},{"name":"schedule-rules","description":"Which clock plays on which days and times, with date ranges and priorities."},{"name":"schedule","description":"The resolved schedule (which clock instance plays when) and dry-run previews of a clock, with the real rotation."},{"name":"log","description":"A station's planned log: read it, insert, move and cancel items, and re-plan. Edits re-plan at once; locked items (loaded, playing, or inside the lock window) can't be changed. Guide: docs/api-guide/inserting-spots.md."},{"name":"now-playing","description":"What a station is playing, what comes next, what it just played, and its listeners right now."},{"name":"control","description":"Skip the current item, and start or stop a station (`control` scope). Commands reach the station process through whichever API instance holds its connection. Guide: docs/api-guide/controlling-stations.md."},{"name":"history","description":"What a station played (the as-played log), newest first."},{"name":"reports","description":"Play reports for royalty and music reporting, as JSON or RFC 4180 CSV."},{"name":"listeners","description":"Listener counts per output over time."},{"name":"public","description":"For websites and players, without authentication: active stations, their stream URLs and now playing. CORS `*`, `Cache-Control: public, max-age=5`, strong ETags (304 on `If-None-Match`), 120 requests per minute per client address. Guide: docs/api-guide/now-playing-on-a-website.md."},{"name":"storage-connections","description":"S3-compatible buckets RadioEngine reads media from. The secret key can be written, never read."},{"name":"sources","description":"A bucket prefix that media is scanned from, periodically and on request, with counts by status."},{"name":"media","description":"The media library: search and filter, edit tags and cue overrides, upload straight to S3 with presigned URLs, re-analyze, play and see waveforms, change many items at once."},{"name":"tags","description":"Labels for media items, shared by every station; categories and rules select by them."},{"name":"feeds","description":"Fresh content such as hourly news: feeds, their items with validity windows (uploaded, referenced or picked up from a watched prefix), withdrawals, and per-station and per-node status. New items reach the stream servers within seconds. Guide: docs/api-guide/pushing-news.md."},{"name":"nodes","description":"Stream servers and their node tokens."},{"name":"alerts","description":"Problems detected before listeners notice: late or unsynced feeds, offline nodes, low disk, stations that stop reporting or play their fallback, silence, failed playback and outputs, failed analysis, disabled webhooks. Alerts open and resolve on their own (`alert.opened`, `alert.resolved` events); acknowledging one marks it as seen."},{"name":"engine","description":"Endpoints for stream servers (docs/contracts/engine-protocol.md), with a node token. The agent and station channels are WebSockets: `GET /v1/engine/agent` and `GET /v1/engine/stations/{station_id}`."},{"name":"webhooks","description":"Signed HTTP callbacks for events: `POST <url>` with the event envelope, `X-RadioEngine-Event`, `X-RadioEngine-Delivery` and `X-RadioEngine-Signature` headers, retried on failure. See docs/api-guide/webhooks.md."},{"name":"notification-channels","description":"Where alerts are sent: Slack, Telegram or email, each with a minimum severity and optionally only some stations. An alert's key gets at most one opened message every 10 minutes per channel; configs are stored encrypted and shown with their secrets hidden. Guide: docs/api-guide/controlling-stations.md#alert-notifications."}]}