LogoLogo
Sign UpSupported Devices
  • Seam Documentation
  • 🚲Quick Start
  • 🚀Go Live!
  • Contact Us
  • Core Concepts
    • Overview
    • Seam Console
      • Seam Online CLI
    • Workspaces
    • Authentication
      • API Keys
      • Personal Access Tokens
      • Client Sessions and Client Session Tokens
        • Implementing Client Sessions for Device Management in the Backend
    • Devices
      • Displaying Device Health
      • Displaying Device Power Status
      • Managed and Unmanaged Devices
      • Adding Custom Metadata to a Device
      • Filtering Devices by Custom Metadata
      • Testing Your App Against Device Disconnection and Removal
    • Connected Accounts
      • Adding Custom Metadata to a Connected Account
      • Filtering Connected Accounts by Custom Metadata
      • Reconnecting an Account
    • Action Attempts
  • Capability Guides
    • 📋Device and System Capabilities
    • 🔒Smart Locks
      • Locking and Unlocking Smart Locks
      • Creating and Managing Smart Lock Access Codes
        • Creating Access Codes
        • Retrieving Access Codes
        • Modifying Access Codes
        • Deleting Access Codes
        • Lifecycle of Access Codes
        • Access Code Requirements for Door Locks
        • Streamlining Access Code Management from the Manufacturer App
        • Troubleshooting Access Codes
        • Managing Backup Access Codes
        • Managing Offline Access Codes
        • Creating and Updating Multiple Linked Access Codes
        • Migrating Existing Unmanaged Access Codes
    • 🏢Access Control Systems
      • ACS Quick Starts
        • PIN Code Quick Start
        • Encodable Key Card Quick Start
        • Mobile Key Quick Start
      • Connect an ACS to Seam
        • Retrieving ACS System Details
        • Access Control System Resources
        • Understanding Access Control System Differences
      • Managing ACS Users
        • Suspending and Unsuspending ACS Users
        • Assigning ACS Users to Access Groups
      • Retrieving Entrance Details
      • Managing Credentials
        • Assigning Credentials to ACS Users
        • Listing Credentials and Associated Entrances
      • Working with Card Encoders and Scanners
        • Creating and Encoding Card-based Credentials
        • Scanning Encoded Cards
      • Troubleshooting Your Access Control System
    • 📱Mobile Access
      • Prepare your Workspace
      • Managing Mobile App User Accounts with User Identities
      • Managing Phones for a User Identity
      • Issuing Mobile Credentials from an Access Control System
      • Developing in a Sandbox Workspace
      • Integrating into your Mobile Application
        • Initializing the Seam Mobile SDK
        • Handling System Permissions
        • Using Unlock With Tap
    • 🌡️Thermostats
      • Understanding Thermostat Concepts
        • HVAC Mode
        • Set Points
      • Retrieving Thermostats
      • Setting and Monitoring Temperature Thresholds
      • Setting the Current HVAC and Fan Mode Settings
      • Creating and Managing Climate Presets
        • Setting the Fallback Climate Preset
        • Activating a Climate Preset
      • Creating and Managing Thermostat Schedules
      • Testing Your Thermostat App with Simulate Endpoints
    • 👂Noise Sensors
      • Configuring Noise Threshold Settings
    • 📡Seam Bridge
  • 💻UI Components
    • 🔌Connect Webviews
      • Connect Webview Process
      • Embedding a Connect Webview in Your App
      • Verifying Successful Account Connection
      • Retrieving Devices or Access Control Systems Connected Through a Connect Webview
      • Attaching Custom Metadata to the Connect Webview
      • Filtering Connect Webviews by Custom Metadata
      • Customizing Connect Webviews
    • 🧱Seam Components
      • Getting Started with Seam Components
        • Get Started with React
        • Get started with Angular
        • Get started with Vue
        • Get started with Client Side Components
      • Components
        • Device Details
        • Device Table
        • Access Code Table
        • Access Code Details
        • Create Access Code Form
        • Update Access Code Form
        • Supported Devices Table
        • Seam Provider
        • Connect Account Button
      • Make a Supported Devices Page
      • Using User Identities to Scope Users' Device Access
  • 📋API Reference
    • Overview
    • Installation
    • Authentication
    • Workspaces
      • Get Workspace
      • Reset Workspace
    • Client Sessions
      • Create a Client Session
      • Get or Create a Client Session
      • List Client Sessions
      • Get a Client Session
      • Grant Access to a Client Session
      • Delete a Client Session
    • Connect Webviews
      • Create a Connect Webview
      • List Connect Webviews
      • Get a Connect Webview
      • Delete a Connect Webview
    • Connected Accounts
      • Get a Connected Account
      • List Connected Accounts
      • Update a Connected Account
      • Delete a Connected Account
    • Devices
      • List Devices
      • List Device Providers
      • Device Provider Metadata
      • Get a Device
      • Update a Device
      • Unmanaged Devices
        • Update an Unmanaged Device
        • List Unmanaged Devices
        • Get an Unmanaged Device
    • Access Codes
      • Create an Access Code
      • Create Multiple Linked Access Codes
      • List Access Codes
      • Get an Access Code
      • Update an Access Code
      • Update Multiple Linked Access Codes
      • Report Device Access Code Constraints
      • Delete an Access Code
      • Pull Backup Access Code
      • Unmanaged Access Codes
        • List Unmanaged Access Codes
        • Convert an Unmanaged Access Code
        • Delete an Unmanaged Access Code
    • Locks
      • Get Lock
      • Lock a Lock
      • Unlock a Lock
      • List Locks
    • Access Control Systems
      • Systems
        • List ACS Systems
        • Get an ACS System
        • List Compatible Credential Manager ACS Systems
      • ACS Users
        • Create an ACS User
        • List ACS Users
        • Get an ACS User
        • Update an ACS User
        • Suspend an ACS User
        • Unsuspend an ACS User
        • Delete an ACS User
        • Add an ACS User to an Access Group
        • Remove an ACS User from an Access Group
      • Entrances
        • List Entrances
        • Get an Entrance
        • List Credentials with Access to an Entrance
      • Access Groups
        • List Access Groups
        • Get an Access Group
        • Add an ACS User to an Access Group
        • Remove an ACS User from an Access Group
        • List ACS Users in an Access Group
      • Credentials
        • Create a Credential for an ACS User
        • Assign a Credential to an ACS User
        • List Credentials
        • Get a Credential
        • Update a Credential
        • Unassign a Credential from an ACS User
        • Delete a Credential
        • List Accessible Entrances
      • Encoders
        • Encode a Credential
        • Get an Encoder
        • List Encoders
        • Scan a Credential
        • Encoder Simulations
          • Simulate that the Next Credential Encoding Will Fail
          • Simulate that the Next Credential Encoding Will Succeed
          • Simulate that the Next Credential Scan Will Fail
          • Simulate that the Next Credential Scan Will Succeed
    • Noise Sensors
      • Noise Thresholds
        • Create Noise Thresholds
        • List Noise Thresholds
        • Update Noise Threshold
        • Delete Noise Threshold
    • Phones
      • Get a Phone
      • List Phones
      • Deactivate a Phone
      • Phone Simulations
        • Create a Sandbox Phone
    • Thermostats
      • List Thermostats
      • Set to Heat Mode
      • Set to Cool Mode
      • Set to Heat-Cool (Auto) Mode
      • Set to Off Mode
      • Set the HVAC Mode
      • Set Fan Mode
      • Activate a Climate Preset
      • Create a Climate Preset
      • Update a Climate Preset
      • Delete a Climate Preset
      • Set a Fallback Climate Preset
      • Set a Temperature Threshold
      • Thermostat Schedules
        • Get a Thermostat Schedule
        • List Thermostat Schedules
        • Create a Thermostat Schedule
        • Update a Thermostat Schedule
        • Delete a Thermostat Schedule
      • Thermostat Simulations
        • Temperature Reached
        • HVAC Mode Adjusted
    • User Identities
      • Create a User Identity
      • List User Identities
      • Get a User Identity
      • Update a User Identity
      • Add an ACS User to a User Identity
      • List ACS Users Associated with a User Identity
      • List ACS Systems Associated with a User Identity
      • Remove an ACS User from a User Identity
      • Grant a User Identity Access to a Device
      • List Accessible Devices for a User Identity
      • Revoke Access to a Device from a User Identity
      • Delete a User Identity
      • Enrollment Automations
        • Launch an Enrollment Automation
        • List Enrollment Automations
        • Get an Enrollment Automation
        • Delete an Enrollment Automation
    • Action Attempts
      • Get Action Attempt
    • Events
      • List Events
      • Get an Event
  • 🛠️Developer Tools
    • Webhooks
    • Seam CLI
    • Sandbox Devices and Systems
      • Sandbox 2N Intercoms
      • Sandbox 4SUITES Locks
      • Sandbox Akiles Locks
      • Sandbox ASSA ABLOY Credential Services
      • Sandbox ASSA ABLOY Visionline Access Control System
      • Sandbox August Locks
      • Sandbox Avigilon Alta Access System
      • Sandbox Brivo Access
      • Sandbox ControlByWeb Relays
      • Sandbox Doorking Callboxes
      • Sandbox dormakaba Oracode Locks
      • Sandbox ecobee Thermostats
      • Sandbox Genie Garage Openers
      • Sandbox Google Nest Thermostats
      • Sandbox Honeywell Resideo Thermostats
      • Sandbox igloohome Locks
      • Sandbox Kwikset Locks
      • Sandbox Latch Access Control System
      • Sandbox Linear Callboxes
      • Sandbox Lockly Locks
      • Sandbox Minut Sensors
      • Sandbox NoiseAware Sensors
      • Sandbox Nuki Locks
      • Sandbox PTI Storlogix Cloud
      • Sandbox Salto KS Access Control System
      • Sandbox Salto Locks
      • Sandbox Salto Space Access System
      • Sandbox Schlage Encode Locks
      • Sandbox Seam Bridge
      • Sandbox SmartThings Hub
      • Sandbox Tedee Locks
      • Sandbox TTLock Locks
      • Sandbox Wyze Locks
      • Sandbox Yale Locks
    • Rate Limits and Guardrails
    • Mobile SDKs
      • Android SDK
      • iOS SDK
  • 🎛️Device and System Integration Guides
    • Overview
    • 2N Intercom Systems
      • Get started with 2N Intercoms
    • 33 Lock Devices
      • Get started with 33 Lock devices
    • 4SUITES Locks
      • Get started with 4SUITES locks
    • Akiles Locks
      • Get started with Akiles locks
    • ASSA ABLOY Credential Services
    • ASSA ABLOY Visionline Access Control System
      • Visionline ACS Setup Instructions
        • Developing and Launching Your Visionline Plastic Card Encoding App
          • Developing Your Visionline Plastic Card Encoding App Using a Real Visionline Server
            • Step 1: Install Your Visionline Application
            • Step 2: Unblock Required Ports
            • Step 3: Configure a Visionline User Account
            • Step 4: Install a Visionline Card Encoder
            • Step 5: Set up Door Locks
            • Step 6: Program Door Locks
            • Step 7: Create a Production Workspace
            • Step 8: Connect Your Visionline Development Account to Seam
            • Next Steps
          • Developing Your Visionline Plastic Card Encoding App Using a Sandbox Workspace
            • Step 1: Create a Sandbox Workspace
            • Step 2: Connect the Virtual Visionline ACS to Seam
            • Next Steps
          • Launching Your Visionline Plastic Card Encoding App to a Live Site
            • Step 1: Confirm That Your Visionline Site Meets the Requirements
            • Step 2: Configure a Visionline User Account
            • Step 3: Purchase and Import the Callback Option from ASSA ABLOY
            • Step 4: Create a Production Workspace
            • Step 5: Connect Your Visionline Production Account to Seam
        • Developing and Launching Your Visionline Mobile Key App
          • Developing Your Visionline Mobile Key App
            • Step 1: Complete the ASSA ABLOY Mobile Development Course
            • Step 2: Install Your Visionline Application
            • Step 3: Unblock Required Ports
            • Step 4: Configure a Visionline User Account
            • Step 5: Set up Your Credential Services Account in Visionline
            • Step 6: Configure the Mobile Access UUID in Visionline
            • Step 7: Set up Door Locks with BLE Profiles
            • Step 8: Program Door Locks
            • Step 9: Create a Production Workspace
            • Step 10: Connect Your Visionline Development Account to Seam
            • Next Steps
          • Launching Your Visionline Mobile Key App
            • Step 1: Obtain ASSA ABLOY Certification for Your Mobile Key App
            • Step 2: Confirm That Your Visionline Site Meets the Requirements
            • Step 3: Confirm BLE Module on All Locks
            • Step 4: Set up Door Locks with BLE Profiles
            • Step 5: Program Door Locks
            • Step 6: Configure a Visionline User Account
            • Step 7: Purchase and Import the Callback and Mobile Service Options from ASSA ABLOY
            • Step 8: Create a Production Workspace
            • Step 9: Connect Your Visionline Production Account to Seam
      • Configuring Visionline Mobile Credentials
        • Issuing Various Types of Guest Mobile Credentials
        • Issuing Various Types of Guest Joiner Mobile Credentials
        • Retrieving Guest and Common Entrances
        • Checking if a User Identity Has a Phone That Is Set up for a Credential Manager
        • Updating Guest Mobile Credentials
        • Revoking Mobile Credentials
      • Mobile Credential-Related Properties
      • Common Use Cases
      • Special Requirements for Android Mobile Access SDK Development
      • Special Requirements for iOS Mobile Access SDK Development
      • Creating Visionline Card-based Credentials
    • August Locks
      • Get started with August locks
    • Avigilon Alta Access System
    • Brivo Access
    • Get started with ControlByWeb Devices
    • dormakaba Oracode Locks
      • Get started with dormakaba Oracode Locks
      • Creating dormakaba Oracode Offline Access Codes
    • ecobee Thermostats
      • Get Started with ecobee Thermostats
    • Google Nest Thermostats
      • Get Started with Nest Thermostats
      • Obtain Google Nest Device Access and Commercial Development
    • Honeywell Resideo Thermostats
      • Get Started with Honeywell Resideo Thermostats
    • igloohome Locks
      • Get started with igloohome Locks
      • Creating igloohome Offline Access Codes
    • Kwikset Locks
      • Get started with Kwikset Wi-Fi Locks
    • Latch Access Control System
      • Latch ACS Setup Instructions
      • Programming Code-Based Latch Credentials
      • Programming Latch ACS Mobile Credentials
    • Lockly Locks
      • Creating Lockly Offline Access Codes
    • Minut Sensors
      • Get started with Minut Sensors
    • NoiseAware Sensors
      • Get started with NoiseAware Sensors
    • Nuki Locks
      • Get Started with Nuki Locks
    • PTI Storlogix Cloud
    • Salto KS Access Control System
      • Salto KS Setup Instructions
      • Programming Salto KS PIN Code Credentials
      • Programming Salto KS Mobile Credentials
      • Special Requirements for Android Mobile Access SDK Development
    • Salto KS Locks
      • Get started with Salto KS Locks
    • Salto ProAccess Space Access System
      • Salto Space Setup Instructions
      • Programming Salto Space Card-based Credentials
      • Programming Salto Space Mobile Credentials
    • Schlage Locks
      • Schlage Locks Setup Instructions
      • Get started with Schlage Locks
    • SmartThings Hubs + Smart Locks
      • Get started with SmartThings Hubs + Smart Locks
    • Tedee Locks
      • Get Started with Tedee Locks
    • TTLock Locks
      • Get started with TTLock Locks
    • Wyze Locks
      • Get started with Wyze Locks
    • Yale Locks
      • Get started with Yale Locks
    • Get started with Smart Locks
  • Device Manufacturer Guidance
    • Creating a Seam-Compatible Intercom API
      • Creating OAuth Endpoints
      • Creating Intercom CRUD Endpoints
      • Creating Access Code CRUD Endpoints
      • Creating the Health Endpoint
    • Creating a Seam-Compatible Door Locks API
      • Creating OAuth Endpoints
      • Creating Door Lock CRUD Endpoints
      • Creating Access Code CRUD Endpoints
      • Creating the Health Endpoint
