# Events

Events let you know when something interesting happens in your workspace. When an interesting event occurs, Seam creates a new `Event` object. For example, when a lock is unlocked, Seam creates a `lock.unlocked` event. When a device's battery level is low, Seam creates a `device.battery_low` event.

As with other API resources, you can use endpoints to retrieve an [individual event](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/events/get) or a [list of events](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/events/list). Seam also provides a separate [webhook](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/developer-tools/webhooks) system for sending the `event` objects directly to an endpoint on your sever. Manage webhooks through the [Seam Console](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/seam-console). For details, see [Webhooks](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/developer-tools/webhooks).

***

## `event` Properties

The following sections list the properties for events pertaining to various types of resources:

### Common Event Properties

| Property               | Type                             | Description                                                                  |
| ---------------------- | -------------------------------- | ---------------------------------------------------------------------------- |
| `event_id`             | String                           | Unique identifier for the `event`.                                           |
| `event_type`           | See [Event Types](#event-types). | Type of event.                                                               |
| `created_at`           | String                           | Time at which the `event` was created. Displayed in an ISO8601 string.       |
| `workspace_id`         | String                           | Unique identifier for the `workspace` to which the `event` belongs.          |
| `connected_account_id` | String                           | The unique identifier of the connected account to which this event pertains. |

### Common Device Event Properties

In addition to the common event properties, the following properties are available for all events that pertain to devices:

| Property    | Type   | Description                                                    |
| ----------- | ------ | -------------------------------------------------------------- |
| `device_id` | String | Unique identifier for the `device` that triggered the `event`. |

### Access Code Event Properties

In addition to the common event properties and common device event properties, the following properties are available for events that pertain to access codes:

| Property         | Type   | Description                                                                                                                             |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| `access_code_id` | String | Present on all of the `access_code.*` events. Specifies the unique identifier of the access code to which the event pertains.           |
| `code`           | String | Only present on `access_code.set_on_device` and `access_code.scheduled_on_device` events. Specifies the code digits for an access code. |

### Lock Event Properties

In addition to the common event properties and common device event properties, the following properties are available for events that pertain to lock actions:

| Property         | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `method`         | Enum   | <p>Present on <code>lock.locked</code> and <code>lock.unlocked</code> events. Specifies the method used to perform the lock or unlock action.</p><p>Supported values for <code>lock.unlocked</code>:</p><ul><li><code>keycode</code></li><li><code>manual</code></li><li><code>unknown</code></li><li><code>seamapi</code></li></ul><p>Supported values for <code>lock.locked</code>:</p><ul><li><code>keycode</code></li><li><code>manual</code></li><li><code>unknown</code></li><li><code>seamapi</code></li><li><code>automatic</code> (for <a href="../device-and-system-integration-guides/kwikset-locks">Kwikset</a> and <a href="../device-and-system-integration-guides/igloohome-locks">igloohome</a> only)</li></ul> |
| `access_code_id` | String | <p>Specifies the unique identifier of the access code used to trigger this event. Seam includes this ID in the event if the affected device returns this information.<br>For a list of device manufacturers that send the <code>access\_code\_id</code> in lock events, see <a href="../../capability-guides/smart-locks/access-codes#linking-unlock-events-and-access-codes">Linking Unlock Events and Access Codes</a>.</p>                                                                                                                                                                                                                                                                                                   |

### Device Battery Event Properties

In addition to the common event properties and common device event properties, the following properties are available for `device.low_battery` and `device.battery_status_changed` events:

| Property        | Type         | Description                                                                               |
| --------------- | ------------ | ----------------------------------------------------------------------------------------- |
| `battery_level` | Number (0-1) | Determines the battery level of the device. Only present on a `device.low_battery` event. |

### Device Battery Status Event Properties

In addition to the device battery event properties, the following properties are available for `device.battery_status_changed` events:

| Property         | Type                                    | Description                                      |
| ---------------- | --------------------------------------- | ------------------------------------------------ |
| `battery_status` | `critical` or `low` or `good` or `full` | Specifies the new battery status for the device. |

### Device Disconnected Event Properties

In addition to the common event properties and common device event properties, the following properties are available for `device.disconnected` events:

| Property     | Type                                                                  | Description                                                                                     |
| ------------ | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `error_code` | `account_disconnected` or `hub_disconnected` or `device_disconnected` | Only present on a `device.disconnected` event. A code to indicate the reason for disconnection. |

### Noise Sensor Event Properties

Noise sensors emit an event whenever a predefined noise threshold has been exceeded. Seam tracks any noise thresholds that have been set in the user's app or built-in thresholds to the noise sensor. To see what thresholds are available, query `/noise_sensors/noise_thresholds/list`.

| Property               | Type                                               | Description                                                                                                      |
| ---------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `noise_threshold_id`   | String                                             | Identifier for the noise threshold, pass to `/noise_sensors/noise_thresholds/get`                                |
| `noise_threshold_name` | String, for example, `"builtin_first_disturbance"` | Name of the threshold, this can be set via `/noise_sensors/noise_thresholds/create` or by the user in their app. |

### Thermostat Event Properties

In addition to the common event properties and common device event properties, the following properties are available for thermostat events:

| Property                         | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `thermostat_schedule_id`         | String        | ID of the [thermostat schedule](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/creating-and-managing-thermostat-schedules). Present for `thermostat.climate_preset_activated` events.                                                                                                                                                                                                                             |
| `climate_preset_key`             | String        | Key of the [climate preset](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/creating-and-managing-climate-presets). Present for `thermostat.climate_preset_activated` events.                                                                                                                                                                                                                                      |
| `is_fallback_climate_preset`     | Boolean       | Indicates whether the [climate preset](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/creating-and-managing-climate-presets) is the [fallback climate preset](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) for the thermostat. Present for `thermostat.climate_preset_activated` events. |
| `method`                         | String (enum) | Method used to adjust the thermostat manually. Possible values are `seam` and `external`. `seam` indicates that the Seam API, Seam CLI, or Seam Console was used to adjust the thermostat. Present for `thermostat.manually_adjusted` events.                                                                                                                                                                                                                 |
| `temperature_celsius`            | Number        | Temperature, in °C, reported by the thermostat. Present for `thermostat.temperature_threshold_exceeded` and `thermostat.temperature_threshold_no_longer_exceeded` events.                                                                                                                                                                                                                                                                                     |
| `temperature_fahrenheit`         | Number        | Temperature, in °F, reported by the thermostat. Present for `thermostat.temperature_threshold_exceeded` and `thermostat.temperature_threshold_no_longer_exceeded` events.                                                                                                                                                                                                                                                                                     |
| `desired_temperature_celsius`    | Number        | Desired temperature, in °C, defined by the thermostat's cooling or heating [set point](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/understanding-thermostat-concepts/set-points). Present for `thermostat.temperature_reached_set_point` events.                                                                                                                                                               |
| `desired_temperature_fahrenheit` | Number        | Desired temperature, in °F, defined by the thermostat's cooling or heating [set point](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/understanding-thermostat-concepts/set-points). Present for `thermostat.temperature_reached_set_point` events.                                                                                                                                                               |
| `upper_limit_celsius`            | Number        | Upper temperature limit, in °C, defined by the set [threshold](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). Present for `thermostat.temperature_threshold_exceeded` and `thermostat.temperature_threshold_no_longer_exceeded` events.                                                                                                                           |
| `upper_limit_fahrenheit`         | Number        | Upper temperature limit, in °F, defined by the set [threshold](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). Present for `thermostat.temperature_threshold_exceeded` and `thermostat.temperature_threshold_no_longer_exceeded` events.                                                                                                                           |
| `lower_limit_celsius`            | Number        | Lower temperature limit, in °C, defined by the set [threshold](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). Present for `thermostat.temperature_threshold_exceeded` and `thermostat.temperature_threshold_no_longer_exceeded` events.                                                                                                                           |
| `lower_limit_fahrenheit`         | Number        | Lower temperature limit, in °F, defined by the set [threshold](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds). Present for `thermostat.temperature_threshold_exceeded` and `thermostat.temperature_threshold_no_longer_exceeded` events.                                                                                                                           |

***

## Event Types

| Event Name                                            | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `access_code.created`                                 | An `access_code` has been created.                                                                                                                                                                                                                                                                                                                                                                          |
| `access_code.changed`                                 | An `access_code` [status](https://github.com/seamapi/docs/blob/main/docs/api-clients/access-codes/README.md#access_code-properties) has changed.                                                                                                                                                                                                                                                            |
| `access_code.scheduled_on_device`                     | For native scheduled codes (see [Native Scheduling](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/smart-locks/access-codes#native-scheduling)), this event is sent when an `access_code` has been pre-programmed onto a device. An `access_code.set_on_device` is sent when the code is actually active.                                                                   |
| `access_code.set_on_device`                           | An `access_code` has been programmed onto a device.                                                                                                                                                                                                                                                                                                                                                         |
| `access_code.backup_access_code_pulled`               | A backup `access_code` has been pulled.                                                                                                                                                                                                                                                                                                                                                                     |
| `access_code.removed_from_device`                     | An `access_code` has been removed from a device.                                                                                                                                                                                                                                                                                                                                                            |
| `access_code.deleted`                                 | Seam has deleted the access code because it is at the end of its lifecycle (it is not on the device and is not supposed to be active in the future) Future requests to this access\_code will `404`                                                                                                                                                                                                         |
| `access_code.delay_in_setting_on_device`              | There was a longer than expected delay in programming an access code onto a device. For time bound codes, this is sent when the code is not set by the `starts_at` time. This is not necessarily a failure as the code might successfully be set even after this event is sent.                                                                                                                             |
| `access_code.failed_to_set_on_device`                 | An error occurred in trying to program the code onto a device. This indicates a failure occurred but the failure might be temporary and may recover (in which case an `access_code.set_on_device` event will be sent).                                                                                                                                                                                      |
| `access_code.delay_in_removing_from_device`           | There was a longer than expected delay in removing an access code from a device. This is not necessarily a failure as the code might successfully be removed even after this event is sent.                                                                                                                                                                                                                 |
| `access_code.failed_to_remove_from_device`            | An error occurred in trying to remove an access code from a device. This indicates a failure occurred but the failure might be temporary and may recover (in which case an `access_code.removed_from_device` event will be sent).                                                                                                                                                                           |
| `access_code.modified_external_to_seam`               | When we detect that an access code was modified external to Seam after we successfully set it on the device, we will send this event.                                                                                                                                                                                                                                                                       |
| `access_code.deleted_external_to_seam`                | When we detect that an access code was deleted external to Seam after we successfully set it on the device, we will send this event.                                                                                                                                                                                                                                                                        |
| `access_code.unmanaged.converted_to_managed`          | Successfully converted an unmanaged access code to a managed access code.                                                                                                                                                                                                                                                                                                                                   |
| `access_code.unmanaged.failed_to_convert_to_managed`  | Failed to converted an unmanaged access code to a managed access code.                                                                                                                                                                                                                                                                                                                                      |
| `access_code.unmanaged.created`                       | An unmanaged `access_code` has been created.                                                                                                                                                                                                                                                                                                                                                                |
| `access_code.unmanaged.removed`                       | An unmanaged `access_code` has been removed.                                                                                                                                                                                                                                                                                                                                                                |
| `connected_account.created`                           | A connected account has been imported into your Seam workspace.                                                                                                                                                                                                                                                                                                                                             |
| `connected_account.connected`                         | Seam has established connection to or is reconnected to a connected account.                                                                                                                                                                                                                                                                                                                                |
| `connected_account.disconnected`                      | Seam has lost connection to a connected account. Please ask the account owner to sign in to their account through a new connect webview again.                                                                                                                                                                                                                                                              |
| `connected_account.deleted`                           | A connected account has been deleted from your Seam workspace.                                                                                                                                                                                                                                                                                                                                              |
| `connected_account.completed_first_sync`              | Seam has finished the first sync of a connected account, and the corresponding devices or systems are now available.                                                                                                                                                                                                                                                                                        |
| `connect_webview.login_succeeded`                     | <p>A login using a Connect Webview was completed successfully.</p><p>Sent even if the account was previously connected and a separate Connect Webview login was completed.</p>                                                                                                                                                                                                                              |
| `connect_webview.login_failed`                        | A login using a Connect Webview failed.                                                                                                                                                                                                                                                                                                                                                                     |
| `device.accessory_keypad_connected`                   | An accessory keypad has been connected to a device.                                                                                                                                                                                                                                                                                                                                                         |
| `device.accessory_keypad_disconnected`                | An accessory keypad has been disconnected from a device.                                                                                                                                                                                                                                                                                                                                                    |
| `device.added`                                        | A device was added to Seam or was re-added to Seam after having been removed.                                                                                                                                                                                                                                                                                                                               |
| `device.connected`                                    | <p>The status of a device changed from offline to online. That is, the <code>device.properties.online</code> property changed from <code>false</code> to <code>true</code>.<br>Note that some devices operate entirely in offline mode, so Seam never emits a <code>device.connected</code> event for these devices.</p>                                                                                    |
| `device.disconnected`                                 | The status of a device changed from online to offline. That is, the `device.properties.online` property changed from `true` to `false`.                                                                                                                                                                                                                                                                     |
| `device.removed`                                      | A device was removed externally from the [connected account](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/connected-accounts).                                                                                                                                                                                                                                                |
| `device.deleted`                                      | A device was deleted from its connected account using the following Seam actions: `/connected_accounts/delete` or `/devices/delete`.                                                                                                                                                                                                                                                                        |
| `device.low_battery`                                  | The battery level of the device drops below the low battery level threshold.                                                                                                                                                                                                                                                                                                                                |
| `device.battery_status_changed`                       | The battery status for the device has changed (for example, it changed from `good` to `low`).                                                                                                                                                                                                                                                                                                               |
| `device.tampered`                                     | A device detects that someone has opened up its case, or has moved the device.                                                                                                                                                                                                                                                                                                                              |
| `device.connection_became_flaky`                      | A device connection has become flaky.                                                                                                                                                                                                                                                                                                                                                                       |
| `device.salto.privacy_mode_activated`                 | The privacy mode has been activated on the Salto device.                                                                                                                                                                                                                                                                                                                                                    |
| `device.salto.privacy_mode_deactivated`               | The privacy mode has been deactivated on the Salto device.                                                                                                                                                                                                                                                                                                                                                  |
| `device.third_party_integration_detected`             | A third party integration has been detected on the device.                                                                                                                                                                                                                                                                                                                                                  |
| `device.unmanaged.connected`                          | The status of an [unmanaged device](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/devices/managed-and-unmanaged-devices) changed from offline to online. That is, the `device.properties.online` property changed from `false` to `true`.                                                                                                                                      |
| `device.unmanaged.disconnected`                       | The status of an [unmanaged device](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/core-concepts/devices/managed-and-unmanaged-devices) changed from online to offline. That is, the `device.properties.online` property changed from `true` to `false`.                                                                                                                                      |
| `device.converted_to_unmanaged`                       | Successfully converted a managed device to an unmanaged device.                                                                                                                                                                                                                                                                                                                                             |
| `device.unmanaged.converted_to_managed`               | Successfully converted an unmanaged device to a managed device.                                                                                                                                                                                                                                                                                                                                             |
| `lock.locked`                                         | A door lock has been locked.                                                                                                                                                                                                                                                                                                                                                                                |
| `lock.unlocked`                                       | A door lock has been unlocked.                                                                                                                                                                                                                                                                                                                                                                              |
| `lock.access_denied`                                  | An incorrect access code was entered one or more times in a row on a device ([Kwikset](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/device-and-system-integration-guides/kwikset-locks#kwikset-access-denied-event) and [igloohome](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/device-and-system-integration-guides/igloohome-locks#igloohome-access-denied-event) only). |
| `noise_sensor.noise_threshold_triggered`              | The noise detected from a noise sensor exceeded a predefined threshold and/or duration.                                                                                                                                                                                                                                                                                                                     |
| `thermostat.climate_preset_activated`                 | A thermostat [climate preset](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/creating-and-managing-climate-presets) was activated.                                                                                                                                                                                                                              |
| `thermostat.manually_adjusted`                        | A thermostat was adjusted manually.                                                                                                                                                                                                                                                                                                                                                                         |
| `thermostat.temperature_changed`                      | A thermostat's reported temperature changed by at least 1 °C.                                                                                                                                                                                                                                                                                                                                               |
| `thermostat.temperature_threshold_exceeded`           | A thermostat's temperature reading exceeded the set [threshold](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds).                                                                                                                                                                                                  |
| `thermostat.temperature_threshold_no_longer_exceeded` | A thermostat's temperature reading no longer exceeds the set [threshold](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds).                                                                                                                                                                                         |
| `thermostat.temperature_reached_set_point`            | A thermostat's temperature reading is within 1 °C of the configured cooling or heating [set point](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/capability-guides/thermostats/understanding-thermostat-concepts/set-points).                                                                                                                                                                |

***

## List of Methods

| [List Events](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/events/list) | List and filter events           |
| ------------------------------------------------------------------------------------------- | -------------------------------- |
| [Get an Event](https://docs.seam.co/latest/~/revisions/DFdrUdS2jQOnbJTNDT5a/api/events/get) | Get data for an individual event |

***
