Programming Salto Space Card-based Credentials

Learn how to create plastic card-based credentials for Salto Space.

For each access system user in a Salto Space access system, you can create a maximum of one key card credential and one mobile key credential. For Salto Space, you create card credentials and then encode them onto plastic key cards for users.

To use the Seam API to create card credentials for a Salto Space access system:

  1. Assign access permissions to the user by assigning them to one or more access groups.

    • Each access group is preconfigured with specific entrances.

  2. Create a credential.

    • Specify the ID of the access system user.

    • Set the access_method to card.

    • Choose whether to assign a new card to the user or update the user's existing card. Use the Boolean salto_space_metadata.assign_new_key parameter when creating the credential.

      Consider the following situations:

      • To assign a first, new card to a user, set salto_space_metadata.assign_new_key to true.

      • To replace a user's card—for example, if a user has lost their card—delete the user's previous credential and then create a new credential, setting salto_space_metadata.assign_new_key to true. Remember that a Salto Space user can only have one key card at a time.

      • To update a user's card with changed access permissions, set salto_space_metadata.assign_new_key to false. For example, this option is applicable if a user's access group assignment has changed or if the set of entrances for an access group has changed.

  3. Encode the credential onto a card.

    Make sure that each of your Salto Space sites is equipped with a supported card encoder. The NCoder card encoder is compatible with the Seam integration.

    1. Use the /acs/encoders/list endpoint to retrieve a list of available encoders. Then, choose the encoder that you want to use to write the credential to the card. See Retrieve Encoders.

    2. Use the /acs/encoders/encode_credential endpoint to encode the credential onto the card, using the encoder that you have chosen. See Encode the Card.

    3. Confirm that the card was encoded successfully using polling or a webhook. See Confirm Successful Encoding. Also, see a list of common encoding errors.

The following example walks you through this process:

Code:

# Get the access system.
building_a = seam.acs.systems.get(
  acs_system_id="11111111-1111-1111-1111-111111111111"
)

# Step 1:
# Create the new access system user.
jane_user = seam.acs.users.create(
  full_name = "Jane Doe",
  phone_number = "+15555550100",
  acs_system_id = building_a.acs_system_id
)

# Step 2:
# Add the access system user to all desired access groups.
access_group_ids = [
  "44444444-4444-4444-4444-333333333333",
  "44444444-4444-4444-4444-444444444444"
]
for access_group_id in access_group_ids:
  seam.acs.users.add_to_access_group(
    acs_user_id = jane_user.acs_user_id,
    acs_access_group_id = access_group_id
  )

# Step 3:
# Create a card credential for the access system user.
card_credential = seam.acs.credentials.create(
  acs_user_id = jane_user.acs_user_id,
  access_method = "card",
  salto_space_metadata = {
    # This example assigns a new card to the user.
    # To update an existing card, set assign_new_card to False.
    "assign_new_card": True
  }
)

# Step 4:
# Encode the credential onto a card.
# First, get the encoder that you want to use.
encoder = seam.acs.encoders.list(
  acs_system_ids = [building_a.acs_system_id]
)[0]

# Then, encode the card.
encoding_action_attempt = seam.acs.encoders.encode_credential(
  acs_credential_id = card_credential.acs_credential_id,
  acs_encoder_id = encoder.acs_encoder_id
)

# To confirm that the encoding succeeded, 
# poll the returned action attempt
# until its status is success.
seam.action_attempts.get(
  action_attempt_id = encoding_action_attempt.action_attempt_id
)

Output:

AcsCredential(
  acs_credential_id='66666666-6666-6666-6666-666666666666',
  acs_user_id='33333333-3333-3333-3333-333333333333',
  access_method='card',
  is_issued=False,
  ...
)

ActionAttempt(
  status='success',
  action_attempt_id='11111111-2222-3333-4444-555555555555',
  action_type='ENCODE_CREDENTIAL',
  result={
    acs_credential_id='66666666-6666-6666-6666-666666666666',
    card_number='1234abc',
    is_issued=True,
    issued_at='2025-03-01T19:46:06.113Z',
    ...
  },
  error=null
)

Next Steps

You can use an encoder to scan a plastic key card to read its encoded parameters. The scan result includes the card's properties, such as its card number, serial number, and other useful details. For more information, see Scanning Encoded Cards.


Learn More

To find out more about using the Seam API with your Salto Space access system, see the following topics:

Last updated

Was this helpful?

Revision created

ci: Generate docs