Schedule
Get the broadcast schedule and manage schedule entries.
Get the schedule
GET /v1/schedule
Returns the 7-day broadcast schedule starting from today (or from a day offset).
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
offset | integer | 0 | Day offset: 0 = today, 1 = tomorrow, 7 = next week |
Response
{
"days": [
{
"date": "Monday, February 10",
"day_name": "Monday",
"is_today": true,
"shows": [
{
"show_id": 15,
"title": "Morning Drive",
"image": "https://cdn.example.com/shows/morning.png",
"day": "mon",
"start_time": "09:00",
"end_time": "12:00",
"start_minutes": 540,
"end_minutes": 720,
"is_current": true,
"is_past": false
},
{
"show_id": 16,
"title": "Afternoon Show",
"image": "https://cdn.example.com/shows/afternoon.png",
"day": "mon",
"start_time": "12:00",
"end_time": "15:00",
"start_minutes": 720,
"end_minutes": 900,
"is_current": false,
"is_past": false
}
]
}
],
"current_week": 1,
"number_of_weeks": 2
}
Schedule day fields
| Field | Type | Description |
|---|---|---|
date | string | Formatted date (e.g., "Monday, February 10") |
day_name | string | Day name (Monday, Tuesday, etc.) |
is_today | boolean | Whether this is today |
shows | array | Schedule entries for this day |
Schedule entry fields
| Field | Type | Description |
|---|---|---|
show_id | integer | Show ID |
title | string | Show title |
image | string | Show artwork URL |
day | string | Day abbreviation (mon–sun) |
start_time | string | Start time in HH:MM format |
end_time | string | End time in HH:MM format |
start_minutes | integer | Start time as minutes from midnight (0–1440) |
end_minutes | integer | End time as minutes from midnight (0–1440) |
is_current | boolean | Show is currently on air |
is_past | boolean | Show has already aired today |
Top-level fields
| Field | Type | Description |
|---|---|---|
current_week | integer | Which week of the rotation is currently active |
number_of_weeks | integer | Total weeks in the schedule rotation |
How time works
Times are returned in two formats:
- Human-readable:
start_timeandend_timeinHH:MMformat (e.g., "09:00", "13:30") - Machine-friendly:
start_minutesandend_minutesas minutes from midnight (e.g., 540 = 09:00, 810 = 13:30)
Use whichever is more convenient for your application. The minutes format is useful for calculations and comparisons.
Schedule rotation
Most stations use a 1-week rotation (the same schedule every week). Some use multi-week rotations — for example, a 2-week rotation means the schedule alternates between week 1 and week 2.
The current_week field tells you which week is currently active, and number_of_weeks tells you the total rotation length.
Example
# Today's schedule (and the next 6 days)
curl -H "X-API-Key: your-key" \
https://api.autopod.xyz/v1/schedule
# Next week's schedule
curl -H "X-API-Key: your-key" \
"https://api.autopod.xyz/v1/schedule?offset=7"
Update the schedule
PUT /v1/schedule
Replaces all schedule entries for a specific show and week. Requires the schedule:write scope.
This is a full replacement operation. All existing entries for the specified show and week are deleted, and the new entries take their place. Omitting an entry removes it from the schedule.
Request body
{
"show_id": 15,
"week": 1,
"entries": [
{
"day": "mon",
"time": 540,
"duration": 180
},
{
"day": "wed",
"time": 540,
"duration": 180
},
{
"day": "fri",
"time": 540,
"duration": 180
}
]
}
| Field | Type | Required | Description |
|---|---|---|---|
show_id | integer | Yes | Show to schedule (must belong to your stream) |
week | integer | Yes | Week number (1 to number_of_weeks) |
entries | array | Yes | Schedule entries (max 672 per request) |
Entry fields
| Field | Type | Required | Description |
|---|---|---|---|
day | string | Yes | Day: mon, tue, wed, thu, fri, sat, sun |
time | integer | Yes | Start time as minutes from midnight (0–1440) |
duration | integer | Yes | Duration in minutes |
Time reference
| Minutes | Time |
|---|---|
| 0 | 00:00 (midnight) |
| 60 | 01:00 |
| 540 | 09:00 |
| 720 | 12:00 |
| 810 | 13:30 |
| 1380 | 23:00 |
Response
{
"message": "Schedule updated",
"entries_written": 3
}
Errors
400 Bad Request— Validation error (invalid day, time out of range, too many entries)403 Forbidden— Missing required scope404 Not Found— Show doesn't exist or doesn't belong to your stream
Example
# Schedule "Morning Show" (ID 15) for weekdays 9am-12pm in week 1
curl -X PUT \
-H "X-API-Key: your-key" \
-H "Content-Type: application/json" \
-d '{
"show_id": 15,
"week": 1,
"entries": [
{"day": "mon", "time": 540, "duration": 180},
{"day": "tue", "time": 540, "duration": 180},
{"day": "wed", "time": 540, "duration": 180},
{"day": "thu", "time": 540, "duration": 180},
{"day": "fri", "time": 540, "duration": 180}
]
}' \
https://api.autopod.xyz/v1/schedule
Clear schedule entries
DELETE /v1/schedule
Removes all schedule entries for a specific show and week. Requires the schedule:write scope.
Request body
{
"show_id": 15,
"week": 1
}
| Field | Type | Required | Description |
|---|---|---|---|
show_id | integer | Yes | Show ID |
week | integer | Yes | Week number |
Response
HTTP 204 No Content
No response body.
Errors
403 Forbidden— Missing required scope404 Not Found— Show doesn't exist or doesn't belong to your stream
Example
# Remove all schedule entries for show 15 in week 1
curl -X DELETE \
-H "X-API-Key: your-key" \
-H "Content-Type: application/json" \
-d '{"show_id": 15, "week": 1}' \
https://api.autopod.xyz/v1/schedule