> ## 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.

# Get an Access Code

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

You must specify either `access_code_id` or both `device_id` and `code`.



## OpenAPI

````yaml /openapi.json post /access_codes/get
openapi: 3.0.0
info:
  title: Seam Connect
  version: 1.0.0
servers:
  - url: https://connect.getseam.com
security: []
tags:
  - description: access_codes
    name: /access_codes
  - description: acs
    name: /acs
  - description: action_attempts
    name: /action_attempts
  - description: client_sessions
    name: /client_sessions
  - description: connected_accounts
    name: /connected_accounts
  - description: connect_webviews
    name: /connect_webviews
  - description: devices
    name: /devices
  - description: events
    name: /events
  - description: health
    name: /health
  - description: locks
    name: /locks
  - description: networks
    name: /networks
  - description: noise_sensors
    name: /noise_sensors
  - description: phones
    name: /phones
  - description: thermostats
    name: /thermostats
  - description: user_identities
    name: /user_identities
  - description: webhooks
    name: /webhooks
  - description: workspaces
    name: /workspaces
paths:
  /access_codes/get:
    post:
      tags:
        - /access_codes
      summary: Get an Access Code
      description: >-
        Returns a specified [access
        code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).


        You must specify either `access_code_id` or both `device_id` and `code`.
      operationId: accessCodesGetPost
      requestBody:
        content:
          application/json:
            schema:
              properties:
                access_code_id:
                  description: >-
                    ID of the access code that you want to get. You must specify
                    either `access_code_id` or both `device_id` and `code`.
                  format: uuid
                  type: string
                code:
                  description: >-
                    Code of the access code that you want to get. You must
                    specify either `access_code_id` or both `device_id` and
                    `code`.
                  type: string
                device_id:
                  description: >-
                    ID of the device containing the access code that you want to
                    get. You must specify either `access_code_id` or both
                    `device_id` and `code`.
                  format: uuid
                  type: string
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  access_code:
                    $ref: '#/components/schemas/access_code'
                  ok:
                    type: boolean
                required:
                  - access_code
                  - ok
                type: object
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      security:
        - api_key: []
        - pat_with_workspace: []
        - console_session_with_workspace: []
        - client_session: []
        - client_session_with_customer: []
      x-codeSamples:
        - lang: javascript
          label: Seam SDK
          source: |-
            await seam.accessCodes.get({
              access_code_id: "90a114dc-48b5-4b8b-a3d3-972344594401",
            });

            /*
            {
              "access_code_id": "90a114dc-48b5-4b8b-a3d3-972344594401",
              "code": "1234",
              "common_code_key": null,
              "created_at": "2025-06-14T16:54:17.946242Z",
              "device_id": "7bce4bcc-6c35-4cc0-bbae-1c8bc5b4a5b5",
              "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 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"
            }
            */
        - lang: bash
          label: cURL
          source: >-
            curl --include --request POST
            "https://connect.getseam.com/access_codes/get" \
              --header "Authorization: Bearer $SEAM_API_KEY" \
              --json @- <<EOF
            {
              "access_code_id": "90a114dc-48b5-4b8b-a3d3-972344594401"
            }

            EOF


            # Response:

            # {

            #   "access_code": {

            #     "access_code_id": "90a114dc-48b5-4b8b-a3d3-972344594401",

            #     "code": "1234",

            #     "common_code_key": null,

            #     "created_at": "2025-06-14T16:54:17.946242Z",

            #     "device_id": "7bce4bcc-6c35-4cc0-bbae-1c8bc5b4a5b5",

            #     "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 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"

            #   }

            # }
        - lang: python
          label: Seam SDK
          source: >-
            seam.access_codes.get(access_code_id="90a114dc-48b5-4b8b-a3d3-972344594401")


            # AccessCode(
                access_code_id="90a114dc-48b5-4b8b-a3d3-972344594401",
                code="1234",
                common_code_key=None,
                created_at="2025-06-14T16:54:17.946242Z",
                device_id="7bce4bcc-6c35-4cc0-bbae-1c8bc5b4a5b5",
                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 Access Code",
                pulled_backup_access_code_id=None,
                starts_at="2025-07-02T16:54:17.946049Z",
                status="set",
                type="time_bound",
                warnings=[],
                workspace_id="750fc0bc-4450-4356-8d9f-18c6a3a6b2c7",
            )
        - lang: ruby
          label: Seam SDK
          source: >-
            seam.access_codes.get(access_code_id:
            "90a114dc-48b5-4b8b-a3d3-972344594401")


            # => {
              "access_code_id" => "90a114dc-48b5-4b8b-a3d3-972344594401",
              "code" => "1234",
              "common_code_key" => nil,
              "created_at" => "2025-06-14T16:54:17.946242Z",
              "device_id" => "7bce4bcc-6c35-4cc0-bbae-1c8bc5b4a5b5",
              "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 Access Code",
              "pulled_backup_access_code_id" => nil,
              "starts_at" => "2025-07-02T16:54:17.946049Z",
              "status" => "set",
              "type" => "time_bound",
              "warnings" => [],
              "workspace_id" => "750fc0bc-4450-4356-8d9f-18c6a3a6b2c7",
            }
        - lang: php
          label: Seam SDK
          source: |-
            $seam->access_codes->get(
                access_code_id: "90a114dc-48b5-4b8b-a3d3-972344594401",
            );

            // [
                "access_code_id" => "90a114dc-48b5-4b8b-a3d3-972344594401",
                "code" => "1234",
                "common_code_key" => null,
                "created_at" => "2025-06-14T16:54:17.946242Z",
                "device_id" => "7bce4bcc-6c35-4cc0-bbae-1c8bc5b4a5b5",
                "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 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",
            ];
        - lang: bash
          label: Seam CLI
          source: >-
            seam access-codes get --access_code_id
            "90a114dc-48b5-4b8b-a3d3-972344594401"


            # {

            #   "access_code_id": "90a114dc-48b5-4b8b-a3d3-972344594401",

            #   "code": "1234",

            #   "common_code_key": null,

            #   "created_at": "2025-06-14T16:54:17.946242Z",

            #   "device_id": "7bce4bcc-6c35-4cc0-bbae-1c8bc5b4a5b5",

            #   "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 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"

            # }
