/** * Represents an [unmanaged smart lock access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). * * An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. * * When you create an access code on a device in Seam, it is created as a managed access code. Access codes that exist on a device that were not created through Seam are considered unmanaged codes. We strictly limit the operations that can be performed on unmanaged codes. * * Prior to using Seam to manage your devices, you may have used another lock management system to manage the access codes on your devices. Where possible, we help you keep any existing access codes on devices and transition those codes to ones managed by your Seam workspace. * * Not all providers support unmanaged access codes. The following providers do not support unmanaged access codes: * * - [Kwikset](https://docs.seam.co/device-and-system-integration-guides/kwikset-locks) */ export type UnmanagedAccessCode = { /** * Unique identifier for the access code. */ access_code_id: string; /** * Indicates that Seam cannot convert this unmanaged access code to a managed access code. Some providers do not support management of unmanaged access codes through API integrations. */ cannot_be_managed?: boolean | undefined; /** * Indicates that Seam cannot delete this unmanaged access code through the provider. If this access code needs to be deleted, it will only be possible from the manufacturer app. */ cannot_delete_unmanaged_access_code?: boolean | undefined; /** * Code used for access. Typically, a numeric or alphanumeric string. */ code: string | null; /** * Date and time at which the access code was created. */ created_at: string; /** * Unique identifier for the device associated with the access code. */ device_id: string; /** * Metadata for a dormakaba Oracode unmanaged access code. Only present for unmanaged access codes from dormakaba Oracode devices. */ dormakaba_oracode_metadata?: { /** * Indicates whether the stay can be cancelled via the Dormakaba Oracode API. */ is_cancellable?: boolean | undefined; /** * Indicates whether early check-in is available for this stay. */ is_early_checkin_able?: boolean | undefined; /** * Indicates whether the stay can be extended via the Dormakaba Oracode API. */ is_extendable?: boolean | undefined; /** * Indicates whether the access code can be overridden. When false, the maximum number of overrides has been reached. */ is_overridable?: boolean | undefined; /** * Dormakaba Oracode site name associated with this access code. */ site_name?: string | undefined; /** * Dormakaba Oracode stay ID associated with this access code. */ stay_id?: number | undefined; /** * Dormakaba Oracode user level ID associated with this access code. */ user_level_id?: string | undefined; /** * Dormakaba Oracode user level name associated with this access code. */ user_level_name?: string | null | undefined; } | null | undefined; /** * Date and time after which the time-bound access code becomes inactive. */ ends_at?: string | null | undefined; /** * Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). */ errors: Array< /** * Indicates a provider-specific issue that prevents the access code from being set or managed. Check the error message for details. */ { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'provider_issue'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Failed to set code on device. */ | { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'failed_to_set_on_device'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Failed to remove code from device. */ | { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'failed_to_remove_from_device'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Duplicate access code detected on device. */ | { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'duplicate_code_on_device'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * ID of the managed access code that conflicts with this managed access code, when Seam can identify it. */ managed_access_code_id?: string | undefined; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * ID of the unmanaged access code that conflicts with this managed access code, when Seam can identify it. */ unmanaged_access_code_id?: string | undefined; } /** * No space for access code on device. */ | { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'no_space_for_access_code_on_device'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Code was modified or removed externally after Seam successfully set it on the device. The external change conflicts with the state that Seam is trying to apply, so Seam will attempt to set the code on the device again. */ | { /** * Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. */ change_type?: 'modified' | 'removed' | undefined; /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'conflicting_external_modification'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * List of fields that were changed externally, with their previous and new values. */ modified_fields?: Array<{ /** * The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). */ field: string; /** * The previous value of the field. */ from: string | null; /** * The new value of the field. */ to: string | null; }> | undefined; } /** * Indicates that the access code is disabled or inactive on the device. The code exists but will not grant access until re-enabled. */ | { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'access_code_inactive'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Admin role required—insufficient permissions to manage PINs on this device. Please have an admin update your role, or ask them to set the PIN. */ | { /** * Date and time at which Seam created the error. */ created_at?: string | undefined; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'insufficient_permissions'; /** * Indicates that this is an access code error. */ is_access_code_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the account is disconnected. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'account_disconnected'; /** * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. */ is_connected_account_error: boolean; /** * Indicates that the error is not a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the Salto site user limit has been reached. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'salto_ks_subscription_limit_exceeded'; /** * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. */ is_connected_account_error: boolean; /** * Indicates that the error is not a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that one or more dormakaba sites associated with the connected account could not be connected. Contact dormakaba support. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'dormakaba_sites_disconnected'; /** * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error. */ is_connected_account_error: boolean; /** * Indicates that the error is not a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the device is offline. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'device_offline'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the device has been removed. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'device_removed'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the hub is disconnected. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'hub_disconnected'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the device is disconnected. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'device_disconnected'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) is empty. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'empty_backup_access_code_pool'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the user is not authorized to use the August lock. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'august_lock_not_authorized'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that device credentials are missing. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'missing_device_credentials'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the auxiliary heat is running. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'auxiliary_heat_running'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that a subscription is required to connect. */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'subscription_required'; /** * Indicates that the error is a device error. */ is_device_error: boolean; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; } /** * Indicates that the Seam API cannot communicate with [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge), for example, if the Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline. See also [Troubleshooting Your Access Control System](https://docs.seam.co/low-level-apis/access-systems/troubleshooting-your-access-control-system#acs_system-errors-seam_bridge_disconnected). */ | { /** * Date and time at which Seam created the error. */ created_at: string; /** * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */ error_code: 'bridge_disconnected'; /** * Indicates whether the error is related to [Seam Bridge](https://docs.seam.co/capability-guides/seam-bridge). */ is_bridge_error?: boolean | undefined; /** * Indicates whether the error is related specifically to the connected account. */ is_connected_account_error?: boolean | undefined; /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ message: string; }>; /** * Indicates that Seam does not manage the access code. */ is_managed: boolean; /** * Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components). */ name: string | null; /** * Date and time at which the time-bound access code becomes active. */ starts_at?: string | null | undefined; /** * Current status of the access code within the operational lifecycle. `set` indicates that the code is active and operational. `unset` indicates that the code exists on the provider but is not usable on the device. */ status: 'set' | 'unset'; /** * Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. */ type: 'time_bound' | 'ongoing'; /** * Warnings associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). */ warnings: Array< /** * The access code's PIN rotates periodically when the code is renewed. Retrieve the latest code before each use. */ { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'code_rotates_periodically'; } /** * The device's time zone is unknown and this code's time frame crosses a daylight-saving transition in at least one plausible time zone. A 1-hour safety buffer has been applied to the side of the time frame affected by the transition (`ends_at` for spring-forward, `starts_at` for fall-back) so the code stays active through the shift — the code may be usable up to 1 hour beyond your requested window. Set the device's time zone via `/devices/report_provider_metadata` to clear the buffer and guarantee exact handling. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'time_frame_adjusted_for_unknown_time_zone'; } /** * Code was modified or removed externally after Seam successfully set it on the device. External modification is allowed for this code, so the externally modified state is being honored. */ | { /** * Indicates the type of external modification. `modified` means the code's PIN or schedule was changed. `removed` means the code was deleted from the device. */ change_type?: 'modified' | 'removed' | undefined; /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * List of fields that were changed externally, with their previous and new values. */ modified_fields?: Array<{ /** * The name of the field that was changed (e.g. `code`, `starts_at`, `ends_at`). */ field: string; /** * The previous value of the field. */ from: string | null; /** * The new value of the field. */ to: string | null; }> | undefined; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'external_modification_in_effect'; } /** * Delay in setting code on device. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'delay_in_setting_on_device'; } /** * Delay in removing code from device. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'delay_in_removing_from_device'; } /** * Third-party integration detected that may cause access codes to fail. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'third_party_integration_detected'; } /** * Algopins must be used within 24 hours. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'igloo_algopin_must_be_used_within_24_hours'; } /** * Management was transferred to another workspace. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'management_transferred'; } /** * A backup access code has been pulled and is being used in place of this access code. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'using_backup_access_code'; } /** * Access code is being deleted. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'being_deleted'; } /** * An unknown issue occurred with the access code. */ | { /** * Date and time at which Seam created the warning. */ created_at?: string | undefined; /** * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. */ message: string; /** * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. */ warning_code: 'unknown_issue_with_access_code'; }>; /** * Unique identifier for the Seam workspace associated with the access code. */ workspace_id: string; };