Learn about manufacturer- and device-specific constraints on codes.
When creating access codes, it is important to be aware of any constraints on the code. Get a device and review its device.properties.code_constraints. Seam represents each constraint as an object with a constraint_type property. Depending on the constraint type, there may also be additional properties. Note that some constraints are manufacturer- or device-specific.The constraint_type property can be any of the following enum values:
Constraint Type
Description
no_zeros
Cannot use 0s as digits in the PIN code.
cannot_start_with_12
PIN code cannot start with the sequence of digits 12.
no_triple_consecutive_ints
No more than three digits in a row can be consecutive or the same in the
PIN code.
cannot_specify_pin_code
Cannot specify a PIN code. You must leave the code empty, and the lock
provider generates a PIN code.
pin_code_matches_existing_set
If you specify a PIN code, it must match an existing set of PIN codes
used in the account.
For example, the PIN code could match the code assigned to a user in
the system.
start_date_in_future
For time-bound codes, the start date must be in the future.
no_ascending_or_descending_sequence
PIN code cannot consist of a sequence of consecutive digits.
at_least_three_unique_digits
PIN code must contain at least three unique digits.
no_all_same_digits
PIN code cannot consist entirely of the same repeated digit (for
example, 1111 is invalid).
unique_first_four_digits
The first four digits of the PIN code must all be distinct.
cannot_contain_089
PIN code cannot contain the digits 0, 8, or
9.
For example, this restriction could apply to a cylinder lock that only
includes the digits 1 to 7.
cannot_contain_0789
PIN code cannot contain the digits 0, 7,
8, or 9.
For example, this restriction could apply to a cylinder lock that only
includes the digits 1 to 6.
name_length
Name of the code has some restrictions on length.
When the constraint_type is name_length, the
constraint object has one or two additional properties called
min_length and max_length to specify the
length constraints.
name_must_be_unique
Name of the code must be unique within the device.
Some device providers require you to configure the device’s timezone before creating time-bound access codes. This is because these devices schedule access codes using device-local time, but their APIs do not report the device’s timezone.Providers requiring timezone configuration:
Ultraloq — Must configure timezone using /devices/report_provider_metadata before creating time-bound access codes. See Configuring Ultraloq Device Timezones.
Permanent access codes (codes without starts_at and ends_at) do not
require timezone configuration, even on providers that require it for
time-bound codes.
Detecting timezone requirement:Check for the provider-specific timezone warning in device.warnings:
import { Seam } from 'seam'const seam = new Seam()const device = await seam.devices.get({ device_id: 'your-device-id',})// Check for timezone warningsconst timezoneWarnings = device.warnings.filter((w) => w.warning_code.toLowerCase().includes('time_zone'),)if (timezoneWarnings.length > 0) { console.log('⚠️ Timezone configuration required for time-bound codes') console.log(`Warning: ${timezoneWarnings[0].message}`)}
from seam import Seamseam = Seam()device = seam.devices.get(device_id="your-device-id")# Check for timezone warningstimezone_warnings = [ w for w in device.warnings if "time_zone" in w.warning_code.lower()]if timezone_warnings: print("⚠️ Timezone configuration required for time-bound codes") print(f"Warning: {timezone_warnings[0].message}")
require "seam"seam = Seam.new()device = seam.devices.get(device_id: "your-device-id")# Check for timezone warningstimezone_warnings = device.warnings.select do |w| w.warning_code.downcase.include?("time_zone")endif timezone_warnings.any? puts "⚠️ Timezone configuration required for time-bound codes" puts "Warning: #{timezone_warnings[0].message}"end
For devices requiring timezone configuration, attempting to create a time-bound access code without first setting the timezone will result in a validation error.