components:
  schemas:
    access_code:
      description: >-
        Represents a smart lock [access
        code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
      properties:
        access_code_id:
          description: Unique identifier for the access code.
          format: uuid
          type: string
        code:
          description: Code used for access. Typically, a numeric or alphanumeric string.
          nullable: true
          type: string
        common_code_key:
          description: >-
            Unique identifier for a group of access codes that share the same
            code.
          nullable: true
          type: string
        created_at:
          description: Date and time at which the access code was created.
          format: date-time
          type: string
        device_id:
          description: Unique identifier for the device associated with the access code.
          format: uuid
          type: string
        dormakaba_oracode_metadata:
          description: >-
            Metadata for a dormakaba Oracode managed access code. Only present
            for access codes from dormakaba Oracode devices.
          nullable: true
          properties:
            is_cancellable:
              description: >-
                Indicates whether the stay can be cancelled via the Dormakaba
                Oracode API.
              type: boolean
            is_early_checkin_able:
              description: Indicates whether early check-in is available for this stay.
              type: boolean
            is_extendable:
              description: >-
                Indicates whether the stay can be extended via the Dormakaba
                Oracode API.
              type: boolean
            is_overridable:
              description: >-
                Indicates whether the access code can be overridden. When false,
                the maximum number of overrides has been reached.
              type: boolean
            site_name:
              description: Dormakaba Oracode site name associated with this access code.
              type: string
            stay_id:
              description: Dormakaba Oracode stay ID associated with this access code.
              format: float
              type: number
            user_level_id:
              description: >-
                Dormakaba Oracode user level ID associated with this access
                code.
              type: string
            user_level_name:
              description: >-
                Dormakaba Oracode user level name associated with this access
                code.
              nullable: true
              type: string
          required:
            - stay_id
            - user_level_name
          type: object
        ends_at:
          description: >-
            Date and time after which the time-bound access code becomes
            inactive.
          format: date-time
          nullable: true
          type: string
        errors:
          type: array
          description: >-
            Errors associated with the [access
            code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
          items:
            type: object
            properties:
              error_code:
                type: string
                description: Error or warning code.
              message:
                type: string
                description: Human-readable description.
              created_at:
                type: string
                format: date-time
                description: When this error or warning was generated.
        is_backup:
          description: Indicates whether the access code is a backup code.
          type: boolean
        is_backup_access_code_available:
          description: >-
            Indicates whether a backup access code is available for use if the
            primary access code is lost or compromised.
          type: boolean
        is_external_modification_allowed:
          description: >-
            Indicates whether changes to the access code from external sources
            are permitted.
          type: boolean
        is_managed:
          description: Indicates whether Seam manages the access code.
          enum:
            - true
          type: boolean
        is_offline_access_code:
          description: >-
            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.
          type: boolean
        is_one_time_use:
          description: >-
            Indicates whether the access code can only be used once. If `true`,
            the code becomes invalid after the first use.
          type: boolean
        is_scheduled_on_device:
          description: >-
            Indicates whether the code is set on the device according to a
            preconfigured schedule.
          type: boolean
        is_waiting_for_code_assignment:
          description: Indicates whether the access code is waiting for a code assignment.
          type: boolean
        name:
          description: >-
            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).
          nullable: true
          type: string
        pending_mutations:
          description: >-
            Collection of pending mutations for the access code. Indicates
            changes that Seam is in the process of pushing to the device.
          items:
            discriminator:
              propertyName: mutation_code
            oneOf:
              - description: >-
                  Seam is in the process of setting an access code on the
                  device.
                properties:
                  created_at:
                    description: Date and time at which the mutation was created.
                    format: date-time
                    type: string
                  message:
                    description: Detailed description of the mutation.
                    type: string
                  mutation_code:
                    description: >-
                      Mutation code to indicate that Seam is in the process of
                      setting an access code on the device.
                    enum:
                      - creating
                    type: string
                required:
                  - created_at
                  - message
                  - mutation_code
                type: object
              - description: >-
                  Seam is waiting until closer to the access code's start time
                  before programming it on the device.
                properties:
                  created_at:
                    description: Date and time at which the mutation was created.
                    format: date-time
                    type: string
                  message:
                    description: Detailed description of the mutation.
                    type: string
                  mutation_code:
                    description: >-
                      Mutation code to indicate that Seam is waiting until
                      closer to the access code's start time before programming
                      it on the device.
                    enum:
                      - deferring_creation
                    type: string
                  scheduled_at:
                    description: >-
                      Date and time at which Seam will attempt to program this
                      access code on the device.
                    format: date-time
                    type: string
                required:
                  - created_at
                  - message
                  - mutation_code
                  - scheduled_at
                type: object
              - description: >-
                  Seam is in the process of removing an access code from the
                  device.
                properties:
                  created_at:
                    description: Date and time at which the mutation was created.
                    format: date-time
                    type: string
                  message:
                    description: Detailed description of the mutation.
                    type: string
                  mutation_code:
                    description: >-
                      Mutation code to indicate that Seam is in the process of
                      removing an access code from the device.
                    enum:
                      - deleting
                    type: string
                required:
                  - created_at
                  - message
                  - mutation_code
                type: object
              - description: >-
                  Seam is in the process of pushing an updated PIN code to the
                  device.
                properties:
                  created_at:
                    description: Date and time at which the mutation was created.
                    format: date-time
                    type: string
                  from:
                    description: Previous code configuration.
                    properties:
                      code:
                        description: Previous PIN code.
                        nullable: true
                        type: string
                    required:
                      - code
                    type: object
                  message:
                    description: Detailed description of the mutation.
                    type: string
                  mutation_code:
                    description: >-
                      Mutation code to indicate that Seam is in the process of
                      pushing an updated PIN code to the device.
                    enum:
                      - updating_code
                    type: string
                  to:
                    description: New code configuration.
                    properties:
                      code:
                        description: New PIN code.
                        nullable: true
                        type: string
                    required:
                      - code
                    type: object
                required:
                  - created_at
                  - message
                  - mutation_code
                  - from
                  - to
                type: object
              - description: >-
                  Seam is in the process of pushing an updated access code name
                  to the device.
                properties:
                  created_at:
                    description: Date and time at which the mutation was created.
                    format: date-time
                    type: string
                  from:
                    description: Previous name configuration.
                    properties:
                      name:
                        description: Previous access code name.
                        nullable: true
                        type: string
                    required:
                      - name
                    type: object
                  message:
                    description: Detailed description of the mutation.
                    type: string
                  mutation_code:
                    description: >-
                      Mutation code to indicate that Seam is in the process of
                      pushing an updated access code name to the device.
                    enum:
                      - updating_name
                    type: string
                  to:
                    description: New name configuration.
                    properties:
                      name:
                        description: New access code name.
                        nullable: true
                        type: string
                    required:
                      - name
                    type: object
                required:
                  - created_at
                  - message
                  - mutation_code
                  - from
                  - to
                type: object
              - description: >-
                  Seam is in the process of pushing an updated time frame to the
                  device.
                properties:
                  created_at:
                    description: Date and time at which the mutation was created.
                    format: date-time
                    type: string
                  from:
                    description: Previous time frame configuration.
                    properties:
                      ends_at:
                        description: Previous end time for the access code.
                        format: date-time
                        nullable: true
                        type: string
                      starts_at:
                        description: Previous start time for the access code.
                        format: date-time
                        nullable: true
                        type: string
                    required:
                      - starts_at
                      - ends_at
                    type: object
                  message:
                    description: Detailed description of the mutation.
                    type: string
                  mutation_code:
                    description: >-
                      Mutation code to indicate that Seam is in the process of
                      pushing updated access code time frame to the device.
                    enum:
                      - updating_time_frame
                    type: string
                  to:
                    description: New time frame configuration.
                    properties:
                      ends_at:
                        description: New end time for the access code.
                        format: date-time
                        nullable: true
                        type: string
                      starts_at:
                        description: New start time for the access code.
                        format: date-time
                        nullable: true
                        type: string
                    required:
                      - starts_at
                      - ends_at
                    type: object
                required:
                  - created_at
                  - message
                  - mutation_code
                  - from
                  - to
                type: object
          type: array
        pulled_backup_access_code_id:
          description: >-
            Identifier of the pulled backup access code. Used to associate the
            pulled backup access code with the original access code.
          format: uuid
          nullable: true
          type: string
        starts_at:
          description: Date and time at which the time-bound access code becomes active.
          format: date-time
          nullable: true
          type: string
        status:
          description: >-
            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).
          enum:
            - setting
            - set
            - unset
            - removing
            - unknown
          type: string
        type:
          description: >-
            Type of the access code. `ongoing` access codes are active
            continuously until deactivated manually. `time_bound` access codes
            have a specific duration.
          enum:
            - time_bound
            - ongoing
          type: string
        warnings:
          type: array
          description: >-
            Warnings associated with the [access
            code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).
          items:
            type: object
            properties:
              error_code:
                type: string
                description: Error or warning code.
              message:
                type: string
                description: Human-readable description.
              created_at:
                type: string
                format: date-time
                description: When this error or warning was generated.
        workspace_id:
          description: >-
            Unique identifier for the Seam workspace associated with the access
            code.
          format: uuid
          type: string
      required:
        - workspace_id
        - common_code_key
        - type
        - access_code_id
        - device_id
        - name
        - code
        - created_at
        - errors
        - warnings
        - is_managed
        - status
        - is_backup_access_code_available
        - is_external_modification_allowed
        - is_one_time_use
        - is_offline_access_code
        - pending_mutations
      type: object
      x-route-path: /access_codes
  securitySchemes:
    api_key:
      bearerFormat: API Key
      scheme: bearer
      type: http
    pat_with_workspace:
      bearerFormat: API Token
      scheme: bearer
      type: http
    console_session_with_workspace:
      bearerFormat: Console Session Token
      scheme: bearer
      type: http
    client_session:
      bearerFormat: Client Session Token
      scheme: bearer
      type: http
    client_session_with_customer:
      bearerFormat: Customer Client Session Token
      scheme: bearer
      type: http

````