Skip to main content
Programming access codes involves asynchronous processes because Seam must communicate with smart devices and third-party applications outside your main application. Seam tracks each access code through its lifecycle for you. You can read an access code’s lifecycle from the access code object:
  • pending_mutations — the changes Seam is actively pushing to the device. Each entry carries a mutation_code: creating, deferring_creation, updating_code, updating_name, updating_time_frame, or deleting. An empty list means the device reflects the code’s requested state.
  • errors and warnings — problems Seam has encountered while working on the code. See Troubleshooting Access Code Issues.
  • starts_at and ends_at — the code’s intended active window. Codes without them are ongoing.
The access code status property is deprecated and will be removed. Do not build logic on it. Instead, read pending_mutations, errors, warnings, starts_at, and ends_at.
The access code display_status property is a human-readable label for showing a person where the code is in its lifecycle. Use it only for display. Its wording is not stable and is not an enumeration: it can change at any time, so never compare against it or branch on it. To make decisions, read pending_mutations, errors, warnings, starts_at, and ends_at.

Lifecycle Phases

A typical time-bound access code moves through these phases: Waiting to issue → Issuing → Upcoming → Active → Expired → Deleting → Deleted An ongoing code skips the schedule-related phases and goes straight from Issuing to Active. Errors and warnings can occur at any point — see Errors and Warnings below.

Waiting to Issue

Pending mutation: deferring_creation For natively-scheduled codes, Seam deliberately waits to program the code onto the device until close to the starts_at time. The deferring_creation pending mutation’s scheduled_at field tells you when Seam plans to begin programming.

Issuing

Pending mutation: creating Seam is actively programming the code onto the device. When programming succeeds, the mutation clears and Seam emits access_code.issued. If issuance is delayed: For a natively-scheduled code created well ahead of its starts_at, Seam sets the delay_in_issuing warning, emits access_code.delay_in_issuing, and keeps retrying when programming takes longer than expected. Notify the device owner to check the device and connected account. If the issue persists as starts_at approaches, pull a backup access code. Other codes are programmed too close to their start for an early warning, so they go straight to the failure below. If issuance fails: If the code isn’t on the device by its deadline, Seam sets the failed_to_issue error and emits access_code.failed_to_issue. The recipient may be locked out — pull a backup access code or arrange alternative access. Seam keeps retrying and clears the error if a retry succeeds.

Upcoming

The code’s starts_at time has not arrived yet, and Seam has no work pending on it. For natively-scheduled codes, Seam preloads the code onto the device ahead of the starts_at time, and the code waits on the device for its activation time.

Active

The code works on the device: no pending mutations, no errors, and the current time is within the code’s window (or the code is ongoing). When you receive access_code.issued, you can share the code with its intended recipient.

Expired

The code’s ends_at time has passed and the code no longer works on the device, but Seam has not deleted the access code object yet.

Updating

Pending mutation: updating_code, updating_name, or updating_time_frame You requested a change to the code’s PIN, name, or time frame (see Modifying Access Codes), and Seam is pushing it to the device.
  • access_code.mutations_requested fires at request time, before the change reaches the device.
  • When the device confirms the change, the pending mutation clears and Seam emits the matching event (access_code.code_changed, access_code.name_changed, or access_code.time_frame_changed), each carrying from and to values.
You can update a code only until it starts deleting. Seam rejects an update to a code that you deleted or that passed its ends_at. If the update fails: If the device doesn’t confirm the change by its deadline, Seam sets the failed_to_update error and emits access_code.failed_to_update. The code on the device does not match its requested state, and the recipient’s access may not work as expected. Pull a backup access code or arrange alternative access. Seam keeps retrying and clears the error once the update is applied.

Deleting

Pending mutation: deleting · warning: being_deleted The code is being taken off the device — because you deleted it or because its ends_at time was reached. Deletion is irreversible. Once a code is deleting, Seam rejects requests to update it with a resource_being_deleted error, including requests that move ends_at back into the future. The being_deleted warning on the access code tells you that it can no longer be updated. To grant access again, create a new access code. The deleting pending mutation’s is_code_usable field tells you whether the code can still unlock the device while Seam removes it, based on the last state Seam observed:
  • true — the code still works until Seam removes it. This is the case when you delete a code before its ends_at, or when the device does not enforce the code’s schedule itself.
  • false — the device has already stopped accepting the code, for example, because a natively-scheduled code passed its ends_at. Only cleanup remains.
If deletion fails: If the code may still be usable and Seam has not confirmed its removal by its deadline, Seam sets the failed_to_delete error and emits access_code.failed_to_delete. The recipient may still have access. Notify the device owner. Seam keeps retrying and clears the error once the code is off the device or can no longer be used. Seam does not report a deletion failure for a code whose is_code_usable is false. It keeps cleaning the code up in the background, and the access code object remains until the removal is confirmed.

Deleted

Once Seam confirms that the code is off the device, it deletes the access code object and emits access_code.deleted. Retrieving the access code afterward returns a 404.
Seam is changing this behavior so access codes won’t return a 404 unless explicitly deleted by the API user.

Errors and Warnings

Errors and warnings can appear alongside any phase. An access code can also be in one of the following statuses.
Seam always keeps trying when recovery is possible. Even after a failure event, Seam may emit a success event (such as access_code.issued) if a retry succeeds. Your application should be prepared to handle both.

Deadlines

Seam reports a delay or failure when an operation hasn’t completed by its deadline. When the deadline is a time on the access code, such as starts_at, Seam uses that time. Otherwise, Seam allows a grace period that gives it a reasonable amount of time to retry the operation and confirm it on the device. The grace periods below are approximate and may change. Don’t build logic that depends on them.

Lifecycle Events Reference

Listen for these events on your webhook. See the access code events reference for full payloads.
These events supersede the deprecated device-oriented events such as access_code.set_on_device. See Migrating to Access Code Lifecycle Events.

Next Steps