Migrating Existing Unmanaged Access Codes

Learn how to migrate existing lock access codes into Seam

Overview

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 will help you keep any existing access codes on devices, and transition those codes to ones managed by your Seam workspace.

If migrating existing codes into your Seam workspace is not possible, you can still get a list of these existing codes, and replace them with new access codes managed by your Seam workspace.

Unmanaged Access Codes

Seam differentiates between managed access codes and unmanaged access codes. When you create an access code on a device in Seam, it is created as a managed code. Codes that exist on a device that were not created on Seam are considered unmanaged codes. We strictly limit the operations that can be performed on unmanaged codes to:

  • Viewing a list of the unmanaged codes on a device

  • Converting an unmanaged code into a managed code

  • Deleting an unmanaged code

Strictly speaking, unmanaged codes are any codes on a device that were not created by the current workspace. For example, if you are within Workspace 1 and created codes Code 1 and Code 2, those two codes would be considered unmanaged if you were looking at the same device in Workspace 2. Therefore, unmanaged codes include both codes not managed by Seam at all, and codes that might be managed by a different workspace within Seam.

Viewing Unmanaged Codes on a Device

You can retrieve a list of all unmanaged access codes for a particular device using the List Unmanaged Access Codes request, passing in device_id as a query parameter. For example:

Request:

pprint(seam.access_codes.unmanaged.list(device="374d3ee2-5e5d-4141-b828-6c2fa458212f"))

Response:

[UnmanagedAccessCode(access_code_id='449b03e6-1c6f-4ff3-b055-b9cf8146d2b0',
                     device_id='374d3ee2-5e5d-4141-b828-6c2fa458212f',
                     type='ongoing',
                     created_at='2023-10-28T04:00:04.194Z',
                     errors=[],
                     warnings=[],
                     name='New Passcode',
                     code='123456',
                     is_managed=False,
                     starts_at=None,
                     ends_at=None,
                     status='set')]

Converting Unmanaged Codes into Managed Codes

You can convert unmanaged access codes into managed ones using the Convert an Unmanaged Access Code request, passing in access_code_id as a query parameter. For example:

Request:

access_code_id = "449b03e6-1c6f-4ff3-b055-b9cf8146d2b0"
attempt = seam.access_codes.unmanaged.convert_to_managed(
  access_code = access_code_id
)

pprint(attempt)

Response:

ActionAttempt(action_attempt_id='721b51b7-6ab9-41cf-b09d-a5e97d355208',
              action_type='CONVERT_ACCESS_CODE_TO_MANAGED',
              status='success',
              result={},
              error=None)

The request returns immediately, but the conversion is an asynchronous process that completes in the background. You can listen to the access_code.unmanaged.converted_to_managed and access_code.unmanaged.failed_to_convert_to_managed to be notified when conversion succeeds or fails.

Once an unmanaged code is successfully converted to a managed code, all of the normal managed access code operations and behavior are available.

Unsupported Conversion

Some third-party device providers strictly limit the information available about existing access codes on a device. Thus, for devices connected using these providers, we cannot convert unmanaged codes to managed ones. The current list of providers which do not support conversion is as follows:

  • SmartThings

  • igloohome

For SmartThings devices, you can still see a list of all unmanaged codes on the devices using the GET /access_codes/unmanaged/list endpoint, but you cannot see the actual PIN code for the access codes (the code property is not present).

Deleting Unmanaged Codes

After you have converted unmanaged codes to managed codes, or replaced them with new ones, you can allow users to delete any remaining unmanaged codes on their device. You can do this by using the Delete an Unmanaged Access Code request and passing in passing in access_code_id as a query parameter. For example:

Request:

access_code_id = "ddb6e6b7-7156-471e-9199-4106db2f2e57"
pprint(seam.access_codes.unmanaged.delete(access_code = access_code_id))

Response:

ActionAttempt(action_attempt_id='364e747f-9631-4eb1-bc9e-24cd1f11cf3b',
              action_type='DELETE_UNMANAGED_ACCESS_CODE',
              status='success',
              result={},
              error=None)

The request returns an action attempt, similar to the managed code deletion endpoint. See Delete an access code for more details.

Last updated

Logo

© Seam Labs, Inc. All rights reserved.