Powered by GitBook
On this page
  • What is a User Identity?
  • User Identities Can Be Connected to Users in Multiple Access Control Systems
  • Create a User Identity and Associate it with an ACS User
  • 1. Create a User Identity
  • 2. Assign an ACS User to the User Identity
  • Removing a User Identity

Was this helpful?

Edit on GitHub
  1. Capability Guides
  2. 📱Mobile Access

Managing Mobile App User Accounts with User Identities

Learn how to use Seam user identities to manage mobile app user accounts.

PreviousPrepare your WorkspaceNextManaging Phones for a User Identity

Last updated 3 months ago

Was this helpful?

LogoLogo

Get Started

  • Sign Up
  • Supported Devices

News

  • Changelog
  • Blog

Company

  • About
  • Privacy Notice

© Seam Labs, Inc. All rights reserved.

What is a User Identity?

Seam user identities are a feature for tracking and managing user accounts in your application. This feature assigns unique identifiers to each of your users, enabling you to issue and manage their and access permissions. Each user identity is mapped to a user account in your app.

User Identities Can Be Connected to Users in Multiple Access Control Systems


Create a User Identity and Associate it with an ACS User

1. Create a User Identity

To create a user identity, you can specify any of the following characteristics:

  • Unique user identity key (user_identity_key)

  • Unique email address (email_address)

  • Unique phone number (phone_number)

  • Full name (full_name)

