Create an access code in 60 seconds
Temporary access is one call. Give /access_grants/create a person, the doors and the window, and Seam generates the PIN and programs the lock. There is no cleanup job to write.
Build it with your AI agent
Install the Seam plugin and your coding agent picks up three integration skills: Reservation Automations, Access Grants and Access Codes. It then writes the calls the way we would. Paste the prompt below and let it build.
1. Install the plugin
The Claude Code install also adds our documentation MCP server, so the agent can look up endpoints and device capabilities while it works. Cursor, Codex and other agents get the skills through npx skills add and can add the MCP server there separately.
2. Paste this prompt
What you can build
Check-in with nobody in the loop
Issue a code the moment a booking is confirmed and let it stop working at checkout. No key handover, no lockbox, and no reminder to delete the code next week.
One integration, every lock
The same grant programs August, Yale, Schlage, Lockly, TTLock and Tedee locks, plus Salto, Brivo and dormakaba entrances. Offline hotel systems ask for one extra field, a reservation_key. Supporting another brand is a device to connect, not a project to scope.
Codes that follow your data
Grants are keyed to your reservation or membership record, so a shortened stay updates the code in place and a cancellation removes it. Nothing is left stranded on the lock.
How it works
Install the SDK and export your API key
Create a workspace in Seam Console, generate an API key under Developer > API Keys, and export it. The examples read SEAM_API_KEY from the environment. A sandbox workspace comes with virtual locks that behave like real ones.
Pick a door that can take a PIN code
Not every lock accepts a remotely programmed code. On a standalone smart lock, confirm can_program_online_access_codes is true. On an access control system, confirm can_unlock_with_code is true on the entrance. Checking first turns a runtime failure into a branch you control.
Create an access grant with a code access method
On a standalone smart lock or a fully online access system, this is the only call you need. Name the person with user_identity_id or an inline user_identity, the doors with device_ids, acs_entrance_ids or space_ids, and the window with starts_at and ends_at. Ask for mode: code and Seam generates a PIN that satisfies the device's own rules. Offline hotel and multifamily systems are the exception. Salto Space, dormakaba Ambiance and Community, and ASSA ABLOY Visionline and Vostio override the previous guest's credential, so guest access on their entrances also needs a reservation_key. Check can_belong_to_reservation on the entrance instead of branching on the brand: pass a key when at least one targeted entrance reports true, and leave it out when none do.
Handle access-system entrances and reservation keys
For an access control system, use this alternative to the smart-lock grant above. Set SEAM_SPACE_ID to the actual Seam UUID of the booked space. The example checks every targeted entrance and includes reservation_key only when required. Replace the sample booking reference and three-day window with the values from your reservation record.
Read the code back and send it to your guest
The grant response tells you what was requested; the access method tells you what was issued. List the access methods for the grant to get the digits, and only deliver them once is_issued is true. On real hardware, programming takes a few moments, and the access_method.issued webhook saves you a polling loop.
Let the window close, or move it
You do not schedule a deletion. The code stops working at ends_at because Seam programmed that window onto the lock. If the dates change, update the grant instead of creating a second one. For PIN codes the digits stay the same, so there is no new code to re-send. /access_grants/update moves the window, not the doors: a booking that changes room is a delete and a fresh grant. Deleting the grant revokes every credential under it.
Frequently asked questions
What is the difference between an access grant and an access code?
The grant is the request: this person, these doors, this window. The access code is one of the credentials Seam creates to satisfy it. Call /access_grants/create and Seam owns the credential lifecycle from there. The lower-level /access_codes API gives you direct control of one code on one device, and hands that lifecycle back to you.
How long before a temporary code works on the lock?
In a sandbox workspace, almost instantly. On real hardware, Seam has to reach the lock or its hub, so issuance takes a few moments. Wait for is_issued to be true on the access method, or listen for the access_method.issued event, before you send the code to a guest.
Can I choose the PIN myself?
Yes. Pass code on the requested access method, between four and nine digits, subject to what the lock accepts. Leave it out and Seam generates a code that already satisfies the device's constraints, which is what you want at scale.
What happens when a booking changes after the code is issued?
Call /access_grants/update with the new starts_at or ends_at. Seam re-programs the affected doors, and each access method reports is_issued: false until it reissues. For a PIN code the digits are unchanged, so you do not have to email a new one. The endpoint moves the time window only: a booking that moves to different doors is a delete and a fresh grant. Call /access_grants/delete to end access entirely.
Which locks and access systems support temporary PIN codes?
Any connected lock reporting can_program_online_access_codes, including August, Yale, Schlage, Lockly, TTLock, Tedee and igloohome, plus access control system entrances reporting can_unlock_with_code, such as Salto KS, Salto Space, Brivo and dormakaba. Read the capability flag instead of assuming per brand. Support varies by model and by how the device is connected. Salto Space and dormakaba also ask for a reservation_key on guest access; see the next question.
Why do Salto Space and dormakaba need a reservation_key?
Because their locks are not online. They decide at the door, using data carried on the credential, and a new guest's credential overrides the previous one. Seam needs a reservation_key to sequence that: grants sharing a key join the same stay, and a new key starts a stay that supersedes the last. It applies to Salto Space, dormakaba Ambiance and Community, and ASSA ABLOY Visionline and Vostio, and only to guest or resident credentials. Staff credentials override nothing and need no key. Check can_belong_to_reservation on the entrance: pass a key when at least one targeted entrance reports true, and omit it when none do, or the call is rejected.
Do I need a smart lock to try this?
No. Sandbox workspaces come with virtual locks and access systems that behave like the real thing, so you can issue a code and watch it expire without buying hardware. Virtual devices only connect in a sandbox workspace, so switch to a production workspace when you are ready for real locks.
Related
- Access API overviewEvaluate access codes, mobile keys and cards across supported devices and systems.
- Access Grants API referenceEvery field on /access_grants/create, plus the access methods it can request.
- Reservation Access GrantsWhen offline hotel and multifamily systems need a reservation_key, and how override and joiner behavior works.
- Supported devices and systemsWhich locks and access control systems Seam programs codes onto today.
- Short-term rental access automationThe same grant, driven by reservations from your PMS or booking platform.
- Coworking and shared space accessBooking-based codes for meeting rooms, studios and shared desks.
- All Seam guidesImplementation walkthroughs and hardware deep dives from the Seam team.