REST API - Calendar
Connection and authorization · Playback control · Saving a project
All methods require a session cookie. The schedule uses the dates and local time of the LS4 computer. Pass dates as yyyy-MM-dd and times as HH:mm, for example 2026-10-01 and 18:00. Do not convert these strings to UTC.
Schedule status and start
| Method and path | Body | Result |
|---|---|---|
GET /api/calendar/status |
— | State of the calendar, the current event and playback. |
POST /api/calendar/start |
— | Start the schedule. 204.
|
POST /api/calendar/stop |
— | Stop the schedule. 204.
|
POST /api/calendar/fade |
{"enabled":true,"seconds":3} |
Configure event transitions; seconds are limited to the range 0–3600. 204.
|
GET /api/calendar/targets |
— | Available targets: an array of kind, id, header. Here kind is the string scene or playlist.
|
Status fields: projectOpen, runState (run, stop, pause), statusPlayback, eventHeader, playlistHeader, compositionHeader, fadeEnabled, fadeSeconds, unsavedChanges, currentEventKey, live. For a stopped or waiting calendar, currentEventKey may be null. live contains id, header, duration, elapsed in seconds, or null.
While a running schedule is waiting for an event, statusPlayback is waiting for event. The runState field may show a pause, but there is no separate REST method to pause the calendar. If the calendar service is unavailable, the methods return 500.
List and actual schedule
| Method and path | Result |
|---|---|
GET /api/calendar/events |
An array of project events. |
GET /api/calendar/occurrences?from=2026-10-01&to=2026-10-07 |
All event occurrences for the days in the range, including overlapping ones. |
GET /api/calendar/timeline?from=2026-10-01&to=2026-10-07 |
Segments of actual playback after event overlaps are resolved. |
to is inclusive; the difference between to and from is at most 62 days (that is, at most 63 calendar dates inclusive). An invalid format, a reversed range or a range that is too long returns 400.
An element of events contains the form fields described below, as well as key, target (the target label), editable, advanced. For a complex event, repeat may be custom and editable=false. Such events are visible in the schedule but are edited in the application.
An element of occurrences: key, title, kind, targetId, target, priority, start, end, editable. timeline additionally has occurrenceStart, occurrenceEnd — the boundaries of the original occurrence. Date/time fields in these responses are ISO 8601 strings; the schedule is interpreted in LS4 local time.
Creating an event
First get the target via GET /api/calendar/targets. The example below creates a daily event; replace the ID and date with your own:
POST /api/calendar/events
Content-Type: application/json
{
"title":"Evening facade",
"kind":"scene",
"targetId":12,
"startTime":"18:00",
"endTime":"23:00",
"repeat":"daily",
"interval":1,
"fromDate":"2026-10-01",
"end":"never",
"priority":1
}
The response is 200 with {"key":"..."}. With no project open — 409. An invalid form — 400, for example {"field":"StartTime","value":"25:00"}. The name of the faulty field may start with a capital letter.
Form fields
| Field | Type, values and purpose |
|---|---|
title |
A non-empty string — the event name. |
kind |
scene or playlist. Use the value from /targets.
|
targetId |
An integer — the target ID from /targets.
|
startTime, endTime |
Start and end time, HH:mm.
|
fromDate |
Start date, yyyy-MM-dd.
|
repeat |
once, daily, weekly, monthly, yearly.
|
interval |
For repeats: 1–999, default 1; the number of days, weeks, months or years between repeats. |
weekDays |
For weekly: a non-empty array. 0 is Monday, 6 is Sunday, for example [0,1,2,3,4].
|
monthDays |
For monthly: a non-empty array of days 1–31, for example [1,15].
|
yearMonth, yearDay |
For yearly: month 1–12 and a valid day of the month.
|
end |
never — no end, todate — until a date, count — a limit on the number of repeats.
|
toDate |
For end:todate: a date not earlier than fromDate.
|
repeatCount |
For end:count: 1–9999.
|
priority |
An integer 0–255, default 1. To see the result of overlaps, use /timeline.
|
With repeat:once the repeat-end parameters are not used. If the end time is not later than the start time, a single event ends the next day. The start date of a repeating event may be adjusted to the first day matching the rule; re-read the list after writing.
Editing and deleting
| Method and path | Body | Result |
|---|---|---|
PUT /api/calendar/events/{key} |
Full event form | 200: a new {"key":"..."}.
|
DELETE /api/calendar/events/{key} |
— | 204.
|
POST /api/calendar/events/{key}/drag |
Move form, see below | 200: a new {"key":"..."}, or the previous key if nothing changed.
|
key is a content fingerprint, not a permanent ID. After a change, use the key from the response and re-read the list. A stale/unknown key returns 404. Encode the key as a URL component. PUT passes the full form, not only the fields being changed.
When editable=false, PUT returns 409 with {"reason":"advanced"}: the REST form must not erase advanced parameters. DELETE can still delete such an event.
Moving an event
{"plateDay":"2026-10-01","mode":"move","timeDeltaMinutes":30,"dayDelta":0}
plateDay is the day of the selected occurrence; mode: move, resizeStart or resizeEnd; timeDeltaMinutes is the shift in minutes, dayDelta is the shift in days. For a repeating event the rule is changed; an exception for only the selected day is not created. When resizing, the duration is not reduced below 15 minutes.
An invalid date or mode returns 400; if the event cannot be moved this way, the response is 409 with {"reason":"undraggable"}.
Saving changes
Adding, changing, moving and deleting events immediately rebuilds the in-memory schedule. To save it to the .ls file, call POST /api/projects/save. To start executing the schedule, separately call POST /api/calendar/start.