Note that if you specify one or more of the user_identity_key, email_address, or phone_number, each of these values must be unique within your workspace.

Command:

seam.user_identities.create(
  user_identity_key = "jean_doe",
  email_address = "jean@example.com",
  phone_number = "+15555550110",
  full_name = "Jean Doe"
)

Output:

UserIdentity(
  user_identity_id='22222222-2222-2222-2222-222222222222',
  user_identity_key='jean_doe',
  email_address='jean@example.com',
  phone_number='+15555550110',
  display_name='Jean Doe',
  full_name='Jean Doe',
  ...
)

Request:

curl -X 'POST' \
  'https://connect.getseam.com/user_identities/create' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer ${SEAM_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
  "user_identity_key": "jean_doe",
  "email_address": "jean@example.com",
  "phone_number": "+15555550110",
  "full_name": "Jean Doe"
}'

Response:

{
  "user_identity": {
    "user_identity_id": "22222222-2222-2222-2222-222222222222",
    "user_identity_key": "jean_doe",
    "email_address": "jean@example.com",
    "phone_number": "+15555550110",
    "display_name": "Jean Doe",
    "full_name": "Jean Doe",
    ...
  },
  "ok": true
}

Command:

await seam.userIdentities.create({
  user_identity_key: "jean_doe",
  email_address: "jean@example.com",
  phone_number: "+15555550110",
  full_name: "Jean Doe",
});

