Skip to main content
Device owners can change or remove an access code outside Seam, for example in the lock manufacturer’s app or on the lock itself. What Seam does next depends on allow_external_modifications on the access code. Seam treats these changes as external modifications:
  • The PIN changed.
  • The schedule changed.
  • The code was removed.
  • The code was deactivated: it is still on the device but disabled or suspended. Only some lock providers support this.
A changed name is not an external modification. Lock providers often shorten or change names, so Seam cannot tell a change made outside Seam from one the provider made. To allow external modifications, set allow_external_modifications to true when you create or update an access code, or when you convert an unmanaged access code to managed. For an example request, see Managing Access Codes in Manufacturer Apps.

Codes That Do Not Allow External Modifications

By default, Seam keeps the access code on the device the way it is on Seam, and undoes changes made outside Seam.
  1. When Seam detects that the PIN or schedule was changed, or that the code was removed or deactivated, it adds a conflicting_external_modifications error to the access code and sets the code on the device back to the way it is on Seam. Seam sends no event at this point, and the access code itself does not change.
  2. Once the device has the code the way it is on Seam again, the error clears.
  3. If the device still does not match one hour after the error was added, Seam emits access_code.failed_to_revert_external_modifications. Seam keeps trying, and the error stays until the device matches.
access_code.failed_to_revert_external_modifications describes what is still different on the device:
  • For a changed PIN or schedule, modified_from holds the values Seam set, which should be on the device, and modified_to holds the values found on the device. Both are keyed by property: code, or starts_at and ends_at.
  • For a removed code, is_access_code_deleted_externally is true.
  • For a deactivated code, is_access_code_deactivated_externally is true.
Some device owners don’t expect their changes to be undone, so let them know that Seam resets codes changed or removed outside Seam, or allow external modifications.

Codes That Allow External Modifications

When a code allows external modifications, Seam follows what the device has.

Confirming a Removal

A code missing from the list a lock provider returns is not proof that it was deleted. Some providers briefly return an incomplete list while the codes are still on the lock. So when a code that allows external modifications goes missing, Seam waits up to one hour before treating it as removed:
  • While Seam waits, the access code is unchanged: it still reads as set on the device, with no errors, warnings or events. Seam does not program it onto the device again.
  • If the provider lists the code again, nothing changes.
  • If the code is still missing after the wait, Seam deletes it as described above.

Display Status

While an external modification is in effect, the access code’s display_status shows it: display_status is for showing to a person only. Do not build logic on it.

Events

If you are moving from access_code.modified_external_to_seam, access_code.deleted_external_to_seam, the external_modification_in_effect warning, or allow_external_modification, see Migrating to Access Code Lifecycle Events. See also Lifecycle of Access Codes and Troubleshooting Access Code Issues.