> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seam.co/llms.txt
> Use this file to discover all available pages before exploring further.

# The Access Code Object

> Learn how the access_code object represents a smart lock PIN code you can customize, track, and program across hundreds of supported keypad and pinpad locks.

## The access\_code Object

Represents a smart lock [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).

An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. Using the Seam Access Code API, you can easily generate access codes on the hundreds of door lock models with which we integrate.

Seam supports programming two types of access codes: [ongoing](https://docs.seam.co/low-level-apis/smart-locks/access-codes#ongoing-access-codes) and [time-bound](https://docs.seam.co/low-level-apis/smart-locks/access-codes#time-bound-access-codes). To differentiate between the two, refer to the `type` property of the access code. Ongoing codes display as `ongoing`, whereas time-bound codes are labeled `time_bound`. An ongoing access code is active, until it has been removed from the device. To specify an ongoing access code, leave both `starts_at` and `ends_at` empty. A time-bound access code will be programmed at the `starts_at` time and removed at the `ends_at` time.

In addition, for certain devices, Seam also supports [offline access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes#offline-access-codes). Offline access (PIN) codes are designed for door locks that might not always maintain an internet connection. For this type of access code, the device manufacturer uses encryption keys (tokens) to create server-based registries of algorithmically-generated offline PIN codes. Because the tokens remain synchronized with the managed devices, the locks do not require an active internet connection—and you do not need to be near the locks—to create an offline access code. Then, owners or managers can share these offline codes with users through a variety of mechanisms, such as messaging applications. That is, lock users do not need to install a smartphone application to receive an offline access code.

For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes.

<ResponseExample>
  ```json One-Time-Use Offline Access Code theme={null}
  {
    "access_code_id": "e9cf6dd6-89aa-477f-a701-c08f3de13c1f",
    "code": "1234",
    "common_code_key": null,
    "created_at": "2025-06-14T16:54:17.946242Z",
    "device_id": "c9cd621d-ef0c-45c8-b608-026ebdb74615",
    "ends_at": "2025-07-04T16:54:17.946049Z",
    "errors": [],
    "pending_mutations": [],
    "is_backup": false,
    "is_backup_access_code_available": false,
    "is_external_modification_allowed": false,
    "is_managed": true,
    "is_offline_access_code": true,
    "is_one_time_use": true,
    "is_scheduled_on_device": true,
    "is_waiting_for_code_assignment": false,
    "name": "My 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"
  }
  ```

  ```json Ongoing Online Access Code theme={null}
  {
    "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": null,
    "errors": [],
    "pending_mutations": [],
    "is_backup": false,
    "is_backup_access_code_available": true,
    "is_external_modification_allowed": true,
    "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 Access Code",
    "pulled_backup_access_code_id": null,
    "starts_at": null,
    "status": "set",
    "type": "ongoing",
    "warnings": [],
    "workspace_id": "750fc0bc-4450-4356-8d9f-18c6a3a6b2c7"
  }
  ```

  ```json Time-bound Online Access Code theme={null}
  {
    "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": [],
    "pending_mutations": [],
    "is_backup": false,
    "is_backup_access_code_available": true,
    "is_external_modification_allowed": true,
    "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 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"
  }
  ```

  ```json Time-bound Offline Access Code theme={null}
  {
    "access_code_id": "e9cf6dd6-89aa-477f-a701-c08f3de13c1f",
    "code": "1234",
    "common_code_key": null,
    "created_at": "2025-06-14T16:54:17.946242Z",
    "device_id": "c9cd621d-ef0c-45c8-b608-026ebdb74615",
    "ends_at": "2025-07-04T16:54:17.946049Z",
    "errors": [],
    "pending_mutations": [],
    "is_backup": false,
    "is_backup_access_code_available": false,
    "is_external_modification_allowed": false,
    "is_managed": true,
    "is_offline_access_code": true,
    "is_one_time_use": false,
    "is_scheduled_on_device": true,
    "is_waiting_for_code_assignment": false,
    "name": "My 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"
  }
  ```
</ResponseExample>

***

## Properties

<ResponseField name="access_code_id" type="String (UUID)">
  Unique identifier for the access code.
</ResponseField>

<ResponseField name="code" type="String">
  Code used for access. Typically, a numeric or alphanumeric string.
</ResponseField>

<ResponseField name="common_code_key" type="String">
  Unique identifier for a group of access codes that share the same code.
</ResponseField>

<ResponseField name="created_at" type="String (ISO 8601)">
  Date and time at which the access code was created.
</ResponseField>

<ResponseField name="device_id" type="String (UUID)">
  Unique identifier for the device associated with the access code.
</ResponseField>

<ResponseField name="dormakaba_oracode_metadata" type="Object">
  Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices.

  <Expandable title="properties">
    <ResponseField name="is_cancellable" type="Boolean">
      Indicates whether the stay can be cancelled via the Dormakaba Oracode API.
    </ResponseField>

    <ResponseField name="is_early_checkin_able" type="Boolean">
      Indicates whether early check-in is available for this stay.
    </ResponseField>

    <ResponseField name="is_extendable" type="Boolean">
      Indicates whether the stay can be extended via the Dormakaba Oracode API.
    </ResponseField>

    <ResponseField name="is_overridable" type="Boolean">
      Indicates whether the access code can be overridden. When false, the maximum number of overrides has been reached.
    </ResponseField>

    <ResponseField name="site_name" type="String">
      Dormakaba Oracode site name associated with this access code.
    </ResponseField>

    <ResponseField name="stay_id" type="number">
      Dormakaba Oracode stay ID associated with this access code.
    </ResponseField>

    <ResponseField name="user_level_id" type="String">
      Dormakaba Oracode user level ID associated with this access code.
    </ResponseField>

    <ResponseField name="user_level_name" type="String">
      Dormakaba Oracode user level name associated with this access code.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="ends_at" type="String (ISO 8601)">
  Date and time after which the time-bound access code becomes inactive.
</ResponseField>

<ResponseField name="errors" type="Array">
  Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
</ResponseField>

<ResponseField name="is_backup" type="Boolean">
  Indicates whether the access code is a backup code.
</ResponseField>

<ResponseField name="is_backup_access_code_available" type="Boolean">
  Indicates whether a backup access code is available for use if the primary access code is lost or compromised.
</ResponseField>

<ResponseField name="is_external_modification_allowed" type="Boolean">
  Indicates whether changes to the access code from external sources are permitted.
</ResponseField>

<ResponseField name="is_managed" type="Boolean">
  Indicates whether Seam manages the access code.
</ResponseField>

<ResponseField name="is_offline_access_code" type="Boolean">
  Indicates whether the access code is intended for use in offline scenarios. If `true`, this code can be created on a device without a network connection.
</ResponseField>

<ResponseField name="is_one_time_use" type="Boolean">
  Indicates whether the access code can only be used once. If `true`, the code becomes invalid after the first use.
</ResponseField>

<ResponseField name="is_scheduled_on_device" type="Boolean">
  Indicates whether the code is set on the device according to a preconfigured schedule.
</ResponseField>

<ResponseField name="is_waiting_for_code_assignment" type="Boolean">
  Indicates whether the access code is waiting for a code assignment.
</ResponseField>

<ResponseField name="name" type="String">
  Name of the 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).
</ResponseField>

<ResponseField name="pending_mutations" type="Array">
  Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device.
</ResponseField>

<ResponseField name="pulled_backup_access_code_id" type="String (UUID)">
  Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code.
</ResponseField>

<ResponseField name="starts_at" type="String (ISO 8601)">
  Date and time at which the time-bound access code becomes active.
</ResponseField>

<ResponseField name="status" type="Enum (String)">
  Current status of the access code within the operational lifecycle. Values are `setting`, a transitional phase that indicates that the code is being configured or activated; `set`, which indicates that the code is active and operational; `unset`, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; `removing`, which indicates a transitional period in which the code is being deleted or made inactive; and `unknown`, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also [Lifecycle of Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes).
</ResponseField>

<ResponseField name="type" type="Enum (String)">
  Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration.
</ResponseField>

<ResponseField name="warnings" type="Array">
  Warnings associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
</ResponseField>

<ResponseField name="workspace_id" type="String (UUID)">
  Unique identifier for the Seam workspace associated with the access code.
</ResponseField>
