# events.subscribe

Source: https://docs.lightair.app/developers/remote-api/events.subscribe

> Chooses which events this connection gets; without a list, every event.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Session. Script plugins can't call it.

Events arrive as notifications: `{"jsonrpc": "2.0", "method": "event", "params": {"name", "data"}}`.

- `scene.program` `{id, name}`, `scene.list` `{scenes}`
- `record.state` `{active, paused, path, started_at, elapsed_ms}`, `stream.state` `{active, started_at, destinations}`, `vcam.state` `{active}`
- `output.changed`: one output's `kind` (`stream`, `record`, `clips`, `vcam`), `id`, `name` and its state as [output.list](/developers/remote-api/output.list) gives it
- `canvas.changed` `{id, change, name, width, height}` (`added`, `removed`, `renamed`, `resized`)
- `clip.saved` `{path, id, duration_ms, formats, thumbnail}`
- `audio.mute`, `audio.volume`, `object.visible`, `workspace.changed`
- `source.tally` (a Phone camera layer's `source`, `program`, `staged`, `live`)
- `panic.state`, `deck.changed`
- `editor.changed` `{project, canvas, revision, read_only}`, `editor.export` (as [editor.export.status](/developers/remote-api/editor.export.status) gives it)

While Lightair Live is connected, Lightair also sends `staging.state`, `chat.message`, `chat.removed`, `activity.item`, `issue.raised`, `issue.cleared`, `output.health` (once a second while live) and `scene.thumbnail`, and `audio.levels` 20 times a second. `audio.levels` goes only to connections that name it.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `events` | `string[]` | no | Event names. Without it, every event. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `events` | `string[] | null` | no | The events this connection gets; null for all. |

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "events.subscribe", "params": { "events": ["scene.program", "stream.state", "output.changed"] } }
```

Result:

```json
{ "events": ["scene.program", "stream.state", "output.changed"] }
```

## Related

- [auth.login](https://docs.lightair.app/developers/remote-api/auth.login.md)
- [state.get](https://docs.lightair.app/developers/remote-api/state.get.md)
