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

# PIN Code Quick Start

> Create your first PIN code credential to start controlling an access control system with Seam.

In this quick start, create an ACS user for a virtual [Salto KS](/device-and-system-integration-guides/salto-ks-access-control-system) access control system. Then, grant the user access to an entrance using a PIN code credential.

<Info>
  This quick start walks you through the process that applies specifically to
  the Salto KS ACS. There are often differences between access control systems.
  Once you've completed this quick start, learn how to work with your ACS using
  Seam, by reading the [system integration
  guide](/device-and-system-integration-guides#access-control-systems)
  for your ACS.
</Info>

## Overview

This quick start walks you through the following basic steps:

1. [Connect](/core-concepts/workspaces/index#connecting-virtual-devices) an access control system to Seam.
   * To get started quickly, use a virtual ACS in a [sandbox workspace](/core-concepts/workspaces/index#sandbox-workspaces).
2. Install a Seam SDK and create an API key.
3. Create an [ACS user](../user-management).
   * Also, specify the access schedule for this user.
4. Assign the ACS user to an [access group](../user-management/assigning-users-to-access-groups).
   * Access groups are preconfigured to grant access to specific entrances.\
     While some access control systems use access groups, others specify allowed entrances directly within the credential. For more details, see [Access Permission Assignment Variations](../connect-an-acs-to-seam/understanding-access-control-system-differences#access-permission-assignment-variations).
5. Create a PIN code [ACS credential](../managing-credentials) for the ACS user.
6. View the following information about your successfully-created credential:
   * The PIN code for the credential.
   * The access schedule for the ACS user.
   * The list of entrances to which the ACS user now has access.

:rocket: Let's get started!

***

## Step 1: Connect a Virtual ACS

In this quick start, use Seam Console to connect a virtual ACS to your sandbox workspace. Alternately, you can use the Seam API to create a [Connect Webview](/core-concepts/connect-webviews/index) and then use it to connect an ACS to Seam.

1. Log in to [Seam Console](https://console.seam.co/).

2. In the upper-left corner, click the workspace switcher and select or [create a sandbox workspace](/core-concepts/workspaces/index#create-a-sandbox-workspace).

   <img src="https://mintcdn.com/seam/P0QuBfmp1JAA1zUg/images/workspace-switcher.png?fit=max&auto=format&n=P0QuBfmp1JAA1zUg&q=85&s=1164bfc2d51bb0b1a4987c7a71368aef" alt="Use the Seam Console workspace switcher to switch between workspaces and create new workspaces." width="414" height="87" data-path="images/workspace-switcher.png" />

3. In the top navigation pane, click **ACS Systems**.

   <img src="https://mintcdn.com/seam/3MkQAe40a-b0KYcA/images/acs-quick-start-access-systems-tab.png?fit=max&auto=format&n=3MkQAe40a-b0KYcA&q=85&s=3d282fa03fe9644d76b7b5a6d1fdd061" alt="Click ACS Systems to go to the Access Systems page." style={{width: "550px", height: "auto"}} width="1920" height="287" data-path="images/acs-quick-start-access-systems-tab.png" />

4. On the **Access Systems** page, click **New Access System**.

   Seam Console displays a Connect Webview that enables you to connect a virtual ACS to Seam.

5. In the Connect Webview, authorize the connection.

   1. Click **Continue**.
   2. In the device brand list, click **Salto KS**.
   3. On the Salto KS authorization page:
      1. In the **Email** field, type `jane@example.com`.
      2. In the **Password** field, type `1234`.
      3. Click **Log In**.
      4. When prompted to allow application access, click **Yes, Allow**.
      5. In the sites list, select **Main Site** and then click **Continue**.
      6. Click **Close**.

   The **Access Systems** page now displays the newly-connected virtual Salto KS access control system.

***

## Step 2: Install a Seam SDK and Create an API Key

1. Download and install a Seam SDK in your favorite programming language.

<Tabs>
  <Tab title="JavaScript">
    ```bash theme={null}
    npm i seam
    ```
  </Tab>

  <Tab title="Python">
    ```bash theme={null}
    pip install seam
    # For some development environments, use pip3 in this command instead of pip.
    ```
  </Tab>

  <Tab title="Ruby">
    ```bash theme={null}
    bundle add seam
    ```
  </Tab>

  <Tab title="PHP">
    ```bash theme={null}
    composer require seamapi/seam
    ```
  </Tab>

  <Tab title="C#">
    Install using [nuget](https://www.nuget.org/packages/Seam).
  </Tab>
</Tabs>

2. Create an API key.
   1. In the top navigation pane of [Seam Console](https://console.seam.co/), click **Developer**.
   2. In the left navigation pane, click **API Keys**.
   3. In the upper-right corner of the **API Keys** page, click **Add API Key**.
   4. In the **Add API Key** dialog, type a name for your new API key and then click **Create API Key**.
   5. Copy the newly-created API key and store it for future use.
3. Open a terminal window and export your API key as an environment variable.

   ```sh theme={null}
   export SEAM_API_KEY=seam_test2bMS_94SrGUXuNR2JmJkjtvBQDg5c
   ```

   The Seam SDK that you have installed automatically uses this API key once you have exported it.

***

## Step 3: Create an ACS User

Create an ACS user within the virtual Salto KS access control system, and specify an access schedule for this user.

1. Find the ACS system ID.
   1. In the top navigation pane of [Seam Console](https://console.seam.co/), click **ACS Systems**.
   2. On the **Access Systems** page, locate the Salto KS Main Site ACS.
   3. In the **acs\_system\_id** column for the Main Site ACS, click the ID to copy it.
   4. Store this ACS system ID for future use.
2. Create the ACS user, as follows:

**Code:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  import { Seam } from 'seam'

  const seam = new Seam() // Seam automatically uses your exported SEAM_API_KEY.

  const acsUser = await seam.acs.users.create({
    full_name: 'June Doe',
    // Use the ACS system ID that you copied earlier from Seam Console.
    acs_system_id: acsSystemId,
    access_schedule: {
      starts_at: '2025-02-10T15:00:00.000Z',
      ends_at: '2025-02-12T11:00:00.000Z',
    },
  })
  ```

  ```bash cURL theme={null}
  # Use the ACS system ID that you copied earlier from Seam Console.
  acs_user=$(curl -X 'POST' \
    'https://connect.getseam.com/acs/users/create' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
    \"full_name\": \"June Doe\",
    \"acs_system_id\": \"${acs_system_id}\",
    \"access_schedule\": {
        \"starts_at\": \"2025-02-10T15:00:00.000Z\",
        \"ends_at\": \"2025-02-12T11:00:00.000Z\"
    }
  }")
  ```

  ```python Python theme={null}
  from seam import Seam

  seam = Seam()  # Seam automatically uses your exported SEAM_API_KEY.

  acs_user = seam.acs.users.create(
    full_name = "June Doe",
    # Use the ACS system ID that you copied earlier from Seam Console.
    acs_system_id = acs_system_id,
    access_schedule = {
      "starts_at": "2025-02-10T15:00:00.000Z",
      "ends_at": "2025-02-12T11:00:00.000Z"
    }
  )
  ```

  ```ruby Ruby theme={null}
  require "seam"

  seam = Seam.new() # Seam automatically uses your exported SEAM_API_KEY.

  acs_user = seam.acs.users.create(
    full_name: "June Doe",
    # Use the ACS system ID that you copied earlier from Seam Console.
    acs_system_id: acs_system_id,
    access_schedule: {
      "starts_at": "2025-02-10T15:00:00.000Z",
      "ends_at": "2025-02-12T11:00:00.000Z"
    }
  )
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';

  $seam = new Seam\SeamClient(); // Seam automatically uses your exported SEAM_API_KEY.

  $acs_user = $seam->acs->users->create(
    full_name: "June Doe",
    // Use the ACS system ID that you copied earlier from Seam Console.
    acs_system_id: $acs_system_id,
    access_schedule: array(
      "starts_at" => "2025-02-10T15:00:00.000Z",
      "ends_at" => "2025-02-12T11:00:00.000Z"
    )
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Output:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    acs_user_id: '33333333-3333-3333-3333-333333333333',
    full_name: 'June Doe',
    access_schedule: {
      "starts_at": "2025-02-10T15:00:00.000Z",
      "ends_at": "2025-02-12T11:00:00.000Z"
    },
    ...
  }
  ```

  ```json cURL theme={null}
  {
    "acs_user": {
      "acs_user_id": "33333333-3333-3333-3333-333333333333",
      "full_name": "June Doe",
      "access_schedule": {
        "starts_at": "2025-02-10T15:00:00.000Z",
        "ends_at": "2025-02-12T11:00:00.000Z"
      },
      ...
    },
    "ok": true
  }
  ```

  ```json Python theme={null}
  AcsUser(
    acs_user_id='33333333-3333-3333-3333-333333333333',
    full_name='June Doe',
    access_schedule={
      'starts_at': '2025-02-10T15:00:00.000Z',
      'ends_at': '2025-02-12T11:00:00.000Z'
    },
    ...
  )
  ```

  ```json Ruby theme={null}
  <Seam::Resources::AcsUser:0x005f0
    acs_user_id="33333333-3333-3333-3333-333333333333"
    full_name="June Doe"
    access_schedule=#<Seam::DeepHashAccessor:0x000001fd69e446f8 @data={
      "starts_at"=>"2025-02-10T15:00:00.000Z",
      "ends_at"=>"2025-02-12T11:00:00.000Z"
    }>
    ...
  >
  ```

  ```json PHP theme={null}
  {
    "acs_user_id": "33333333-3333-3333-3333-333333333333",
    "full_name": "June Doe",
    "access_schedule": {
      "starts_at": "2025-02-10T15:00:00.000Z",
      "ends_at": "2025-02-12T11:00:00.000Z"
    },
    ...
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Step 4: Assign the ACS User to an Access Group

Add the ACS user to an access group. For Salto KS, access groups specify the entrances to which users have access.

Some other access control systems do not use access groups and, instead, specify allowed entrances directly within the credential. For more details, see [Access Permission Assignment Variations](../connect-an-acs-to-seam/understanding-access-control-system-differences#access-permission-assignment-variations).

1. Find the access group ID.
   1. In the top navigation pane of [Seam Console](https://console.seam.co/), click **ACS Systems**.
   2. On the **Access Systems** page, click the Salto KS Main Site ACS.
   3. On the **Main Site** page, click the **Access Groups** tab.
   4. Locate the Main Group, click **...**, and click **Copy Id**.
   5. Store this access group ID for future use.
2. Assign the ACS user to the Main Group, as follows:

**Code:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.acs.users.addToAccessGroup({
    acs_user_id: acsUser.acs_user_id,
    // Use the access group ID that you copied earlier from Seam Console.
    acs_access_group_id: accessGroupId,
  })
  ```

  ```bash cURL theme={null}
  # Use the access group ID that you copied earlier from Seam Console.
  curl -X 'POST' \
    'https://connect.getseam.com/acs/users/add_to_access_group' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
    \"acs_user_id\": \"$(jq -r '.acs_user.acs_user_id' <<< ${acs_user})\",
    \"acs_access_group_id\": \"${access_group_id}\"
  }"
  ```

  ```python Python theme={null}
  seam.acs.users.add_to_access_group(
    acs_user_id = acs_user.acs_user_id,
    # Use the access group ID that you copied earlier from Seam Console.
    acs_access_group_id = access_group_id
  )
  ```

  ```ruby Ruby theme={null}
  seam.acs.users.add_to_access_group(
    acs_user_id: acs_user.acs_user_id,
    # Use the access group ID that you copied earlier from Seam Console.
    acs_access_group_id: access_group_id
  )
  ```

  ```php PHP theme={null}
  $seam->acs->users->add_to_access_group(
    acs_user_id: $acs_user->acs_user_id,
    // Use the access group ID that you copied earlier from Seam Console.
    acs_access_group_id: $access_group_id
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Output:**

<CodeGroup>
  ```json JavaScript theme={null}
  void
  ```

  ```json cURL theme={null}
  {
    "ok": true
  }
  ```

  ```json Python theme={null}
  None
  ```

  ```json Ruby theme={null}
  nil
  ```

  ```json PHP theme={null}
  void
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Step 5: Create a PIN Code Credential

Create a PIN code credential for the ACS user. After you create the credential, Salto KS generates the corresponding PIN code.

**Code:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  const pinCodeCredential = await seam.acs.credentials.create({
    acs_user_id: acsUser.acs_user_id,
    access_method: 'code',
  })
  ```

  ```bash cURL theme={null}
  pin_code_credential=$(curl -X 'POST' \
    'https://connect.getseam.com/acs/credentials/create' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
    \"acs_user_id\": \"$(jq -r '.acs_user.acs_user_id' <<< ${acs_user})\",
    \"access_method\": \"code\"
  }")
  ```

  ```python Python theme={null}
  pin_code_credential = seam.acs.credentials.create(
    acs_user_id = acs_user.acs_user_id,
    access_method = "code"
  )
  ```

  ```ruby Ruby theme={null}
  pin_code_credential = seam.acs.credentials.create(
    acs_user_id: acs_user.acs_user_id,
    access_method: "code"
  )
  ```

  ```php PHP theme={null}
  $pin_code_credential = $seam->acs->credentials->create(
    acs_user_id: $acs_user->acs_user_id,
    access_method: "code"
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Output:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    acs_credential_id: '66666666-6666-6666-6666-666666666666',
    acs_system_id: '11111111-1111-1111-1111-111111111111',
    acs_user_id: '33333333-3333-3333-3333-333333333333',
    code: '123456',
    access_method: 'code',
    ...
  }
  ```

  ```json cURL theme={null}
  {
    "acs_credential":{
      "acs_credential_id": "66666666-6666-6666-6666-666666666666",
      "acs_system_id": "11111111-1111-1111-1111-111111111111",
      "acs_user_id": "33333333-3333-3333-3333-333333333333",
      "code": "123456",
      "access_method": "code",
      ...
    }
  }
  ```

  ```json Python theme={null}
  AcsCredential(
    acs_credential_id='66666666-6666-6666-6666-666666666666',
    acs_system_id='11111111-1111-1111-1111-111111111111',
    acs_user_id='33333333-3333-3333-3333-333333333333',
    code='123456',
    access_method='code',
    ...
  )
  ```

  ```json Ruby theme={null}
  <Seam::Resources::AcsCredential:0x005f0
    acs_credential_id="66666666-6666-6666-6666-666666666666"
    acs_user_id="33333333-3333-3333-3333-333333333333"
    code="123456"
    access_method="code"
    ...
  >
  ```

  ```json PHP theme={null}
  {
    "acs_credential_id": "66666666-6666-6666-6666-666666666666",
    "acs_system_id": "11111111-1111-1111-1111-111111111111",
    "acs_user_id": "33333333-3333-3333-3333-333333333333",
    "code": "123456",
    "access_method": "code",
    ...
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Step 6: View Your New Credential

You can use Seam Console, the Seam API, or the [Seam CLI](../../../core-concepts/seam-console/seam-online-cli) to view the following information about your successfully-created credential:

* The PIN code for the credential.
* The access schedule for the ACS user.
* The list of entrances to which the ACS user now has access.

To use Seam Console to view information about your new PIN code credential:

1. In the top navigation pane of [Seam Console](https://console.seam.co/), click **ACS Systems**.

2. On the **Access Systems** page, click the Salto KS Main Site ACS.

3. In the **Users** table, click **June Doe**, the ACS user that you created.

   <img src="https://mintcdn.com/seam/d6yLSFlGuXxmvz_6/images/pin-code-quick-start-user.png?fit=max&auto=format&n=d6yLSFlGuXxmvz_6&q=85&s=ce09cafe433a2c8c93dd6e94f6fe4874" alt="Click the ACS user to view their credentials." style={{width: "550px", height: "auto"}} width="1182" height="251" data-path="images/pin-code-quick-start-user.png" />

4. In the **Credentials** tab for the ACS user, view the **Code** for the PIN code credential that you created.

   <img src="https://mintcdn.com/seam/d6yLSFlGuXxmvz_6/images/pin-code-quick-start-code-display.png?fit=max&auto=format&n=d6yLSFlGuXxmvz_6&q=85&s=8c0e3840b40ef909f36a8c9aad6cb842" alt="View the PIN code for the credential that you created." style={{width: "550px", height: "auto"}} width="1184" height="374" data-path="images/pin-code-quick-start-code-display.png" />

5. In the **Properties** area for the ACS user, view the user's access schedule.\
   Note that Seam Console displays times adjusted to your local computer settings. That is, the times that you see in Seam Console are the times that you specified when creating the credential, adjusted to match your computer's time settings.

   <img src="https://mintcdn.com/seam/d6yLSFlGuXxmvz_6/images/pin-code-quick-start-access-schedule.png?fit=max&auto=format&n=d6yLSFlGuXxmvz_6&q=85&s=f6f9f241a210bbebf78cd9b836f63f81" alt="View the access schedule for the ACS user." width="398" height="236" data-path="images/pin-code-quick-start-access-schedule.png" />

6. Click the **Access Groups** tab for the ACS user.

7. Click the **Main Group** access group.

8. On the **Main Group** page click the **Entrances** tab and then view the entrances to which this access group grants the ACS user access.

   <img
     src="https://mintcdn.com/seam/d6yLSFlGuXxmvz_6/images/pin-code-quick-start-access-group-entrances.png?fit=max&auto=format&n=d6yLSFlGuXxmvz_6&q=85&s=e5ee4cad81fb6e545141a49361aa1da5"
     alt="View the entrances to which the ACS user has access as a member of the
   access group."
     width="1550"
     height="419"
     data-path="images/pin-code-quick-start-access-group-entrances.png"
   />

***

## Next Steps

Now that you've created a PIN code credential, try out the other ACS quick starts.

* [Key Card Quick Start](/low-level-apis/access-systems/acs-quick-starts/encodable-key-card-quick-start)
* [Mobile Key Quick Start](/low-level-apis/access-systems/acs-quick-starts/mobile-key-quick-start)

Then, [connect your ACS to Seam](/low-level-apis/access-systems/connect-an-acs-to-seam/index).

***

## Learn More

For a deeper dive into ACS concepts and instructions, see the following topics:

1. Learn about ACS concepts.
   * [Access Control System Resources](../connect-an-acs-to-seam/access-control-system-resources)
   * [Understanding ACS Differences](../connect-an-acs-to-seam/understanding-access-control-system-differences)
2. Create ACS users.
   * [Managing ACS Users](../user-management)
3. For relevant access control systems, assign ACS users to access groups.
   * [Assigning ACS Users to Access Groups](../user-management/assigning-users-to-access-groups)
4. Learn about available entrances.
   * [Retrieving Entrance Details](../retrieving-entrance-details)
5. Create credentials for ACS users.
   * [Managing Credentials](../managing-credentials)
6. See the Seam [Access Control Systems API reference](/api/acs/object).
