Get started with August locks

Learn how to connect and control August locks with the Seam API.

August smart locks
August smart locks

Overview

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 August 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.

Seam supports the following August locks:

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 August 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.

▶️ Go to the Seam Console!


Step 1: Install a Seam SDK

Seam provides client libraries for many languages, including JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and an OpenAPI spec.

First, install a Seam SDK, as follows:

npm i seam

Next, go to https://console.seam.co/ and sign up for Seam to get your API key.

Then, export your API key as an environment variable.

$ export SEAM_API_KEY=seam_test2bMS_94SrGUXuNR2JmJkjtvBQDg5c

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 August lock, use a non-sandbox workspace and API key.


To control your August lock using the Seam API, you must first authorize your Seam workspace to connect to your August account. If your application needs to connect to your users' August 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 August locks. The Connect Webview presents a flow that prompts your users to enter their credentials for their August 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 August 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.

Go to https://console.seam.co/. On the Devices page, click + Add Devices. Then, see Authorize your workspace in this guide to complete the Connect Webview authorization flow.

Create a Connect Webview

Create a connect_webview object and then note the returned URL.

Code:

from seam import Seam

seam = Seam()  # Seam automatically uses your exported SEAM_API_KEY.

connect_webview = seam.connect_webviews.create(accepted_providers=["august"])

assert connect_webview.login_successful is False

# Use the returned Connect Webview URL to display
# the Connect Webview authorization flow to your user.
print(connect_webview.url)

Output:

https://connect.getseam.com/connect_webviews/view?connect_webview_id=12345678-1234-1234-1234-123456789012&auth_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Authorize your workspace

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 August 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 August sandbox account credentials:

  • Device Region: Others

  • Email: jane@example.com

  • Password: 1234

  • 2FA Method: Email (jane@example.com)

  • Two Factor Code: 123456

Use the Seam Connect Webview authorization flow to connect an August account with Seam. This flow varies slightly based on the device manufacturer and region.
Use the Seam Connect Webview authorization flow to connect an August account with Seam. This flow varies slightly based on the device manufacturer and region.

Confirm that authorization through the Connect Webview was successful by querying its status.

Code:

updated_connect_webview = seam.connect_webviews.get(connect_webview.connect_webview_id)

assert updated_connect_webview.login_successful is True # True

Output:

True

Step 3: Retrieve August lock devices

When you link an August account with Seam, we create a device object to represent each August lock in your account. You can then retrieve these August devices using the List Devices and Get Device endpoints.

The Seam API exposes each device's properties, such as the door lock status, power status, capabilities, and so on.

Code:

# Retrieve all devices, filtered by manufacturer,
# which is one of several filters that list() supports.
all_august_locks = seam.devices.list(manufacturer="august")

# Select the first device as an example.
front_door = all_august_locks[0]

# Inspect specific properties.
assert front_door.properties["online"] is True # True
assert front_door.properties["locked"] is True # True

# View the entire returned device object.
pprint(front_door)

Output:

Device(
  device_id='11111111-1111-1111-1111-444444444444',
  display_name='Lock 1',
  workspace_id='00000000-0000-0000-0000-000000000000'
  connected_account_id='11111111-1111-1111-1111-222222222222',
  created_at='2024-05-29T20:08:48.878Z',
  properties={
    'manufacturer': 'august',
    'online': True,
    'locked': True,
    'battery': {
      'level': 0.9999532347993827,
      'status': 'full'
    },
    ...
  }
  can_remotely_unlock=True,
  ...
)

Step 4: Control your August lock

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 August 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)

Output:

ActionAttempt(
  status='pending',
  action_type='UNLOCK_DOOR',
  action_attempt_id='11111111-2222-3333-4444-555555555555',
  result=None,
  error={}
)

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"] is False # False

Output:

False

Now that you have successfully unlocked your lock, you can use the Lock Door endpoint to lock it again.


Program access codes on your lock

You can use the Seam API to program online access codes on August locks that have an integrated or accessory keypad. Lock users can then enter these access codes using the keypad 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)

Output:

[
  AccessCode(
    access_code_id='11111111-1111-1111-1111-555555555555',
    device_id='11111111-1111-1111-1111-444444444444',
    type='ongoing',
    code='1234',
    name='my ongoing code',
    ...
  )
  AccessCode(
    access_code_id='11111111-1111-1111-1111-666666666666',
    device_id='11111111-1111-1111-1111-444444444444',
    type='time_bound',
    code='2345',
    starts_at='2025-01-01T16:00:00.000Z',
    ends_at='2025-01-22T12:00:00.000Z',
    name='my time-bound code',
    ...
  )
]

Step 5: Connect a real August lock

Now that you have learned the basics of using the Seam API, you can connect and control a real August device. To do so, make sure to switch to a non-sandbox workspace and API key.

For more details about setting up your real August lock, see the August locks integration guide.


Step 6: Build your application!

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.

Seam Components make it easy to develop your application!
Seam Components make it easy to develop your application!

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 August 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.


Last updated

Logo

© Seam Labs, Inc. All rights reserved.