Output:

{
  "user_identity_id": "22222222-2222-2222-2222-222222222222",
  "user_identity_key": "jean_doe",
  "email_address": "jean@example.com",
  "phone_number": "+15555550110",
  "display_name": "Jean Doe",
  "full_name": "Jean Doe",
  ...
}

Command:

seam.user_identities.create(
  user_identity_key: "jean_doe",
  email_address: "jean@example.com",
  phone_number: "+15555550110",
  full_name: "Jean Doe",
)

Output:

<Seam::Resources::UserIdentity:0x005f0
  user_identity_id="22222222-2222-2222-2222-222222222222"
  user_identity_key="jean_doe"
  email_address="jean@example.com"
  phone_number="+15555550110"
  display_name="Jean Doe"
  full_name="Jean Doe"
  ...
>

Command:

$seam->user_identities->create(
  user_identity_key: "jean_doe",
  email_address: "jean@example.com",
  phone_number: "+15555550110",
  full_name: "Jean Doe"
);

Output:

{
  "user_identity_id": "22222222-2222-2222-2222-222222222222",
  "user_identity_key": "jean_doe",
  "email_address": "jean@example.com",
  "phone_number": "+15555550110",
  "display_name": "Jean Doe",
  "full_name": "Jean Doe",
  ...
}

