Skip to main content
POST
/
access_codes
/
create_multiple
await seam.accessCodes.createMultiple({ device_ids: [ "d9717800-fa73-401a-b66b-03f0ef950e2a", "550e8400-e29b-41d4-a716-446655440000", ], behavior_when_code_cannot_be_shared: "throw", preferred_code_length: 4, name: "My Linked Access Code", starts_at: "2025-06-19T01:41:56.000Z", ends_at: "2025-06-22T16:40:40.000Z", }); /* [ { "access_code_id": "e9cf6dd6-89aa-477f-a701-c08f3de13c1f", "code": "1234", "common_code_key": "auto_set_by_create_multiple_550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-06-14T16:54:17.946242Z", "device_id": "c9cd621d-ef0c-45c8-b608-026ebdb74615", "ends_at": "2025-07-04T16:54:17.946049Z", "errors": [], "is_backup": false, "is_backup_access_code_available": false, "is_external_modification_allowed": false, "is_managed": true, "is_offline_access_code": false, "is_one_time_use": false, "is_scheduled_on_device": true, "is_waiting_for_code_assignment": false, "name": "My Linked Access Code", "pulled_backup_access_code_id": null, "starts_at": "2025-07-02T16:54:17.946049Z", "status": "set", "type": "time_bound", "warnings": [], "workspace_id": "750fc0bc-4450-4356-8d9f-18c6a3a6b2c7" } ] */
{
  "access_codes": [
    {
      "access_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "code": "<string>",
      "common_code_key": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "errors": [
        {
          "error_code": "<string>",
          "message": "<string>",
          "created_at": "2023-11-07T05:31:56Z"
        }
      ],
      "is_backup_access_code_available": true,
      "is_external_modification_allowed": true,
      "is_offline_access_code": true,
      "is_one_time_use": true,
      "name": "<string>",
      "pending_mutations": [
        {
          "created_at": "2023-11-07T05:31:56Z",
          "message": "<string>"
        }
      ],
      "warnings": [
        {
          "error_code": "<string>",
          "message": "<string>",
          "created_at": "2023-11-07T05:31:56Z"
        }
      ],
      "workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "dormakaba_oracode_metadata": {
        "stay_id": 123,
        "user_level_name": "<string>",
        "is_cancellable": true,
        "is_early_checkin_able": true,
        "is_extendable": true,
        "is_overridable": true,
        "site_name": "<string>",
        "user_level_id": "<string>"
      },
      "ends_at": "2023-11-07T05:31:56Z",
      "is_backup": true,
      "is_scheduled_on_device": true,
      "is_waiting_for_code_assignment": true,
      "pulled_backup_access_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "starts_at": "2023-11-07T05:31:56Z"
    }
  ],
  "ok": true
}

Authorizations

Authorization
string
header
required

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

Body

application/json
device_ids
string<uuid>[]
required

IDs of the devices for which you want to create the new access codes.

allow_external_modification
boolean

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

attempt_for_offline_device
boolean
default:true
behavior_when_code_cannot_be_shared
enum<string>
default:throw

Desired behavior if any device cannot share a code. If throw (default), no access codes will be created if any device cannot share a code. If create_random_code, a random code will be created on devices that cannot share a code.

Available options:
throw,
create_random_code
code
string

Code to be used for access.

Required string length: 4 - 9
Pattern: ^\d+$
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.

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.

   Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as `first_name` and `last_name`.

   To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints.

   To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components).
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. If the affected devices do 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.

Response

OK

access_codes
object[]
required
ok
boolean
required