Skip to content
Light StreamWiki
← Knowledge base
Page tools

REST API - Playback control


Connection and authorization · Projects · Calendar

All methods on this page require a cookie session. Paths are given relative to the web server address. POST bodies are JSON where they are given in the table; the "—" sign means no body.

Scenes for all fixtures

Method and path Body Result
GET /api/compositions — 200: an array of id, header. With no project open — [].
GET /api/compositions/current — 200: id, header, duration, elapsed; time in seconds.
POST /api/compositions/play/{id} — Launch a scene with the default transition. 204; unknown ID — 404.
POST /api/compositions/stop — Smooth transition to blackout, like the application's stop button. 204.
POST /api/compositions/rename/{id} {"name":"New scene"} 200: the actual {"name":"..."}; empty name — 400, scene not found — 404, rename service unavailable — 501.

Example of the current scene:

{"id":12,"header":"Evening facade","duration":120.0,"elapsed":31.5}

During blackout or when there is no current scene, the response looks like this:

{"id":0,"header":"","duration":0.0,"elapsed":0.0}

When renaming, the application may strip forbidden characters, limit the length or change the name to make it unique. Display the name from the response, then save the project via POST /api/projects/save.

This group of methods has no pause, seek, scene creation or general playlist launch by ID. A playlist can be assigned to a group or a calendar event. Do not put a playlist ID into the scene launch route.

Master brightness

POST /api/triggers/master
Content-Type: application/json

{"value":127.5}

This is the master brightness on a 0–255 scale: 0 — minimum, 255 — maximum, 127.5 — 50%. The value is limited to the allowed range of the property. The response is 204; if the master brightness property is missing — 404.

Read the current master value in GET /api/triggers/status or GET /api/triggers/board; it may be null if the property is unavailable.

Playback by groups

Start with GET /api/groups. The response:

Field Description
byGroups The "By groups" mode is on.
blackout Master blackout of this mode.
stamp Stamp of the composition of targets and assignments; compare it for equality, do not treat it as a counter.
targets Groups available for control.
options Scenes and playlists that can be assigned.

Each target in targets contains:

{
  "id":"11111111-1111-1111-1111-111111111111",
  "name":"Facade",
  "colorHex":"#3366FF",
  "isUngrouped":false,
  "fixtureCount":24,
  "kind":1,
  "itemId":12,
  "itemHeader":"Evening facade",
  "isPlaying":true,
  "isPaused":false,
  "elapsedSeconds":31.5,
  "durationSeconds":120.0,
  "infinite":false,
  "brightness":0.75
}

The GUID above is a placeholder: take the real targets[].id from the response. The "Ungrouped" group has its own ID and isUngrouped=true; do not construct its ID yourself.

An assignment option in options: kind, itemId, header, durationSeconds, itemCount (number of scenes in the playlist; for a scene — 0). kind values: 0 — remove assignment, 1 — scene, 2 — playlist. For an infinite assignment, look at infinite; the duration may be 0.

Method and path Body Result
POST /api/groups/mode {"byGroups":true} Enable the "By groups" mode; false — "All fixtures". 204.
POST /api/groups/assign/{id} {"kind":1,"itemId":12} Assign a scene and launch it immediately. For a playlist kind:2. 204; unknown kind — 400.
POST /api/groups/assign/{id} {"kind":0,"itemId":0} Remove the assignment. 204.
POST /api/groups/play/{id} — Start/resume the assignment. 204.
POST /api/groups/pause/{id} — Pause the group. 204.
POST /api/groups/toggle/{id} — Toggle playback/pause. 204.
POST /api/groups/stop/{id} — Stop the group. 204.
POST /api/groups/stop-all — Stop all groups. 204.
POST /api/groups/brightness/{id} {"value":75} Set the group brightness in percent 0–100, clamped to the range. 204.
POST /api/groups/blackout {"on":true} Enable group mode blackout; false — release it. 204.
POST /api/groups/rename/{id} {"name":"Facade"} Rename a project group. 200: {"name":"Facade"}; empty name — 400, unknown group or "Ungrouped" — 404.
GET /api/groups/thumb/{kind}/{itemId} — JPEG of a scene or of the first scene of a playlist. 200 image/jpeg; unknown kind — 400, no frame — 404.