Command:

Coming soon!

Output:

Coming soon!

Command:

Coming soon!

Output:

Coming soon!

Command:

userIdentity, uErr := client.UserIdentities.Create(context.Background(), &api.UserIdentitiesCreateRequest{
  UserIdentityKey: api.String("jean_doe"),
  EmailAddress: api.String("jean@example.com"),
  PhoneNumber: api.String("+15555550110"),
  FullName: api.String("Jean Doe"),
})

if uErr != nil {
    return uErr
}

fmt.Println(userIdentity)
return nil

Output:

{
  "user_identity_id": "22222222-2222-2222-2222-222222222222",
  "user_identity_key": "jean_doe",
  "email_address": "jean@example.com",
  "phone_number": "+15555550110",
  "display_name": "Jean Doe",
  "full_name": "Jean Doe",
  ...
}

2. Assign an ACS User to the User Identity

To link an ACS user with a user identity, provide the ID of the user identity and the ID of the ACS user.

Command:

user_identity = seam.user_identities.get(
  email_address = "jean@example.com"
)

acs_user = seam.acs.users.get(
  email_address = "jean@example.com"
)

seam.user_identities.add_acs_user(
  user_identity_id = user_identity.user_identity_id,
  acs_user_id = acs_user.acs_user_id
)

Output:

None

Request:

# Use GET or POST.
curl -X 'GET' \
  'https://connect.getseam.com/user_identities/get' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer ${SEAM_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d "{
  \"email_address\": \"jane@example.com\"
}")

# Use GET or POST.
curl -X 'GET' \
  'https://connect.getseam.com/acs/users/get' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer ${SEAM_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d "{
  \"email_address\": \"jane@example.com\"
}")


curl -X 'POST' \
  'https://connect.getseam.com/user_identities/add_acs_user' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${API_KEY}' \
  -H 'Content-Type: application/json' \
  -d "{
  \"user_identity_id\": \"$(jq -r '.user_identity.user_identity_id' <<< ${user_identity})\",
  \"acs_user_id\": \"$(jq -r '.acs_user.acs_user_id' <<< ${acs_user})\",
}"

Response:

{
  "ok": true
}

Command:

const userIdentity = await seam.userIdentities.get({
  email_address: "jean@example.com",
});

const acsUser = await seam.acs.users.get({
  email_address: "jean@example.com",
});

await seam.userIdentities.addAcsUser({
  user_identity_id: userIdentity.user_identity_id,
  acs_user_id: acsUser.acs_user_id,
});

Output:

// void

Command:

user_identity = seam.user_identities.get(
  email_address: "jane@example.com"
)

acs_user = seam.acs.users.get(
  email_address: "jane@example.com"
)

seam.user_identities.add_acs_user(
  user_identity_id: user_identity.user_identity_id,
  acs_user_id: acs_user.acs_user_id,
)

Output:

nil

Command:

$user_identity = $seam->user_identities->get(
  email_address: "jean@example.com",
);

$acs_user = $seam->acs->users->get(
  email_address: "jean@example.com",
);

$seam->user_identities->add_acs_user(
    user_identity_id: $user_identity->user_identity_id,
    acs_user_id: $acs_user->acs_user_id
);

Output:

null

Command:

Coming soon!

Output:

Coming soon!

Command:

Coming soon!

Output:

Coming soon!

Command:

userIdentity, uErr := client.UserIdentities.Get(context.Background(), &api.UserIdentitiesGetRequest{
  EmailAddress: api.String("jean@example.com"),
})

if uErr != nil {
    return uErr
}

acsUser, uErr := client.Acs.Users.Get(context.Background(), &acs.UsersGetRequest{
  EmailAddress: api.String("jean@example.com"),
})

if uErr != nil {
    return uErr
}

_, uErr := client.UserIdentities.AddAcsUser(context.Background(), &useridentities.UserIdentitiesAddAcsUserRequest{
    UserIdentityId: acs_user.UserIdentityId,
    AcsUserId: acs_user.AcsUserId,
})

