Skip to content
Light StreamWiki
← Knowledge base
Page tools

REST API - Settings and diagnostics


Connection and authorization · Playback · Projects

Methods require a session cookie, except the theme and language reads that are specifically marked. The commands on this page change the settings of the running application; a network change can interrupt output, and reboot restarts the computer.

Art-Net: quick commands

Method and path Body Result
GET /api/artnet/interfaces — An array of adapters: name, ip, physicalAddress, info.
GET /api/artnet/status — {"enabled":true,"physicalAddress":"..."}.
POST /api/artnet/interface {"physicalAddress":"001122334455"} Select an adapter by MAC; if Art-Net is running, restart it. 204; invalid MAC format — 400.
POST /api/artnet/enable {"enabled":true} Start Art-Net, false — stop it. 204.

The MAC in the example is a placeholder: use the physicalAddress from /interfaces. After a command, check /status and /api/diagnostics/summary: 204 does not prove that the physical devices are reachable.

Settings by section

GET /api/settings/remote returns an object with the sections startup, artNet, location, cache, osc, timecode, access.

To make a change, read the object, change the needed fields of the section and send the whole section with the corresponding POST. This is not a PATCH: omitted fields may reset to default values. A successful response is 200 with the actual settings of the section.

Method Modifiable fields and constraints
POST /api/settings/startup runOnWindowsStart, openProjectOnStartup, projectFilename, startSchedulerOnStartup, enableArtNetOnStartup, hideUiOnAutoLoadFile, autoPlayTimelineOnProjectOpen, autosaveEnabled, autosaveIntervalMinutes (1–1440), autosaveBackupCount (1–1000), showFPS. The other listed switches are boolean.
POST /api/settings/artnet enabled, physicalAddress, fps (1–240), sendWorkers (0–32), sync, dontTouchAutomatically, projectId. Keep the projectId from the last GET; when the project changes, re-read the settings.
POST /api/settings/location name, address, latitude (−90…90), longitude (−180…180). Rebuilds the schedule taking the geolocation into account.
POST /api/settings/cache cacheVideoSequence, cachedFrames (10–100000), limitGb (10–100000).
POST /api/settings/osc enabled, inputPort, feedbackPort (ports 1–65535), feedbackIp (IPv4), autoIp.
POST /api/settings/timecode allInterfaces, physicalAddress, outputEnabled.

Read-only fields: location.sunrise, location.sunset, location.timeZone; cache.folder, cache.usedBytes, cache.freeBytes; osc.running. Sending these fields back will not change them. Cache sizes in responses are in bytes; freeBytes:-1 means the free space is unknown. location.timeZone reports the Windows time zone; a location POST does not change it.

When openProjectOnStartup is enabled, the projectFilename path must be the full path of an existing .ls on the LS4 computer. sync is the project's ArtSync setting; for it to be stored in the .ls, save the project.

An example of changing only the Art-Net frame rate via PowerShell after logging in as described in the connection instructions:

$settings = Invoke-RestMethod -Uri "$base/api/settings/remote" -WebSession $ls4
$artnet = $settings.artNet
$artnet.fps = 30
$body = $artnet | ConvertTo-Json
Invoke-RestMethod -Uri "$base/api/settings/artnet" -Method Post -WebSession $ls4 `
    -ContentType 'application/json; charset=utf-8' `
    -Body ([System.Text.Encoding]::UTF8.GetBytes($body))

Apply errors have 400 with {"code":"..."}: ProjectMissing, AdapterMissing, ProjectChanged, InvalidValues, InvalidIp, ArtNetStartFailed, OscStartFailed, TimecodeStartFailed, RequestFailed. JSON range validation may return the standard validation error object. An unexpected error is 500 with code:RequestFailed. If a service fails to start, re-read the settings: some of the changes may have been applied.

Clearing the cache

POST /api/settings/cache/clear with the body {"confirmed":true} clears the cache and returns 200 with the cache section. With confirmed:false — 400, {"code":"ConfirmationRequired"}. In a client interface, ask the operator for this confirmation before sending the command.

Credentials and QR code

POST /api/settings/access accepts:

{
  "login":"operator",
  "tokenLifetimeMinutes":60,
  "currentPassword":"CURRENT_PASSWORD",
  "newPassword":"NEW_PASSWORD"
}