For assignments to produce visible output, the "By groups" mode must be on. Some group commands return 204 even for a correctly formatted but nonexistent GUID: the controller does not confirm that the target exists. Always choose IDs from targets and re-read the state after a command.

The scales differ: the group brightness POST accepts 75, while the group GET returns brightness:0.75. The master brightness accepts 191.25 for the same 75%. Group brightness is multiplied by master brightness.

Group blackout is a session state and is not saved in the project. Renaming a group changes the project and requires saving. To save the project settings of groups, also use the regular project save.

Web triggers and custom controls

This API accesses the controls configured in the project's web triggers. For how to create such a control and what it does when triggered, see the article "Triggers". It does not provide arbitrary writing of any application property by GUID. Disabled triggers are not published.

GET /api/triggers returns an array of controls with the following fields:

Fields Description
propertyId GUID for sending a command.
type Slider, Color, Button or ToggleButton; case matters when reading the type.
header, displayName Labels.
min, max, doubleValue Slider bounds and current value; may be null.
colorValue HEX color or null.
boolValue, value State of the button/toggle; may be null.
isAssigned Whether a property/action is assigned. An unassigned control should not be used for control.
groupTargetId GUID of the target group for a group button, otherwise null.

Sending a value

POST /api/triggers/set
Content-Type: application/json

{"propertyId":"22222222-2222-2222-2222-222222222222","value":"127.5"}

The response is 204. value is a string, even for a number or a boolean value:

Type Example value Rule
Slider "127.5" A number with a decimal point, within the control's min/max. The REST method itself does not limit the value.
Color "#FF0000000000" Red, all white channels off. Full format: # and six two-digit bytes R, G, B, W, W1, W2, 12 HEX digits in total.
Button "true" A button event; the actual reaction is determined by the trigger's condition and action.
ToggleButton "true" / "false" An on/off value for the configured trigger.

Use propertyId from the server response. An unknown GUID is silently ignored with 204. The value is passed to trigger processing asynchronously, so the response does not mean its action has completed.

If several controls of different types use the same propertyId, REST picks the first one. This REST method has no controlType parameter. For such a configuration, create unambiguous assignments or use the web remote protocol separately.

Full and brief remote state

Method Response fields
GET /api/triggers/board projectOpen, controls, compositions (id, header, duration), layout, master, masterPropertyId, live.
GET /api/triggers/status projectOpen, master, live, compositionsStamp, controlsStamp, unsavedChanges.

live is an object id, header, duration, elapsed or null during blackout or when there is no scene. Stamps change when the composition or names of scenes/controls change. This is a signal to refresh board, but not a stream of the values of all sliders: for up-to-date values, read GET /api/triggers.

unsavedChanges reports edits marked by the web remote and is not a universal check of all changes in the desktop editor.

Web remote layout

Method and path Body Result
POST /api/triggers/tiles-layout An array of tiles, see below Replace the saved layout in the in-memory project; 204.
POST /api/triggers/reset-layout — Reset the layout; 204.
POST /api/triggers/save-file — Write the web controls section to the existing project file; 204. Without a file name — also 204, with no write.

Tile format: key (string), group (section), order (order), w (1–4), h (1–3), optional name and hidden. Take keys and sections from board.layout of an already configured remote. Example body:

[{"key":"comp:12","group":"fx","order":0,"w":2,"h":1,"name":null,"hidden":false}]

Send the full list of tiles that should be kept. name is the label of the control on the remote; change the name of the scene or group itself with the corresponding rename method. save-file saves only the web controls section; for other edits POST /api/projects/save is needed.