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

# Migrating to Access Code Lifecycle Events

> Learn how to migrate from the deprecated device-oriented access code events, errors, and warnings to the new lifecycle vocabulary.

Seam is replacing the device-oriented access code vocabulary—events, errors, and warnings named for device operations, like `access_code.set_on_device`—with an intent-oriented lifecycle vocabulary that tells you whether the access code will work as requested. See [Lifecycle Events](/docs/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes#lifecycle-events-reference) for what each new event means and the recommended action to take.

The existing device-oriented names are deprecated. Update your webhook handlers and error-handling logic to use the new names, using the mappings below.

## Events

| Deprecated event                            | Migrate to                                                                                                                                          |
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `access_code.set_on_device`                 | `access_code.issued`, or `access_code.code_changed` / `access_code.name_changed` / `access_code.time_frame_changed` for changes to an existing code |
| `access_code.scheduled_on_device`           | `access_code.issued`                                                                                                                                |
| `access_code.delay_in_setting_on_device`    | `access_code.delay_in_issuing` for initial programming, or `access_code.failed_to_update` for changes to an existing code                           |
| `access_code.failed_to_set_on_device`       | `access_code.failed_to_issue` for initial programming, or `access_code.failed_to_update` for changes to an existing code                            |
| `access_code.delay_in_removing_from_device` | `access_code.failed_to_remove`                                                                                                                      |
| `access_code.failed_to_remove_from_device`  | `access_code.failed_to_remove`                                                                                                                      |

## Errors

| Deprecated error code          | Migrate to                                                                                       |
| ------------------------------ | ------------------------------------------------------------------------------------------------ |
| `failed_to_set_on_device`      | `failed_to_issue` for initial programming, or `failed_to_update` for changes to an existing code |
| `failed_to_remove_from_device` | `failed_to_remove`                                                                               |

## Warnings

| Deprecated warning code         | Migrate to                   |
| ------------------------------- | ---------------------------- |
| `delay_in_setting_on_device`    | `delay_in_issuing`           |
| `delay_in_removing_from_device` | The `failed_to_remove` error |

## Migration Notes

* **Updates had no dedicated event before.** Editing an existing code's PIN, name, or time frame previously reused `access_code.set_on_device` and `access_code.failed_to_set_on_device`. The new `access_code.failed_to_update` event covers failed updates cleanly, so some traffic that fires `access_code.failed_to_set_on_device` today maps to `access_code.failed_to_update` going forward, not `access_code.failed_to_issue`.
* **One success event.** `access_code.set_on_device` and `access_code.scheduled_on_device` were two events for the same idea with different timings, and sometimes Seam would send only one and not the other. The single `access_code.issued` event supersedes both.
* **Removal failures map to `failed_to_remove`.** `access_code.failed_to_remove_from_device` now maps to `access_code.failed_to_remove`, which covers any case where the removal or deletion didn't go through and the code may remain active past `ends_at`.
* **Seam always keeps trying.** Even after an access code emits one of the failure events, Seam may still emit a success event, such as `access_code.issued`, if a retry is able to program the code.

## Next Steps

* [Lifecycle of Access Codes](/docs/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes)
* [Troubleshooting Access Code Issues](/docs/low-level-apis/smart-locks/access-codes/troubleshooting-access-code-issues)
* [Access Code Events Reference](/docs/api/access_codes/events)
