Seam provides a universal API to connect and control many brands of IoT devices and systems, including smart locks, access control systems (ACSs), thermostats, and noise sensors.
This guide gives you a rapid introduction to connecting and controlling your Akiles lock using the Seam API. For application developers, you can use the Seam API in your app, and your users can authorize your app to control their devices using Seam.
For detailed information about the Akiles devices that Seam supports, see the following table and our Akiles Supported Devices page:
To learn more about other IoT device and system brands that Seam supports—such as Yale, Schlage, Google Nest, and many more—visit our integration page.
This guide shows you how to install a Seam SDK and then control your Akiles lock using the Seam API.
Another easy way to learn about what you can do with the Seam API is to explore the interactive Seam CLI, which you can access from directly within the Seam Console.
Seam provides client libraries for many languages, including JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and an OpenAPI spec.
This guide uses a sandbox workspace. You can only connect virtual devices and systems in this type of workspace. If you want to connect a real Akiles lock, use a non-sandbox workspace and API key.
Step 2: Link your Akiles account with Seam
To control your Akiles lock using the Seam API, you must first authorize your Seam workspace to connect to your Akiles account. If your application needs to connect to your users' Akiles accounts, Seam provides fully-embedded, customizable client-side Connect Webviews to collect their authorization securely. These user-friendly pre-built authorization flows walk your users through the process of granting your Seam workspace permission to control their Akiles locks. The Connect Webview presents a flow that prompts your users to enter their credentials for their Akiles account.
In this guide, you create a Connect Webview object. Then, you display the graphical component of the created Connect Webview and enter a set of sample credentials to connect a sandbox Akiles account.
This guide shows you how to create a Connect Webview programmatically using the Seam API.
The Seam Console provides another easy way to connect devices to your Seam workspace.
Create a connect_webview object and then note the returned URL.
Code:
from seam import Seamseam =Seam()# Seam automatically uses your exported SEAM_API_KEY.connect_webview = seam.connect_webviews.create(accepted_providers=["akiles"])assert connect_webview.login_successful isFalse# Use the returned Connect Webview URL to display# the Connect Webview authorization flow to your user.print(connect_webview.url)
import { Seam } from"seam";constseam=newSeam(); // Seam automatically uses your exported SEAM_API_KEY.constconnectWebview=awaitseam.connectWebviews.create({ accepted_providers: ['akiles']});console.log(connectWebview.login_successful); // false// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.console.log(connectWebview.url);
require"seam"seam =Seam.new() # Seam automatically uses your exported SEAM_API_KEY.connect_webview = seam.connect_webviews.create( accepted_providers: ["akiles"])puts connect_webview.login_successful # false# Use the returned Connect Webview URL to display# the Connect Webview authorization flow to your user.puts connect_webview.url
<?phprequire'vendor/autoload.php';$seam =newSeam\SeamClient(); // Seam automatically uses your exported SEAM_API_KEY.$connect_webview = $seam->connect_webviews->create( accepted_providers: ["akiles"]);echo $connect_webview->login_successful ?'true':'false',"\n"; // false// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.echo $connect_webview->url;
usingSeam.Client;var seam =newSeamClient(apiToken: SEAM_API_KEY);var connectWebview =seam.ConnectWebviews.Create( acceptedProviders:new() {Seam.Api.ConnectWebviews.CreateRequest.AcceptedProvidersEnum.Akiles});Console.WriteLine(connectWebview.LoginSuccessful); // False// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.Console.WriteLine(connectWebview.Url);
importjava.io.Console;importjava.util.*;importcom.fasterxml.jackson.annotation.*;importcom.fasterxml.jackson.databind.annotation.JsonDeserialize;importcom.seam.api.Seam;importcom.seam.api.core.ObjectMappers;importcom.seam.api.types.ConnectWebview;importcom.seam.api.types.Device;importcom.seam.api.types.Manufacturer;importcom.seam.api.types.ActionAttempt;importcom.seam.api.types.AccessCode;importcom.seam.api.resources.connectwebviews.requests.ConnectWebviewsCreateRequest;importcom.seam.api.resources.connectwebviews.requests.ConnectWebviewsGetRequest;importcom.seam.api.resources.devices.requests.DevicesListRequest;importcom.seam.api.resources.devices.requests.DevicesGetRequest;importcom.seam.api.resources.locks.requests.LocksUnlockDoorRequest;importcom.seam.api.resources.accesscodes.requests.AccessCodesCreateRequest;importcom.seam.api.resources.accesscodes.requests.AccessCodesListRequest;publicclassMain {publicstaticvoidmain(String[] args) {Seam seam =Seam.builder().apiKey(SEAM_API_KEY).build();ConnectWebview connectWebview =seam.connectWebviews().create(ConnectWebviewsCreateRequest.builder().acceptedProviders(List.of(AcceptedProvider.AKILES)).build());System.out.println(connectWebview.getLoginSuccessful()); // false// Use the returned Connect Webview URL to display// the Connect Webview authorization flow to your user.System.out.println(connectWebview.getUrl()); }}
In a web browser, go to the URL that the Connect Webview object returned.
For application developers, you can redirect your user to this Connect Webview URL so that they can authorize your app to control their devices using Seam. We even provide a prebuilt Connect Account Button within our suite of Seam Components that help you build your device management flow.
Because you're using a sandbox workspace, you can connect Seam's test Akiles account. We provide virtual devices for each of the brands that we support. These sandbox devices and systems enable you to test your app with devices from multiple brands without the need to own all the corresponding physical devices.
Complete the Connect Webview authorization flow by entering the following Akiles sandbox account credentials:
Email: jane@example.com
Password: 1234
Confirm that authorization through the Connect Webview was successful by querying its status.
When you link an Akiles account with Seam, we create a device object to represent each Akiles lock in your account. You can then retrieve these Akiles devices using the List Devices and Get Device endpoints.
The Seam API exposes each device's properties, such as the door lock status, capabilities, and so on.
Code:
# Retrieve all devices, filtered by manufacturer,# which is one of several filters that list() supports.all_akiles_locks = seam.devices.list(manufacturer="akiles")# Select the first device as an example.front_door = all_akiles_locks[0]# Inspect specific properties.assert front_door.properties["online"]isTrue# Trueassert front_door.properties["locked"]isTrue# True# View the entire returned device object.pprint(front_door)
# Retrieve all devices, filtered by manufacturer, which is# one of several filters that the list endpoint supports.all_akiles_locks=$(# Use GET or POST.curl-X'GET' \'https://connect.getseam.com/devices/list' \-H'accept: application/json' \-H"Authorization: Bearer ${SEAM_API_KEY}" \-H'Content-Type: application/json' \-d'{ "manufacturer": "akiles" }')# Select the first device as an example.front_door=$(jq-r'.devices[0]'<<<${all_akiles_locks})# Inspect specific properties.echo $(jq-r'"Online (true): " + (.properties.online | tostring)'<<<${front_door})echo $(jq-r'"Locked (true): " + (.properties.locked | tostring)'<<<${front_door})# View the entire returned device object.echo ${front_door}
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.constallAkilesLocks=awaitseam.devices.list({manufacturer:"akiles"});// Select the first device as an example.constfrontDoor= allAkilesLocks[0];// Inspect specific properties.console.log(frontDoor.properties.online); // trueconsole.log(frontDoor.properties.locked); // true// View the entire returned device object.console.log(frontDoor);
# Retrieve all devices, filtered by manufacturer,# which is one of several filters that list() supports.all_akiles_locks = seam.devices.list(manufacturer: "akiles")# Select the first device as an example.front_door = all_akiles_locks[0]# Inspect specific properties.puts front_door.properties.online # trueputs front_door.properties.locked # true# View the entire returned device object.puts front_door.inspect
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.$all_akiles_locks = $seam->devices->list(manufacturer:"akiles");// Select the first device as an example.$front_door = $all_akiles_locks[0];// Inspect specific properties.echo $front_door->properties->online ?'true':'false',"\n"; // trueecho $front_door->properties->locked ?'true':'false',"\n"; // true// View the entire returned device object.echojson_encode($front_door, JSON_PRETTY_PRINT);
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.var allAkilesLocks =seam.Devices.List( manufacturer:Seam.Api.Devices.ListRequest.ManufacturerEnum.Akiles);// Select the first device as an example.Device frontDoor =allAkilesLocks[0];// Inspect specific properties.Console.WriteLine(frontDoor.Properties.Online); // trueConsole.WriteLine(frontDoor.Properties.Locked); // true// View the entire returned device object.Console.WriteLine(frontDoor);
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.var allAkilesLocks =seam.devices().list(DevicesListRequest.builder().manufacturer(Manufacturer.AKILES).build());// Select the first device as an example.Device frontDoor =allAkilesLocks.get(0);// Inspect specific properties.System.out.println(frontDoor.getProperties().getOnline()); // trueSystem.out.println(frontDoor.getProperties().getLocked()); // true// View the entire returned device object.System.out.println(frontDoor);
// Retrieve all devices, filtered by manufacturer,// which is one of several filters that list() supports.allAkilesLocks, err := client.Devices.List( context.Background(), &api.DevicesListRequest{ Manufacturer: api.ManufacturerAkiles.Ptr(), },)// Select the first device as an example.frontDoor := allAkilesLocks[0]if err !=nil {return err}// Inspect specific properties.fmt.Println(frontDoor.Properties.Online) // truefmt.Println(*frontDoor.Properties.Locked) // true// View the entire returned device object.fmt.Println(frontDoor)returnnil
Next, you can use the Seam API to control your lock.
Each device that you connect to Seam has a specific set of capabilities. These capabilities define the Seam API actions that you can use, such as remote unlock actions, programming access codes, and so on. Seam's intuitive and granular capability flags inform your application about what features and behaviors each device supports. Notice the capability flags within the code samples in this guide.
Try out the following actions on your Akiles lock:
Unlock your lock
To unlock a door, use the Unlock Door endpoint. Specify the device that you want to unlock by including the device_id in the request body. This endpoint returns an action attempt to track the progress of the unlock operation.
Code:
# Confirm that the device can remotely unlock.# You're using a capability flag here!if front_door.can_remotely_unlock:# Perform the unlock operation# and return an action attempt. action_attempt=seam.locks.unlock_door(device_id=front_door.device_id)
# Confirm that the device can remotely unlock.# You're using a capability flag here!if$(jq-r'.can_remotely_lock'<<<${front_door}); then \# Perform the unlock operation# and return an action attempt.curl-X'POST' \'https://connect.getseam.com/locks/unlock_door' \-H'accept: application/json' \-H"Authorization: Bearer ${SEAM_API_KEY}" \-H'Content-Type: application/json' \-d"{ \"device_id\": \"$(jq-r '.device_id' <<<${front_door})\" }";fi
// Confirm that the device can remotely unlock.// You're using a capability flag here!if (frontDoor.can_remotely_unlock) {// Perform the unlock operation// and return an action attempt.constactionAttempt=awaitseam.locks.unlockDoor({ device_id:frontDoor.device_id });};
# Confirm that the device can remotely unlock.# You're using a capability flag here!if (front_door.can_remotely_unlock)# Perform the unlock operation# and return an action attempt. action_attempt = seam.locks.unlock_door(device_id: front_door.device_id)end
// Confirm that the device can remotely unlock.// You're using a capability flag here!if ($front_door->can_remotely_unlock) {// Perform the unlock operation// and return an action attempt. $action_attempt = $seam->locks->unlock_door(device_id: $front_door->device_id);}
// Confirm that the device can remotely unlock.// You're using a capability flag here!if (frontDoor.CanRemotelyUnlock==true) { // Perform the unlock operation // and return an action attempt.ActionAttempt actionAttempt =seam.Locks.UnlockDoor(deviceId:frontDoor.DeviceId);}
// Confirm that the device can remotely unlock.// You're using a capability flag here!if (frontDoor.getCanRemotelyUnlock()){// Perform the unlock operation// and return an action attempt.ActionAttempt actionAttempt =seam.locks().unlockDoor(LocksUnlockDoorRequest.builder().deviceId(frontDoor.getDeviceId()).build());}
// Confirm that the device can remotely unlock.// You're using a capability flag here!if*frontDoor.CanRemotelyUnlock {// Perform the unlock operation. actionAttempt, err := client.Locks.UnlockDoor( context.Background(),&api.LocksUnlockDoorRequest{ DeviceId: frontDoor.DeviceId, }, )if err !=nil {return err }}returnnil
You can track the status of the unlock operation to confirm that the device unlocked successfully. Query the locked status of the device, retrieve the action attempt by ID, or look for a lock.unlocked event.
To query the locked status of the device:
Code:
# Get the device by ID.updated_front_door = seam.devices.get(device_id=front_door.device_id)# Inspect the locked property to confirm# that the unlock operation was successful.assert updated_front_door.properties["locked"]isFalse# False
Output:
False
Code:
# Get the device by ID.updated_front_door=$(# Use GET or POST.curl-X'GET' \'https://connect.getseam.com/devices/get' \-H'accept: application/json' \-H"Authorization: Bearer ${SEAM_API_KEY}" \-H'Content-Type: application/json' \-d"{ \"device_id\": \"$(jq-r '.device_id' <<<${front_door})\" }")# Inspect the locked property to confirm# that the unlock operation was successful.echo $(jq-r'"Locked (false): " + (.device.properties.locked | tostring)'<<<${updated_front_door})
Output:
Locked (false): false
Code:
// Get the device by ID.constupdatedFrontDoor=awaitseam.devices.get({device_id:frontDoor.device_id});// Inspect the locked property to confirm// that the unlock operation was successful.console.log(updatedFrontDoor.properties.locked) // false
Output:
false
Code:
# Get the device by ID.updated_front_door = seam.devices.get(device_id: front_door.device_id)# Inspect the locked property to confirm# that the unlock operation was successful.puts updated_front_door.properties.locked # false
Output:
false
Code:
// Get the device by ID.$updated_front_door = $seam->devices->get(device_id: $front_door->device_id);// Inspect the locked property to confirm// that the unlock operation was successful.echo $updated_front_door->properties->locked ?'true':'false',"\n"; // false
Output:
false
Code:
// Get the device by ID.Device updatedFrontDoor =seam.Devices.Get( deviceId:frontDoor.DeviceId);// Inspect the locked property to confirm// that the unlock operation was successful.Console.WriteLine(updatedFrontDoor.Properties.Locked); // false
Output:
False
Code:
// Get the device by ID.Device updatedFrontDoor =seam.devices().get(DevicesGetRequest.builder().deviceId(frontDoor.getDeviceId()).build());// Inspect the locked property to confirm// that the unlock operation was successful.System.out.println(updatedFrontDoor.getProperties().getLocked()); // false
Output:
false
Code:
// Get the device by ID.updatedFrontDoor, err := client.Devices.Get( context.Background(), &api.DevicesGetRequest{ DeviceId: api.String(frontDoor.DeviceId), },)if err !=nil {return err}// Inspect the locked property to confirm// that the unlock operation was successful.fmt.Println(*updatedFrontDoor.Properties.Locked) // false
Output:
false
Program access codes on your lock
You can use the Seam API to program online access codes on Akiles locks that have an integrated keypad or an Akiles Pinpad. Lock users can then enter these access codes using the keypad or Pinpad to unlock the lock.
The Seam API makes it easy to program both ongoing and time-bound online access codes.
Code:
# Confirm that the device supports online access codes.# Here's another capability flag!if updated_front_door.can_program_online_access_codes:# Create an ongoing online access code. seam.access_codes.create( device_id = updated_front_door.device_id, name ="my ongoing code", code ="1234" )# Create a time-bound online access code. seam.access_codes.create( device_id = updated_front_door.device_id, name ="my time-bound code", starts_at ="2025-01-01T16:00:00Z", ends_at ="2025-01-22T12:00:00Z", code ="2345" )# List all access codes for this device. access_codes = seam.access_codes.list( device_id = updated_front_door.device_id )pprint(access_codes)
// Confirm that the device supports online access codes.// Here's another capability flag!if (updatedFrontDoor.getCanProgramOnlineAccessCodes()){// Create an ongoing online access code.seam.accessCodes().create(AccessCodesCreateRequest.builder().deviceId(updatedFrontDoor.getDeviceId()).name("my ongoing code").code("1234").build());// Create a time-bound online access code.seam.accessCodes().create(AccessCodesCreateRequest.builder().deviceId(updatedFrontDoor.getDeviceId()).name("my time-bound code").startsAt("2025-01-01T16:00:00Z").endsAt("2025-01-22T12:00:00Z").code("2345").build());// List all access codes for this device.var accessCodes =seam.accessCodes().list(AccessCodesListRequest.builder().deviceId(updatedFrontDoor.getDeviceId()).build());System.out.println(accessCodes);}
Now that you have learned the basics of using the Seam API, you can connect and control a real Akiles device. To do so, make sure to switch to a non-sandbox workspace and API key.
Seam makes it easy to develop your application. In addition to the robust Seam API and the wide variety of programming languages that our SDKs support, we also provide a suite of Seam Components. These prebuilt UI components help you to build your device management flow.
For example, you can use the Device Table Seam Component to display a list of devices and to identify all devices with issues. You can use the Device Details Seam Component to display a device's properties, settings, and issues, as well as to enable your users to perform actions based on each device's capabilities. The Access Code Details Seam Component provides a similar display and actions for access codes.
Seam Components use a responsive design to fit seamlessly on any screen size. They also provide device debugging flows to help your users.
To learn about all the Seam Components that we provide, see Seam Components.
Next steps
Now that you've completed this getting started guide for Akiles devices, you can learn more about what you can do with the Seam API.
If you have any questions or want to report an issue, email us at support@seam.co.