Stream Content Schedule
Replace content schedule
https://api.tunio.ai/ v1/ stream-schedule/ content/ {stream_id}Replaces every content slot of the stream with the given set, atomically. Each slot repeats weekly on its day_of_week at its start_time, in the stream's timezone. Every referenced item must belong to the caller's library, and no two slots of the set may start at the same time on the same day (the rule of the single-slot endpoint, applied to the whole set). slots is required: send it as an empty array to clear the schedule. An omitted or null slots is refused with 400 slots_required and nothing is written. With dry_run=true nothing is written: the response says whether the set is valid, lists the conflicts and the diff against the current schedule. With dry_run=false a conflicting set is refused with 409 and nothing is written. A valid set is applied after the stream's current schedule (music and content) is saved as a private schedule profile, returned as snapshot_profile_id; apply it with POST /v1/schedule-profiles/{profile_id}/apply to roll back. The last 20 automatic snapshots per stream are kept. Slots that do not change keep their slot_id.
Path parameters
| Name | Type | Description |
|---|---|---|
| stream_idRequired | string | Stream ID |
Request body
Complete new schedule
| Name | Type | Description |
|---|---|---|
| dry_run | boolean | true validates and reports the diff without writing anything. |
| slotsRequired | array | The complete new schedule, up to 500 slots; an empty array clears it. Required: an omitted or
null slots is refused with slots_required. |
| [item]Required | object | - |
01{02 "dry_run": true,03 "slots": [04 {05 "content_id": "3c1e2f90-7d4b-4a8e-9f21-6b5d4c3a2e10",06 "content_type": "announcement",07 "day_of_week": 1,08 "meta": {09 "count": 0,10 "mode": "random",11 "play_current_time": false,12 "playback": {13 "duck": 0.2,14 "fade_down": 0.8,15 "fade_up": 1.5,16 "mode": "voiceover"17 },18 "precise": false,19 "repeat": false20 },21 "start_time": "10:30"22 }23 ]24}
Responses
| Name | Type | Description |
|---|---|---|
| conflicts | array | Every conflicting pair of requested slots; empty when valid. |
| [item]Required | object | - |
| diff | object | How the request differs from the current schedule. |
| added | array | Requested slots that are not in the current schedule. |
| removed | array | Current slots that the request does not keep. |
| unchanged_count | integer | How many current slots stay as they are (and keep their slot_id). |
| dry_run | boolean | Echoes the request's dry_run. |
| message | string | schedule_conflict on a 409; absent otherwise. |
| snapshot_profile_id | string | UUID of the private schedule profile holding the stream's schedule (music and content) as it was
before this write; apply it with POST /v1/schedule-profiles/{profile_id}/apply to roll back. Null on
dry runs and on a 409. |
| success | boolean | true, except on a 409. |
| valid | boolean | false when two requested slots start at the same time on the same day. |
| Name | Type | Description |
|---|---|---|
| message | string | Error code. |
| slot_index | integer | Index (0-based) in the request's slots of the slot at fault; absent for errors about the
whole request. |
| success | boolean | Always false. |
| Name | Type | Description |
|---|---|---|
| message | string | Error code or human-readable error details. |
| success | boolean | Always false for error payloads. |
| Name | Type | Description |
|---|---|---|
| message | string | Error code or human-readable error details. |
| success | boolean | Always false for error payloads. |
| Name | Type | Description |
|---|---|---|
| message | string | Error code. |
| slot_index | integer | Index (0-based) in the request's slots of the slot at fault; absent for errors about the
whole request. |
| success | boolean | Always false. |
| Name | Type | Description |
|---|---|---|
| conflicts | array | Every conflicting pair of requested slots; empty when valid. |
| [item]Required | object | - |
| diff | object | How the request differs from the current schedule. |
| added | array | Requested slots that are not in the current schedule. |
| removed | array | Current slots that the request does not keep. |
| unchanged_count | integer | How many current slots stay as they are (and keep their slot_id). |
| dry_run | boolean | Echoes the request's dry_run. |
| message | string | schedule_conflict on a 409; absent otherwise. |
| snapshot_profile_id | string | UUID of the private schedule profile holding the stream's schedule (music and content) as it was
before this write; apply it with POST /v1/schedule-profiles/{profile_id}/apply to roll back. Null on
dry runs and on a 409. |
| success | boolean | true, except on a 409. |
| valid | boolean | false when two requested slots start at the same time on the same day. |
| Name | Type | Description |
|---|---|---|
| message | string | Error code or human-readable error details. |
| success | boolean | Always false for error payloads. |