Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
device_id
string<uuid>
required

ID of the device for which you want to create the new access code.

allow_external_modification
boolean

Indicates whether external modification of the code is allowed. Default: false.

attempt_for_offline_device
boolean
default:true
code
string

Code to be used for access.

Required string length: 4 - 12
Pattern: ^\d+$
common_code_key
string

Key to identify access codes that should have the same code. Any two access codes with the same common_code_key are guaranteed to have the same code. See also Creating and Updating Multiple Linked Access Codes.

ends_at
string

Date and time at which the validity of the new access code ends, in ISO 8601 format. Must be a time in the future and after starts_at.

is_external_modification_allowed
boolean

Indicates whether external modification of the code is allowed. Default: false.

is_offline_access_code
boolean

Indicates whether the access code is an offline access code.

is_one_time_use
boolean

Indicates whether the offline access code is a single-use access code.

max_time_rounding
enum<string>

Maximum rounding adjustment. To create a daily-bound offline access code for devices that support this feature, set this parameter to 1d.

Available options:
1hour,
1day,
1h,
1d
name
string

Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.

prefer_native_scheduling
boolean

Indicates whether native scheduling should be used for time-bound codes when supported by the provider. Default: true.

preferred_code_length
number<float>

Preferred code length. Only applicable if you do not specify a code. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length.

starts_at
string

Date and time at which the validity of the new access code starts, in ISO 8601 format.

use_backup_access_code_pool
boolean

Indicates whether to use a backup access code pool provided by Seam. If true, you can use /access_codes/pull_backup_access_code.

use_offline_access_code
boolean
deprecated

Deprecated. Use is_offline_access_code instead.

Response

OK

access_code
object
required

Represents a smart lock access code. See the access_code object.