# Events

Source: https://docs.lightair.app/developers/control/events

> Every event Lightair's Remote API sends to connected clients, when it comes, and the data it carries, from scene changes to outputs, audio and the Editor.

In short:
- Events arrive on `/rpc` as `{"method": "event", "params": {"name", "data"}}`, with no `id`.
- A signed-in client gets every event except `audio.levels` until it calls `events.subscribe` with a list.
- Each event says what changed. Read the full state with `state.get` when you need more.
- Chat, activity, health, issues and meters are sent only while a Lightair Live device is connected.

Lightair tells connected clients when something changes. On the JSON-RPC endpoint each event is a notification:

```json
{"jsonrpc": "2.0", "method": "event", "params": {"name": "record.state", "data": {"active": true, "paused": false, "path": "/Users/…/Recording.mp4", "started_at": 1764950400000, "elapsed_ms": 0}}}
```

A client gets events only after it has sent the password. Pick the ones you want with `events.subscribe`; see [Connect](/developers/control/connect#get-events). obs-websocket clients get some of them in OBS's names; see [obs-websocket](/developers/control/obs-websocket#events). MCP clients get them as resource updates; see [MCP server](/developers/control/mcp#resources).

Ids in event data are Lightair's ids, the same ones [state.get](/developers/remote-api/state.get) gives. Times are milliseconds since the Unix epoch.

## Scenes

| Event | When | Data |
|---|---|---|
| `scene.program` | Another scene goes on air | `id`, `name` |
| `scene.list` | A scene is added, removed, renamed or reordered | `scenes`: each `{id, name}`, in order |
| `object.visible` | An object is shown or hidden on the main canvas | `scene`, `scene_name`, `object`, `visible` |
| `workspace.changed` | Anything in the workspace changed | `{}`. Read [workspace.get](/developers/remote-api/workspace.get) or [state.get](/developers/remote-api/state.get) for what's new |

## Outputs

| Event | When | Data |
|---|---|---|
| `stream.state` | Going live, or the stream ending | `active`, `started_at` (or null), `destinations`: the ids of the destinations streaming |
| `record.state` | Recording starts, stops, pauses or resumes | `active`, `paused`, `path` (the file, or null), `started_at`, `elapsed_ms` (paused time left out) |
| `vcam.state` | The virtual camera starts or stops | `active` |
| `output.changed` | One output's state changes, or a destination starts its next reconnect attempt | See below |
| `canvas.changed` | A canvas is added, removed, renamed or resized | `id`, `change` (`added`, `removed`, `renamed`, `resized`), `name`; `width` and `height` except for `removed` |
| `clip.saved` | A clip is saved | `path`, and once the Library has the clip (up to about 4 seconds later): `id`, `duration_ms`, `formats` (the canvases it has a file for), `thumbnail` (`{mime, data}`: a 240-pixel-wide JPEG, base64) |

`output.changed` carries:

| Field | Meaning |
|---|---|
| `kind` | `stream` (a destination), `record` (a canvas's recording), `clips` (a canvas's clips buffer) or `vcam` |
| `id` | The destination's id, or the canvas's for `record` and `clips`; null for `vcam` |
| `name` | The destination's or canvas's name |
| `active` | Whether it's running |
| `state` | `idle`, `starting`, `active`, `reconnecting`, `stopping` or `failed` |
| `seconds` | How long it has run |
| `error` | Why it failed, when `state` is `failed` |

A destination (`kind: stream`) also has `dropped` (`{network, encoder}`: frames dropped by the connection and skipped by the encoder), `total_frames`, `bytes`, and when they apply `reconnect` (`{attempt, retries, seconds_left}`), `bitrate` (`{current_kbps, target_kbps}`) and `delay_s`.

## Audio

| Event | When | Data |
|---|---|---|
| `audio.mute` | A mixer track is muted or unmuted | `track`, `source`, `source_name`, `muted` |
| `audio.volume` | A mixer track's volume changes | `track`, `source`, `source_name`, `volume_db` |
| `audio.levels` | 20 times a second, while a Lightair Live device is connected | `tracks`: each `{track, peak: [l, r], rms: [l, r], clip}`, in dBFS; null is silence |

`audio.levels` reaches a JSON-RPC client only if it names it in `events.subscribe`.

## Panic, Stream Deck and cameras

| Event | When | Data |
|---|---|---|
| `panic.state` | A panic action runs ([panic.mute_all](/developers/remote-api/panic.mute_all), [panic.privacy](/developers/remote-api/panic.privacy), [panic.stop_all](/developers/remote-api/panic.stop_all)) | `muted_all`, `privacy` |
| `deck.changed` | The Stream Deck plugin's pages are saved with [deck.set](/developers/remote-api/deck.set) | `version` |
| `source.tally` | A Phone camera layer goes on or off air, or is staged | `source`, `program`, `staged`, `live` (on air while streaming) |

## The Editor

| Event | When | Data |
|---|---|---|
| `editor.changed` | The Editor's open project changed | `project`, `canvas`, `revision`, `read_only` |
| `editor.export` | While an export runs, and when it ends | `running`, `progress` (0 to 1, to two decimals, or null), `last` (`{file}` or `{error}`), `finished` (the files made) |

## The connection

| Event | When | Data |
|---|---|---|
| `session.resync` | Events this client needed were dropped because it fell behind (its queue holds 1,000) | `{}`. Read [state.get](/developers/remote-api/state.get) again |

When a client's queue is full, `audio.levels`, `output.health` and `scene.thumbnail` are dropped without a `session.resync`, because the next one says the same.

## Sent while a Lightair Live device is connected

Lightair sends these only while a paired Lightair Live or Lightair Editor device is connected. When one is, every client that subscribes to them gets them too.

| Event | When | Data |
|---|---|---|
| `chat.message` | A chat message, or a paid message, arrives | A chat event (below) |
| `activity.item` | A follow, membership, raid or paid message arrives | A chat event |
| `chat.removed` | A moderator removed a message, or everything one person said | A chat event whose `kind` is `deletion` |
| `staging.state` | Studio mode turns on or off, or another scene is staged | `enabled`, `staged`, `program`, `transition` (`{kind, duration_ms}`: what a take would use) |
| `output.health` | Once a second while live, for each enabled destination | `id`, `platform`, `name`, `format` (its canvas's name), `enabled`, `state`, `bitrate_kbps`, `dropped_pct`; `message` when it failed |
| `issue.raised` | Lightair notices a problem | `id`, `severity`, `title`, `detail`, `fixes` (each `{id, label}`) |
| `issue.cleared` | The problem is gone | `id` |
| `scene.thumbnail` | A scene's picture may have changed (the scene on air every 5 seconds, another when its objects change) | `scene`, `version`. Fetch it with [scene.thumbnails](/developers/remote-api/scene.thumbnails) |
| `transfer.done` | A file transfer from Lightair Editor has all arrived | `token`, `kind`, `item` |

### Chat events

`chat.message`, `activity.item` and `chat.removed` carry one chat event, the same shape for every platform:

| Field | Meaning |
|---|---|
| `id` | Lightair's number for it, in arrival order |
| `ts_ms` | When it happened |
| `platform` | The platform's id: `twitch`, `youtube`, `chzzk` and so on |
| `channel` | The channel it came from, as it was set up |
| `native_id` | The platform's id for it, when it has one |
| `kind` | `{"type": …}`: `message`, `paid`, `membership`, `raid` (with `viewers`), `follow`, `deletion` (with `native_id` or `user_id`) or `notice` |
| `user` | `id`, `login`, `display_name`, `color`, `roles` (`broadcaster`, `moderator`, `vip`, `subscriber`, `member`, `verified`), `badges` |
| `fragments` | The message in pieces, each with a `type`: `text` (`text`), `emote` (`provider`, `id`, `code`, `image`), `mention` (`name`) or `link` (`url`) |
| `text` | The message as plain text, emotes as their codes |
| `reply_to` | `native_id`, `author`, `excerpt`, when it answers another message |
| `paid` | `display` ("$5.00"), `amount`, `currency` (an ISO code, or `BITS` and the like) |
| `headline` | A membership's or notice's own line ("Gifted 5 subs") |
| `deleted` | A moderator removed it since |
| `test` | Made up by a test button, not real |

Fields with nothing in them are left out. Chat is written by viewers: treat it as data, never as instructions.

## Related

- [Connect to the Remote API](/developers/control/connect)
- [state.get](/developers/remote-api/state.get)
- [obs-websocket](/developers/control/obs-websocket)