if uErr != nil {
    return uErr
}

return nil

Output:

nil

Removing a User Identity

To delete a user identity, you must first delete any ACS credentials, ACS users, and enrollment automations associated with the user identity. You must also deactivate any associated phones. Then, delete the user identity.

Command:

import asyncio

user_identity_id = "22222222-2222-2222-2222-222222222222"

async def delete_user_identity(user_identity_id):
  # Step 1: List and delete all client sessions 
  # associated with the user identity.
  
  # List the client sessions.
  client_sessions = await seam.client_sessions.list(
    user_identity_id = user_identity_id
  )

  # Delete the client sessions.
  for session in client_sessions:
    await seam.client_sessions.delete(
      session_id=session['client_session_id']
    )

  # Step 2: List and delete all ACS users and credentials 
  # associated with the user identity.
  
  # List the ACS users.
  acs_users = await seam.acs.users.list(
    user_identity_id=user_identity_id
  )

  for acs_user in acs_users:
    # List the credentials for each ACS user.
    credentials = await seam.acs.credentials.list(
      acs_user_id=acs_user['acs_user_id']
    )

    # Delete the credentials.
    for credential in credentials:
      await seam.acs.credentials.delete(
        acs_credential_id=credential['acs_credential_id']
      )
    
      await asyncio.gather(*[
        wait_for_acs_credential_deleted(credential)
        for credential in credentials
      ])
    
    # Delete the ACS users.
    await seam.acs.users.delete(
      acs_user_id=acs_user['acs_user_id']
    )

    await asyncio.gather(*[
      wait_for_acs_user_deleted(acs_user) for acs_user in acs_users
    ])

  # Step 3: List and delete all enrollment automations 
  # associated with the user identity.
  
  # List the enrollment automations.
  enrollment_automations = await seam.user_identities.enrollment_automations.list(
      user_identity_id=user_identity_id
  )

  # Delete the enrollment automations.
  for automation in enrollment_automations:
    await seam.user_identities.enrollment_automations.delete(
      enrollment_automation_id=automation['enrollment_automation_id']
    )

  await asyncio.gather(*[
    wait_for_enrollment_automation_deleted(automation)
    for automation in enrollment_automations
  ])

  # Step 4: List and deactivate all phones 
  # associated with the user identity.
  
  # List the phones.
  phones = await seam.phones.list(
    owner_user_identity_id=user_identity_id
  )

  # Deactivate the phones.
  for phone in phones:
    await seam.phones.deactivate(
      device_id=phone['device_id']
    )

  await asyncio.gather(*[
    wait_for_phone_deactivated(phone) for phone in phones
  ])

  # Step 5: Delete the user identity.
  await seam.user_identities.delete(
    user_identity_id=user_identity_id
  )

# Helper functions for waiting on deletion events
async def wait_for_event(event_type, event_filter):
  while True:
    events = await seam.events.list(event_type=event_type)
    if any(event_filter(event) for event in events):
      break

async def wait_for_acs_user_deleted(acs_user):
  await wait_for_event(
    'acs_user.deleted',
    lambda event: 'acs_user_id' in event and
                  event.acs_user_id == acs_user.acs_user_id
  )

async def wait_for_enrollment_automation_deleted(enrollment_automation):
  await wait_for_event(
    'enrollment_automation.deleted',
    lambda event: 'enrollment_automation_id' in event and
                  event.enrollment_automation_id == enrollment_automation.enrollment_automation_id
  )

async def wait_for_acs_credential_deleted(acs_credential):
  await wait_for_event(
    'acs_credential.deleted',
    lambda event: 'acs_credential_id' in event and
                  event.acs_credential_id == acs_credential.acs_credential_id
  )

async def wait_for_phone_deactivated(phone):
  await wait_for_event(
    'phone.deactivated',
    lambda event: 'device_id' in event and
                  event.device_id == phone.device_id
  )

await delete_user_identity(user_identity_id)

Output:

None

Command:

const userIdentityId = "22222222-2222-2222-2222-222222222222";

// Step 1: List and delete all client sessions 
// associated with the user identity.

// List the client sessions.
const clientSessions = await seam.clientSessions.list({
  user_identity_id: userIdentityId,
});

// Delete each returned client session.
for (const clientSession of clientSessions) {
  await seam.clientSessions.delete({
    client_session_id: clientSession.client_session_id,
  });
}

// Step 2: List and delete all ACS users and credentials 
// associated with the user identity.

// List the ACS users.
const acsUsers = await seam.acs.users.list({
  user_identity_id: userIdentityId,
});