login is a non-empty string of up to 128 characters; tokenLifetimeMinutes is 1–10080, the lifetime of QR tokens in minutes. When changing the login or passing a new password, the correct currentPassword is required; passwords are up to 256 characters. To change only the lifetime, pass the current login, and the password fields can be omitted. An empty/missing newPassword leaves the password unchanged.

The 200 response: {"settings":{"login":"operator","tokenLifetimeMinutes":60},"credentialsChanged":true}. When the credentials change, old sessions will no longer pass validation and QR tokens are revoked. Log in again. Errors: 400 with code:CurrentPasswordIncorrect or code:InvalidValues.

POST /api/settings/access/qr without a body creates a QR link. The 200 response: url, image (PNG as a data URL), expires (UTC time). The link allows logging in without entering a password and is used once; it is intended to be handed to a specific operator.

General settings, theme and language

Method and path Body/response
GET /api/settings The general object: runOnWindowsStart, openProjectOnStartup, projectStartupFilename, startSchedulerOnStartup, enableArtNetOnStartup, hideUiOnAutoLoadFile, showFPS, darkTheme.
POST /api/settings The full object of the same form; 204.
GET /api/settings/theme Without login: {"darkTheme":true}.
POST /api/settings/theme {"darkTheme":true}; 204.
GET /api/settings/language Without login: {"culture":"ru"} for the language of the current request.
POST /api/settings/language {"culture":"ru"}; 204 and a language cookie. An unsupported code — 400.

In /api/settings the autoload path is called projectStartupFilename, while in /api/settings/startup it is projectFilename. These schemas cannot be substituted for one another.

Language codes: en, zh, zh-Hant, it, de, fr, es, ja, ko, pt, pl, tr, ar, ru. The language cookie changes the language of the given browser/session, independently of the desktop interface and other browsers.

System monitoring

Method and path 200 response
GET /api/system/fps {"fps":60} — the current frame rate.
GET /api/system/uptime application, server — the running times of the application and the web server; the server may be null.
GET /api/system/info buildVersion, licenseKey, licenseExpires, universes, processor, video, ram, windowsVersion.
GET /api/system/metrics A snapshot of load, temperatures and performance, see below.
GET /api/system/history?metric=0&hours=24 The history of the selected metric.

uptime and the corresponding metric fields are duration strings of the form 01:23:45 or 1.01:23:45 (days before hours), not a number of seconds. licenseExpires, when the date is recognized, has the format dd-MM-yyyy. licenseKey contains license data: do not include the full /info response in public integration logs.

/metrics fields

Fields Units and meaning
timestamp The snapshot time with a time zone offset.
cpuPercent, gpuPercent, ramPercent, diskPercent Load percentages.
memoryUsedBytes, memoryTotalBytes Memory in bytes.
cpuTemperature, gpuTemperature Temperature in °C.
cpuTemperatureStatus 0 — pending; 1 — available; 2 — no driver; 3 — access denied; 4 — no sensor; 5 — service unavailable.
networkReceiveMbps, networkSendMbps Receive and send in megabits per second.
fps, targetFps, droppedFrames The current/target rate and the number of dropped frames.
applicationUptime, serverUptime Running times.
drives An array of drives: name, label, usedBytes, totalBytes, bytesPerSecond.

Unavailable numeric readings may be null; this is not zero. If there is no snapshot yet or it is older than 5 seconds, the server returns 503.

Load history

metric: 0 — CPU, 1 — GPU, 2 — RAM, 3 — disk. hours: only 1, 6 or 24; by default metric=0, hours=24.

An exact range can be specified: GET /api/system/history?metric=0&from=...&to=.... from and to are Unix time in seconds, set together; from>=0, to>from, the range is no longer than 86400 seconds, and to is no more than 2 seconds ahead of the current time. If hours is also passed, it must also be valid. Invalid parameters — 400.

Response: from, to, bucketSeconds, persisted, average, maximum, samples, points, availableFrom, availableTo, timeZone. Each point contains timestamp, average, maximum, samples. Timestamps are Unix seconds; bucketSeconds is the length of the averaging interval.

Device diagnostics

These methods return the same data that the “Diagnostics” page of the web control panel shows; that page also explains what the device states and problems mean.

