> ## Documentation Index
> Fetch the complete documentation index at: https://seam-feat-mintlify-migration-iteration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieving Devices or Access Control Systems Connected Through a Connect Webview

> Learn how to retrieve the set of devices or ACS that your app user connected to Seam through a specific Connect Webview.

When your app user completes a [Connect Webview](./) authorization flow successfully, the resulting [`connected_account.connected` event](/api/events/object) includes a `connected_account_id`. Also, once the connection is successful, the [`connect_webview` object](/api/connect_webviews/object) includes the `connected_account_id`.

The first step in controlling connected devices or a connected ACS is to retrieve the newly-connected set of devices or ACS.

***

## Retrieve Connected Devices

Use this `connected_account_id` in a [List Devices](/api/devices/list) command to retrieve the devices that your user has just connected to Seam.

<Info>
  If you set `wait_for_device_creation` to `false` when [creating the Connect
  Webview](/core-concepts/connect-webviews/embedding-a-connect-webview-in-your-app#step-1-open-a-connect-webview), you should wait for the
  [`connected_account.completed_first_sync`
  event](/api/events/object) before retrieving the user's
  devices. This event indicates that Seam has finished the first sync of the
  connected account and the devices are now available.
</Info>

<Tabs>
  <Tab title="JavaScript">
    **Code:**

    ```javascript theme={null}
    // Retrieve all devices for the connected_account_id.
    const connectedDevices = await seam.devices.list({
      connected_account_id: "11111111-1111-1111-1111-222222222222"
    });
    ```

    **Output:**

    ```json theme={null}
    [
      {
        connected_account_id: '11111111-1111-1111-1111-222222222222',
        device_id: '11111111-1111-1111-1111-444444444444',
        display_name: 'Front Door Lock',
        is_managed: true,
        ...
      },
      ...
    ]
    ```
  </Tab>

  <Tab title="cURL">
    **Code:**

    ```bash theme={null}
    # Retrieve all devices for the connected_account_id.
    connected_devices=$(
      # Use GET or POST.
      curl -X 'GET' \
        'https://connect.getseam.com/devices/list' \
        -H 'accept: application/json' \
        -H "Authorization: Bearer ${SEAM_API_KEY}" \
        -H 'Content-Type: application/json' \
        -d '{
        "connected_account_id": "11111111-1111-1111-1111-222222222222"
      }')
    ```

    **Output:**

    ```json theme={null}
    {
      "devices": [
        {
          "connected_account_id": "11111111-1111-1111-1111-222222222222",
          "device_id": "11111111-1111-1111-1111-444444444444",
          "display_name": "Front Door Lock",
          "is_managed": true,
          ...
        },
        ...
      ],
      "ok": true
    }
    ```
  </Tab>

  <Tab title="Python">
    **Code:**

    ```python theme={null}
    # Retrieve all devices for the connected_account_id.
    connected_devices = seam.devices.list(
      connected_account_id="11111111-1111-1111-1111-222222222222"
    )
    ```

    **Output:**

    ```
    [
      Device(
        connected_account_id='11111111-1111-1111-1111-222222222222',
        device_id='11111111-1111-1111-1111-444444444444',
        display_name='Front Door Lock',
        is_managed=True,
        ...
      ),
      ...
    ]
    ```
  </Tab>

  <Tab title="Ruby">
    **Code:**

    ```ruby theme={null}
    # Retrieve all devices for the connected_account_id.
    connected_devices = seam.devices.list(
      connected_account_id: "11111111-1111-1111-1111-222222222222"
    )
    ```

    **Output:**

    ```json theme={null}
    [
      <
        Seam::Device:0x00438
          connected_account_id="11111111-1111-1111-1111-222222222222"
          device_id="11111111-1111-1111-1111-444444444444"
          display_name='Front Door Lock'
          is_managed=true
          ...
      >,
      ...
    ]
    ```
  </Tab>

  <Tab title="PHP">
    **Code:**

    ```php theme={null}
    // Retrieve all devices for the connected_account_id.
    $connected_devices = $seam->devices->list(
      connected_account_id: "11111111-1111-1111-1111-222222222222"
    );
    ```

    **Output:**

    ```json theme={null}
    [
      {
        "connected_account_id": "11111111-1111-1111-1111-222222222222",
        "device_id": "11111111-1111-1111-1111-444444444444",
        "display_name": "Front Door Lock",
        "is_managed": true,
        ...
      },
      ...
    ]
    ```
  </Tab>

  <Tab title="C#">
    **Code:**

    ```csharp theme={null}
    // Retrieve all devices for the connectedAccountId.
    var connectedDevices = seam.Devices.List(
      connectedAccountId: "11111111-1111-1111-1111-222222222222"
    );
    ```

    **Output:**

    ```json theme={null}
    {
      "connected_account_id": "11111111-1111-1111-1111-222222222222",
      "device_id": "11111111-1111-1111-1111-444444444444",
      "display_name": "Front Door Lock",
      "is_managed": true,
      ...
    }
    ...
    ```
  </Tab>
</Tabs>

***

## Retrieve a Connected Access Control System

Use this `connected_account_id` in a [List ACS Systems](/api/acs/systems/list) command to retrieve the ACS that your user has just connected to Seam.

<Info>
  If you set `wait_for_device_creation` to `false` when [creating the Connect
  Webview](/core-concepts/connect-webviews/embedding-a-connect-webview-in-your-app#step-1-open-a-connect-webview), you should wait for the
  [`connected_account.completed_first_sync`
  event](/api/events/object) before retrieving the user's
  ACS. This event indicates that Seam has finished the first sync of the
  connected account and the `acs_system` is now available.
</Info>

<Tabs>
  <Tab title="JavaScript">
    **Code:**

    ```javascript theme={null}
    // Retrieve all acs_systems for the connected_account_id.
    const connectedAcsSystems = await seam.acs.systems.list({
      connected_account_id: "11111111-1111-1111-2222-111111111111"
    });
    ```

    **Output:**

    ```json theme={null}
    [
      {
        connected_account_ids: [
          '11111111-1111-1111-2222-111111111111'
        ],
        acs_system_id: '11111111-1111-1111-1111-111111111111',
        name: 'My ACS',
        ...
      },
      ...
    ]
    ```
  </Tab>

  <Tab title="cURL">
    **Code:**

    ```bash theme={null}
    # Retrieve all acs_systems for the connected_account_id.
    connected_acs_systems=$(
      # Use GET or POST.
      curl -X 'GET' \
        'https://connect.getseam.com/acs/systems/list' \
        -H 'accept: application/json' \
        -H "Authorization: Bearer ${SEAM_API_KEY}" \
        -H 'Content-Type: application/json' \
        -d '{
        "connected_account_id": "11111111-1111-1111-2222-111111111111"
      }')
    ```

    **Output:**

    ```json theme={null}
    {
      "acs_systems": [
        {
          "connected_account_ids": [
            "11111111-1111-1111-2222-111111111111"
          ],
          "acs_system_id": "11111111-1111-1111-1111-111111111111",
          "name": "My ACS",
          ...
        },
        ...
      ],
      "ok": true
    }
    ```
  </Tab>

  <Tab title="Python">
    **Code:**

    ```python theme={null}
    # Retrieve all acs_systems for the connected_account_id.
    connected_acs_systems = seam.acs.list(
      connected_account_id="11111111-1111-1111-2222-111111111111"
    )
    ```

    **Output:**

    ```
    [
      AcsSystem(
        connected_account_ids=[
          '11111111-1111-1111-2222-111111111111'
        ],
        acs_system_id='11111111-1111-1111-1111-111111111111',
        name='My ACS',
        ...
      ),
      ...
    ]
    ```
  </Tab>

  <Tab title="Ruby">
    **Code:**

    ```ruby theme={null}
    # Coming soon!
    ```

    **Output:**

    ```
    # Coming soon!
    ```
  </Tab>

  <Tab title="PHP">
    **Code:**

    ```php theme={null}
    // Retrieve all acs_systems for the connected_account_id.
    $connected_acs_systems = $seam->acs->systems->list(
      connected_account_id: "11111111-1111-1111-2222-111111111111"
    );
    ```

    **Output:**

    ```json theme={null}
    [
      {
        "connected_account_ids": [
          "11111111-1111-1111-2222-111111111111"
        ],
        "acs_system_id": "11111111-1111-1111-1111-111111111111",
        "name": "My ACS",
        ...
      },
      ...
    ]
    ```
  </Tab>

  <Tab title="C#">
    **Code:**

    ```csharp theme={null}
    // Retrieve all acs_systems for the connectedAccountId.
    var connectedAcsSystems = seam.Acs.Systems.List(
      connectedAccountId: "11111111-1111-1111-2222-111111111111"
    );
    ```

    **Output:**

    ```json theme={null}
    {
      "connected_account_ids": [
        "11111111-1111-1111-2222-111111111111"
      ],
      "acs_system_id": "11111111-1111-1111-1111-111111111111",
      "name": "My ACS",
      ...
    }
    ...
    ```
  </Tab>
</Tabs>