for (const acsUser of acsUsers) {
  // For each returned ACS user, list the associated credentials.
  const credentials = await seam.acs.credentials.list({
    acs_user_id: acsUser.acs_user_id,
  });
  
  // Delete each returned credential.
  for (const credential of credentials) {
    await seam.acs.credentials.delete({
      acs_credential_id: credential.acs_credential_id,
    });
  
    // Wait until each credential has been deleted.
    // You can watch for acs_credential.deleted events.
  
  }
    
  // Delete each ACS user returned previously.
  await seam.acs.users.delete({
    acs_user_id: acsUser.acs_user_id,
  });

  // Wait until each ACS user has been deleted.
  // You can watch for acs_user.deleted events.
  
}

// Step 3: List and delete all enrollment automations 
// associated with the user identity.

// List the enrollment automations.
const enrollmentAutomations = await seam.userIdentities.enrollmentAutomations.list({
  user_identity_id: userIdentityId,
});

// Delete each returned enrollment automation.
for (const enrollmentAutomation of enrollmentAutomations) {
  await seam.userIdentities.enrollmentAutomations.delete({
    enrollment_automation_id: enrollmentAutomation.enrollment_automation_id,
  });

  // Wait until each enrollment automation has been deleted.
  // You can watch for enrollment_automation.deleted events.

}

// Step 4: List and deactivate all phones 
// associated with the user identity.

// List the phones.
const phones = await seam.phones.list({
  owner_user_identity_id: userIdentityId,
});

// Deactivate each returned phone.
for (const phone of phones) {
  await seam.phones.deactivate({
    device_id: phone.device_id,
  });

  // Wait until each phone has been deactivated.
  // You can watch for phone.deactivated events.

}

// Step 5: Delete the user identity.
await seam.userIdentities.delete({
  user_identity_id: userIdentityId,
});

Output:

// void

Command:

user_identity_id = "22222222-2222-2222-2222-222222222222"

# Step 1: List and delete all client sessions 
# associated with the user identity.

# List the client sessions.
client_sessions = seam.client_sessions.list(
  user_identity_id: user_identity_id
)

# Delete each returned client session.
client_sessions.each do |client_session|
  seam.client_sessions.delete(
    client_session_id: client_session.client_session_id
  )
end

# Step 2: List and delete all ACS users and credentials 
# associated with the user identity.

# List the ACS users.
acs_users = seam.acs.users.list(
  user_identity_id: user_identity_id
)

acs_users.each do |acs_user|
  # For each returned ACS user, list the associated credentials.
  credentials = seam.acs.credentials.list(
    acs_user_id: acs_user.acs_user_id
  )
  
  # Delete each returned credential.
  credentials.each do |credential|
    seam.acs.credentials.delete(
      acs_credential_id: credential.acs_credential_id
    )
  
    # Wait until each credential has been deleted.
    # You can watch for acs_credential.deleted events.
  
  end
    
  # Delete each ACS user returned previously.
  seam.acs.users.delete(
      acs_user_id: acs_user.acs_user_id
  )

  # Wait until each ACS user has been deleted.
  # You can watch for acs_user.deleted events.
  
end

# Step 3: List and delete all enrollment automations 
# associated with the user identity.

# List the enrollment automations.
enrollment_automations = seam.user_identities.enrollment_autoations.list(
  user_identity_id: user_identity_id
)

# Delete each returned enrollment automation.
enrollment_automations.each do |enrollment_automation|
  seam.user_identities.enrollment_automations.delete(
    enrollment_automation_id: enrollment_automation.enrollment_automation_id
  )

  # Wait until each enrollment automation has been deleted.
  # You can watch for enrollment_automation.deleted events.

end

# Step 4: List and deactivate all phones 
# associated with the user identity.

# List the phones.
phones = seam.phones.list(
  owner_user_identity_id: user_identity_id
)

# Deactivate each returned phone.
phones.each do |phone|
  seam.phones.deactivate(
    device_id: phone.device_id
  )

  # Wait until each phone has been deactivated.
  # You can watch for phone.deactivated events.

end

# Step 5: Delete the user identity.
seam.user_identities.delete(
  user_identity_id: user_identity_id
)

Output:

nil

Command:

$user_identity_id = "22222222-2222-2222-2222-222222222222";

// Step 1: List and delete all client sessions 
// associated with the user identity.

// List the client sessions.
$client_sessions = $seam->client_sessions->list(
  user_identity_id: $user_identity_id
);

// Delete each returned client session.
foreach ($client_sessions as $client_session) {
  $seam->client_sessions->delete(
      client_session_id: $client_session->client_session_id
  );
}

// Step 2: List and delete all ACS users and credentials 
// associated with the user identity.

// List the ACS users.
$acs_users = $seam->acs->users->list(
  user_identity_id: $user_identity_id
);

foreach ($acs_users as $acs_user) {
  // For each returned ACS user, list the associated credentials.
  $credentials = $seam->acs->credentials->list(
    acs_user_id: $acs_user->acs_user_id
  );
  
  // Delete each returned credential.
  foreach ($credentials as $credential) {
    $seam->acs->credentials->delete(
      acs_credential_id: $credential->acs_credential_id
    );
  
    // Wait until each credential has been deleted.
    // You can watch for acs_credential.deleted events.
  
  }
    
  // Delete each ACS user returned previously.
  $seam->acs->users->delete(
      acs_user_id: $acs_user->acs_user_id
  );

  // Wait until each ACS user has been deleted.
  // You can watch for acs_user.deleted events.
  
}