Method and path Result
GET /api/diagnostics/summary problemCount, offlineCount, total, stamp.
GET /api/diagnostics/status engine, devices, events, problemCount, offlineCount, total, stamp, nowUtc.
POST /api/diagnostics/poll Request an out-of-turn poll, 204; then re-read the status.
POST /api/diagnostics/locate/{uid} Send the device identification command, 204; an invalid GUID — 400 with error:bad-uid, no address — 400 with error:no-address.

For locate, use devices[].uid from the status. Diagnostics events: timeUtc, kind, uid, device, detail; up to 100 events are returned.

engine fields: running, suppressedReason, overloaded, ticksPerSecond, targetFps, workers, universesInProject, foreignSenders, pollIntervalSeconds, offlineAfterSeconds, lastPollUtc, pollsSent, pollError, listenerError. foreignSenders contains third-party senders: address, name, universes (numbered from one), packetsPerSecond.

Device fields: uid, kind, iconKey, outputStatus, name, owner, ip, mac, startUniverse, universeCount, ports, presence, lastSeenUtc, offlineSinceUtc, replyName, firmware, nodeReport, sendError, subnetWarning, issues. For initial monitoring, use the summary counters, sendError and the issues list; the kind, outputStatus, presence fields are transmitted as numbers.

Field Values
kind 1 — converter, 2 — Player.
outputStatus 1 — running, 2 — paused, 3 — stopped, 4 — error.
presence 0 — unknown, 1 — responding, 2 — not responding, 3 — not bound to an address, 4 — not polled (for example, sACN).
issues An array of codes: offline, send-error, subnet, unlinked, duplicate-ip.

Two-server redundancy

Method and path Body/result
GET /api/redundancy/status The state of the local server, the partner and the project transfer.
GET /api/redundancy/settings The current redundancy settings.
POST /api/redundancy/settings The full settings object; 200 with the values actually applied.
POST /api/redundancy/takeover No body: request the broadcast for the current server. 204.
POST /api/redundancy/release No body: release the broadcast. 204.
POST /api/redundancy/send-project?media=false No body: start transferring the project to the partner; media=true — with media. 204, completion is checked via the status.

When rejected, the commands return 400 with {"error":"..."}. Settings:

Field Meaning
enabled Enable redundancy.
role 1 — primary, 2 — backup.
peerAddress The IP or name of the partner.
port The common UDP/TCP redundancy port number, 6473 by default. Allowed 1024–65535; an invalid number is replaced with 6473.
sharedKey The pair's shared key. It is also returned on read; do not publish responses with the real key.
heartbeatMs The exchange period in ms, 200–10000; 1000 by default.
failoverMs The switchover threshold in ms, no less than 1000 and two heartbeat periods, maximum 120000; 5000 by default.
autoFailback Automatic return of the broadcast to the primary server.
failbackDelayMs The return delay in ms, 0–600000; 10000 by default.

The server normalizes the ranges, so use the values from the POST response. Enabled redundancy requires peerAddress; otherwise 400 with error:peer-address.

Status fields: settings, local, peer (may be null), peerKnown, peerOnline, peerSilentSeconds, peerLastSeenUtc, reason, projectsMatch (may be null), outputSuppressed, socketError, transfer, events, nowUtc.

local/peer objects: host, address, version, role, state, artNetRunning, artNetTicksPerSecond, projectName, projectPath, projectHash, projectModifiedUtc, playing, fps, uptimeSeconds, manualStandby. state values: 0 — redundancy off, 1 — starting/waiting, 2 — active, 3 — standby.

The transfer object: phase (0 — no transfer, 1 — packing, 2 — sending, 3 — finished, 4 — error), fileName, bytesSent, bytesTotal, percent, error, finishedUtc. The events events: timeUtc, kind, detail, up to 60 entries.

Log and reboot

Method and path Result
GET /api/log 200: total and an entries array with the fields date, level, message.
GET /api/log/download A text file log.txt, text/plain; charset=utf-8.
POST /api/log/clear Clear the log, 204; no body.
POST /api/system/reboot Immediately restart Windows on the LS4 computer, no body and no additional confirmation parameter.

For reboot, the normal response is 204, a command launch error is 500; the connection may drop because of the restart. This is a restart of the whole computer, not just the application. Provide an explicit operator confirmation in your client. Log read/clear errors may return 500 with a text message.