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

# Managing Phones for a User Identity

> Learn how to manage the phones associated with a user identity.

An app user may have several phones. When they sign into their account on your mobile application, it is important that additional phones also provide access. Seam facilitates this access by registering each phone within the [user identity](/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) and synchronizing [mobile credentials](/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system) across these phones. Further, Seam provides a feature to deactivate a phone if an app user loses it.

***

## App User New Phone Process

When an app user signs in to a new phone, Seam can automatically set up the new phone, generate matching credentials, and issue these credentials. To facilitate this capability, you must [issue a multi-phone sync credential](/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system) when creating a mobile credential.

<img src="https://mintcdn.com/seam/H96jOW_ZJ5A7VZhZ/images/image-(2)-(1).png?fit=max&auto=format&n=H96jOW_ZJ5A7VZhZ&q=85&s=d2dddd7e6108ddd029b6a640e408f5cd" alt="When a user sign in to a new phone, Seam also issues matching credentials to the new phone." width="2430" height="1280" data-path="images/image-(2)-(1).png" />

***

## App User Lost Phone Process

If an app user loses their phone or wants to deactivate it, you can deactivate the phone. Seam then automatically invalidates the stored credentials on their deactivated phone.

<img src="https://mintcdn.com/seam/H96jOW_ZJ5A7VZhZ/images/image-(3)-(1).png?fit=max&auto=format&n=H96jOW_ZJ5A7VZhZ&q=85&s=d228919740229fbebe9b69c5c11cf75b" alt="When a phone is revoked, Seam revokes all the credentials issued to this phone." width="2430" height="1274" data-path="images/image-(3)-(1).png" />

To [deactivate](/api/phones/deactivate) a phone, provide the ID of the phone. When a phone is deactivated, Seam also revokes all the credentials issued to the deactivated phone. Seam also removes the associated ACS credentials from the ACS.