// Step 3: List and delete all enrollment automations 
// associated with the user identity.

// List the enrollment automations.
$enrollment_automations = $seam->user_identities->enrollment_automations->list(
  user_identity_id: $user_identity_id
);

// Delete each returned enrollment automation.
foreach ($enrollment_automations as $enrollment_automation) {
  $seam->user_identities->enrollment_automations->delete(
    enrollment_automation_id: $enrollment_automation->enrollment_automation_id
  );

  // Wait until each enrollment automation has been deleted.
  // You can watch for enrollment_automation.deleted events.

}

// Step 4: List and deactivate all phones 
// associated with the user identity.

// List the phones.
$phones = $seam->phones->list(
  owner_user_identity_id: $user_identity_id
);

// Deactivate each returned phone.
foreach ($phones as $phone) {
  $seam->phones->deactivate(
    device_id: $phone->device_id
  );

  // Wait until each phone has been deactivated.
  // You can watch for phone.deactivated events.

}

// Step 5: Delete the user identity.
$seam->user_identities->delete(
  user_identity_id: $user_identity_id
);

Output:

null

Command:

Coming soon!

Output:

Coming soon!

Command:

Coming soon!

Output:

Coming soon!

Command:

userIdentityID := "22222222-2222-2222-2222-222222222222"

// Step 1: List and delete all client sessions 
// associated with the user identity.

// List the client sessions.
clientSessions, uErr := seam.ClientSessions.List(
  context.Background(),
  userIdentityID
)
if uErr != nil {
  return uErr
}

// Delete each returned client session.
for _, clientSession := range clientSessions {
  uErr := seam.ClientSessions.Delete(
    context.Background(),
    clientSession.ClientSessionID
  )
  if uErr != nil {
    return uErr
  }
}

// Step 2: List and delete all ACS users and credentials 
// associated with the user identity.

// List the ACS users.
acsUsers, uErr := seam.ACS.Users.List(
  context.Background(),
  userIdentityID
)
if uErr != nil {
  return uErr
}

for _, acsUser := range acsUsers {
  // For each returned ACS user, list the associated credentials.
  credentials, uErr := seam.ACS.Credentials.List(
    context.Background(),
    acsUser.ACSUserID
  )
  if uErr != nil {
    return uErr
  }
  
  // Delete each returned credential.
  for _, credential := range credentials {
    uErr := seam.ACS.Credentials.Delete(
      context.Background(),
      credential.ACSCredentialID
    )
    if uErr != nil {
      return uErr
    }

    // Wait until each credential has been deleted.
    // You can watch for acs_credential.deleted events.
  }
    
  // Delete each ACS user returned previously.
  uErr = seam.ACS.Users.Delete(
    context.Background(),
    acsUser.ACSUserID
  )
  if uErr != nil {
    return uErr
  }

  // Wait until each ACS user has been deleted.
  // You can watch for acs_user.deleted events.
}

// Step 3: List and delete all enrollment automations 
// associated with the user identity.

// List the enrollment automations.
enrollmentAutomations, uErr := seam.UserIdentities.EnrollmentAutomations.List(
  context.Background(),
  userIdentityID
)
if uErr != nil {
  return uErr
}

// Delete each returned enrollment automation.
for _, enrollmentAutomation := range enrollmentAutomations {
  uErr := seam.UserIdentities.EnrollmentAutomations.Delete(
    context.Background(),
    enrollmentAutomation.EnrollmentAutomationID
  )
  if uErr != nil {
    return uErr
  }

  // Wait until each enrollment automation has been deleted.
  // You can watch for enrollment_automation.deleted events.
}

// Step 4: List and deactivate all phones 
// associated with the user identity.

// List the phones.
phones, uErr := seam.Phones.List(
  context.Background(),
  userIdentityID
)
if uErr != nil {
  return uErr
}

// Deactivate each returned phone.
for _, phone := range phones {
  uErr := seam.Phones.Deactivate(
    context.Background(),
    phone.DeviceID
  )
  if uErr != nil {
    return uErr
  }

  // Wait until each phone has been deactivated.
  // You can watch for phone.deactivated events.
}

// Step 5: Delete the user identity.
uErr = seam.UserIdentities.Delete(
  context.Background(),
  userIdentityID
)
if uErr != nil {
  return uErr
}

return nil

Output:

nil

User identities can be linked to one in each access control system. Any mobile credentials issued to these ACS users are consolidated under the user identity. Consequently, a user's mobile app account has access to these credentials through the user identity.

ACS user
mobile credentials
Each user identity is mapped to a user account in your app.
A user identity can be connected to an ACS user in each ACS.