# list()

Canonical URL: https://developers.iagenify.com/sdk/ref/storage/list/
Language: en

`api.storage.list() → Promise<ConnectedStorage[]>`

Every active storage on the account, newest first — each one ready to use, not just described.

Status: GET /api/storage · free · real objects

Unlike most listings, these are not plain records: each one is a [ConnectedStorage](/sdk/ref/connected-storage) you can call `run()` on straight away.

```javascript
const all = await api.storage.list();

for (const s of all) {
  console.log(`${s.label} · ${s.type}${s.service ? ` (${s.service})` : ""}${s.isDefault ? " · default" : ""}`);
}

// And use one immediately
const base = all.find((s) => s.service === "nosql");
await base.run({ action: "collections" });
```

## What comes back {#shape}

Active storages only — one you removed is not in the list. Newest first, and no limit: an account has a handful of these, not thousands.

## Finding the one you mean {#finding}

```javascript
const all = await api.storage.list();

const byLabel = all.find((s) => s.label === "Archive");
const computers = all.filter((s) => s.type === "filesystem");
const phones = all.filter((s) => s.type === "phone");
const ours = all.filter((s) => s.provider === "iagenify");
const fallback = all.find((s) => s.isDefault);
```

> **Resolve by label once, then keep the id**
>
> Labels are not unique and the account holder can rename one. Looking a storage up by name on every run is a dependency on a display name.

## Several computers is normal {#machines}

Each machine the SDK runs on becomes its own storage. A deployment that loses its session cache on every restart registers a new one each time — so a pile of near-identical computers in this list is a signal worth reading.

```javascript
const machines = (await api.storage.list()).filter((s) => s.type === "filesystem");

if (machines.length > expected) {
  for (const m of machines) console.log(m.label, m.hostname, m.createdAt);
  // Near-identical entries usually mean the session cache is not persisting.
}
```

## Who holds the default {#default}

Exactly one carries `isDefault`. After removing the one that held it, this list is how you see which storage took it over.

- [remove()](/sdk/ref/storage/remove): Disconnecting one, and who inherits the default.
- [ConnectedStorage](/sdk/ref/connected-storage): What each item in this list can do.

```python
storages = api.storage.list()

for s in storages:
    service = f" ({s.service})" if s.service else ""
    print(f"{s.label} · {s.type}{service}{' · default' if s.is_default else ''}")

# And use one immediately
base = next(s for s in storages if s.service == "nosql")
base.run(action="collections")
```

```python
storages = api.storage.list()

by_label = next((s for s in storages if s.label == "Archive"), None)
computers = [s for s in storages if s.type == "filesystem"]
phones = [s for s in storages if s.type == "phone"]
ours = [s for s in storages if s.provider == "iagenify"]
fallback = next((s for s in storages if s.is_default), None)
```

```python
machines = [s for s in api.storage.list() if s.type == "filesystem"]

if len(machines) > expected:
    for m in machines:
        print(m.label, m.machine_id, m.created_at)
    # Near-identical entries usually mean the session cache is not persisting.
```