**Command:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.phones.deactivate({
    device_id: lostPhoneId,
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/phones/deactivate' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
    \"device_id\": \"${lost_phone_id}\"
  }"
  ```

  ```python Python theme={null}
  seam.phones.deactivate(
    device_id = lost_phone_id
  )
  ```

  ```ruby Ruby theme={null}
  seam.phones.deactivate(
    device_id: lost_phone_id
  )
  ```

  ```php PHP theme={null}
  $seam->phones->deactivate(
    device_id: $lost_phone_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}
  null
  ```

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

***

## Retrieving Phones for a User Identity

To retrieve the list of phones that the mobile app user has used to sign in to their account, use the [List Phones](/api/phones/list) endpoint and include the ID of the user identity.

**Command:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.phones.list({
    owner_user_identity_id: user_identity.id,
  })
  ```

  ```bash cURL theme={null}
  # Use GET or POST.
  curl -X 'GET' \
    'https://connect.getseam.com/phones/list' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
    \"owner_user_identity_id\": \"${user_identity_id}\"
  }"
  ```

  ```python Python theme={null}
  seam.phones.list(
    owner_user_identity_id = user_identity.id
  )
  ```

  ```ruby Ruby theme={null}
  seam.phones.list(
    owner_user_identity_id: user_identity.id,
  )
  ```

  ```php PHP theme={null}
  $seam->phones->list(
    owner_user_identity_id: $user_identity->id
  );
  ```

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

**Output:**

<CodeGroup>
  ```json JavaScript theme={null}
  [
    {
      "device_id": "22222222-2222-2222-2222-444444444444",
      "device_type": "android_phone",
      "created_at": "2025-01-01T10:40:00+00:00",
      ...
    },
    {
      "device_id": "22222222-2222-2222-2222-555555555555",
      "device_type": "ios_phone",
      "created_at": "2025-01-02T10:40:00+00:00",
      ...
    },
    ...
  ]
  ```

  ```json cURL theme={null}
  {
    "phones": [
      {
        "device_id": "22222222-2222-2222-2222-444444444444",
        "device_type": "android_phone",
        "created_at": "2025-01-01T10:40:00+00:00",
        ...
      },
      {
        "device_id": "22222222-2222-2222-2222-555555555555",
        "device_type": "ios_phone",
        "created_at": "2025-01-02T10:40:00+00:00",
        ...
      },
      ...
    ],
    "ok": true
  }
  ```

  ```json Python theme={null}
  [
    Phone(
      device_id='22222222-2222-2222-2222-444444444444',
      device_type='android_phone',
      created_at='2025-01-01T10:40:00+00:00',
      ...
    )
    Phone(
      device_id='22222222-2222-2222-2222-555555555555',
      device_type='ios_phone',
      created_at='2025-01-02T10:40:00+00:00',
      ...
    )
    ...
  ]
  ```

  ```json Ruby theme={null}
  [
    <Seam::Resources::Phone:0x005f0
      device_id="22222222-2222-2222-2222-444444444444"
      device_type="android_phone"
      created_at="2025-01-01T10:40:00+00:00"
      ...
    >,
    <Seam::Resources::Phone:0x005f0
      device_id="22222222-2222-2222-2222-555555555555"
      device_type="ios_phone"
      created_at="2025-01-02T10:40:00+00:00"
      ...
    >,
    ...
  ]
  ```

  ```json PHP theme={null}
  [
    {
      "device_id": "22222222-2222-2222-2222-444444444444",
      "device_type": "android_phone",
      "created_at": "2025-01-01T10:40:00+00:00",
      ...
    },
    {
      "device_id": "22222222-2222-2222-2222-555555555555",
      "device_type": "ios_phone",
      "created_at": "2025-01-02T10:40:00+00:00",
      ...
    },
    ...
  ]
  ```

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

***

## Retrieving a Phone by ID

To retrieve a phone by its ID, use the [Get Phone](/api/phones/get) endpoint and include the `device_id` of the phone.

**Command:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.phones.list({
    owner_user_identity_id: user_identity.id,
  })
  ```

  ```bash cURL theme={null}
  # Use GET or POST.
  curl -X 'GET' \
    'https://connect.getseam.com/phones/get' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
    "device_id": "22222222-2222-2222-2222-444444444444"
  }'
  ```

  ```python Python theme={null}
  seam.phones.get(
    device_id = "22222222-2222-2222-2222-444444444444"
  )
  ```

  ```ruby Ruby theme={null}
  seam.phones.list(
    owner_user_identity_id: user_identity.id,
  )
  ```

  ```php PHP theme={null}
  $seam->phones->list(
    owner_user_identity_id: $user_identity->id
  );
  ```

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

**Output:**

<CodeGroup>
  ```json JavaScript theme={null}
  [
    {
      "device_id": "22222222-2222-2222-2222-444444444444",
      "device_type": "android_phone",
      "created_at": "2025-01-01T10:40:00+00:00",
      ...
    },
    {
      "device_id": "22222222-2222-2222-2222-555555555555",
      "device_type": "ios_phone",
      "created_at": "2025-01-02T10:40:00+00:00",
      ...
    },
    ...
  ]
  ```

  ```json cURL theme={null}
  {
    "phone": {
      "device_id": "22222222-2222-2222-2222-444444444444",
      "device_type": "android_phone",
      "created_at": "2025-01-01T10:40:00+00:00",
      ...
    },
    "ok": true
  }
  ```

  ```json Python theme={null}
  Phone(
    device_id='22222222-2222-2222-2222-444444444444',
    device_type='android_phone',
    created_at='2025-01-01T10:40:00+00:00',
    ...
  )
  ```

  ```json Ruby theme={null}
  [
    <Seam::Resources::Phone:0x005f0
      device_id="22222222-2222-2222-2222-444444444444"
      device_type="android_phone"
      created_at="2025-01-01T10:40:00+00:00"
      ...
    >,
    <Seam::Resources::Phone:0x005f0
      device_id="22222222-2222-2222-2222-555555555555"
      device_type="ios_phone"
      created_at="2025-01-02T10:40:00+00:00"
      ...
    >,
    ...
  ]
  ```

  ```json PHP theme={null}
  [
    {
      "device_id": "22222222-2222-2222-2222-444444444444",
      "device_type": "android_phone",
      "created_at": "2025-01-01T10:40:00+00:00",
      ...
    },
    {
      "device_id": "22222222-2222-2222-2222-555555555555",
      "device_type": "ios_phone",
      "created_at": "2025-01-02T10:40:00+00:00",
      ...
    },
    ...
  ]
  ```

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