Skip to main content

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

ParameterTypeDefaultDescription
offsetinteger0Day 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

FieldTypeDescription
datestringFormatted date (e.g., "Monday, February 10")
day_namestringDay name (Monday, Tuesday, etc.)
is_todaybooleanWhether this is today
showsarraySchedule entries for this day

Schedule entry fields

FieldTypeDescription
show_idintegerShow ID
titlestringShow title
imagestringShow artwork URL
daystringDay abbreviation (monsun)
start_timestringStart time in HH:MM format
end_timestringEnd time in HH:MM format
start_minutesintegerStart time as minutes from midnight (0–1440)
end_minutesintegerEnd time as minutes from midnight (0–1440)
is_currentbooleanShow is currently on air
is_pastbooleanShow has already aired today

Top-level fields

FieldTypeDescription
current_weekintegerWhich week of the rotation is currently active
number_of_weeksintegerTotal weeks in the schedule rotation

How time works

Times are returned in two formats:

  • Human-readable: start_time and end_time in HH:MM format (e.g., "09:00", "13:30")
  • Machine-friendly: start_minutes and end_minutes as 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.

warning

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
}
]
}
FieldTypeRequiredDescription
show_idintegerYesShow to schedule (must belong to your stream)
weekintegerYesWeek number (1 to number_of_weeks)
entriesarrayYesSchedule entries (max 672 per request)

Entry fields

FieldTypeRequiredDescription
daystringYesDay: mon, tue, wed, thu, fri, sat, sun
timeintegerYesStart time as minutes from midnight (0–1440)
durationintegerYesDuration in minutes

Time reference

MinutesTime
000:00 (midnight)
6001:00
54009:00
72012:00
81013:30
138023: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 scope
  • 404 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
}
FieldTypeRequiredDescription
show_idintegerYesShow ID
weekintegerYesWeek number

Response

HTTP 204 No Content

No response body.

Errors

  • 403 Forbidden — Missing required scope
  • 404 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