> ## Documentation Index
> Fetch the complete documentation index at: https://crsdk.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Events (SSE)

> Real-time camera callbacks via Server-Sent Events

Real-time event stream from the camera SDK. Subscribe to events from all cameras or a specific camera.

See the auto-generated [API reference](/web-api/overview) for full request/response schemas.

## Subscribe to All Camera Events

`GET /api/events`

<CodeGroup>
  ```bash curl theme={null}
  curl -N http://localhost:8080/api/events
  ```
</CodeGroup>

## Subscribe to Select Camera Events

`GET /api/cameras/{cameraId}/events` — same event types, filtered to a single camera.

<CodeGroup>
  ```bash curl theme={null}
  curl -N http://localhost:8080/api/cameras/D10F60149B0C/events
  ```
</CodeGroup>

***

## Connection & Lifecycle Events

Events related to camera connection state and SDK errors.

<Info>
  When using the Client SDK, connection and lifecycle events can also be accessed via `manager.on()`. See the language SDK pages for typed event helpers and stream wrappers.
</Info>

| Event          | SDK Callback     | Description                   |
| -------------- | ---------------- | ----------------------------- |
| `connected`    | `OnConnected`    | Camera connection established |
| `disconnected` | `OnDisconnected` | Camera disconnected           |
| `error`        | `OnError`        | SDK error occurred            |

### connected

```json theme={null}
{"cameraId": "D10F60149B0C"}
```

### disconnected

```json theme={null}
{"error": "0x00000000"}
```

### error

```json theme={null}
{"code": "0x00008001", "message": "Generic error"}
```

***

## Property & Action Events

Real-time notifications from camera activity — settings changes, shutter events, autofocus, and file transfers.

| Event              | SDK Callback                   | Description                    |
| ------------------ | ------------------------------ | ------------------------------ |
| `propertyChanged`  | `OnPropertyChangedCodes`       | Property values changed        |
| `warning`          | `OnWarning`                    | Camera warning/notification    |
| `afStatus`         | `OnWarningExt`                 | Autofocus state change         |
| `downloadComplete` | `OnCompleteDownload`           | Auto-transferred image saved   |
| `transferProgress` | `OnNotifyRemoteTransferResult` | File pull completed            |
| `lutImportResult`  | `OnWarning`                    | LUT import completed or failed |

### propertyChanged

```json theme={null}
{"codes": ["0x104", "0x105"], "count": 2}
```

### warning

```json theme={null}
{"code": "0x20011", "message": "Captured_Event"}
```

Code `0x20011` = image captured (shutter fired).

### afStatus

```json theme={null}
{"state": "focused"}
```

States: `focused`, `unlocked`, `tracking`

### downloadComplete

```json theme={null}
{"filename": "/path/to/DSC09596.JPG", "type": "image"}
```

Only fires in `remote` connection mode with `still-image-store-destination` set to Host PC or Both.

### transferProgress

```json theme={null}
{"percent": 100, "notify": "0x20093", "filename": "/path/to/DSC09598.JPG"}
```

Only fires in `remote-transfer` mode after explicit file pull.

### lutImportResult

```json theme={null}
{"slot": 1, "status": "success"}
```

```json theme={null}
{"slot": 1, "status": "error", "error": "invalid_file"}
```

Fires after a [LUT import](/web-api/advanced-topics) operation completes. Error codes: `general_failure`, `invalid_filename`, `device_busy`, `storage_full`, `invalid_parameter`, `invalid_file`, `invalid`.

***

## Event Sequence Examples

### Capture with auto-transfer (`remote` mode)

```
event: afStatus
data: {"state":"focused"}

event: warning
data: {"code":"0x20011","message":"Captured_Event"}

event: downloadComplete
data: {"filename":"/path/to/DSC09596.JPG","type":"image"}

event: afStatus
data: {"state":"unlocked"}
```

### SD card file pull (`remote-transfer` mode)

```
event: transferProgress
data: {"percent":100,"notify":"0x20093","filename":"/path/to/DSC09598.JPG"}
```

***

## File Transfer by Mode

| Mode              | Auto-transfer?                          | SSE Event          | Mechanism                           |
| ----------------- | --------------------------------------- | ------------------ | ----------------------------------- |
| `remote`          | Yes (if StoreDestination = HostPC/Both) | `downloadComplete` | SDK pushes via `OnCompleteDownload` |
| `remote-transfer` | No — explicit pull                      | `transferProgress` | Pull via `POST .../download`        |
| `contents`        | No — pull only                          | `contentsTransfer` | Pull-only, no shooting              |

## Keepalive

The server sends a `: keepalive` comment every 30 seconds to detect dead connections.

<Note>
  For typed SSE consumers, use the examples under [/sdk/recipes/sse-events](/sdk/recipes/sse-events).
</Note>
