# list()

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

`api.agents.list({ limit }) → Promise<Session[]>`

The account's agent sessions, newest first. Enough to build a conversation list without opening any of them.

Status: GET /api/ai/agents/sessions · free · 30 by default

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `limit` | integer | 30 | How many to return. |

```javascript
const sessions = await api.agents.list({ limit: 50 });

for (const session of sessions) {
  console.log(session.title);
}
```

## What a session carries here {#what}

The identifier, the title taken from its first message, the model, when it was last active, and its usage. Enough for a sidebar; the conversation itself comes from [get()](/sdk/ref/agents/get) and `getHistory()`.

## Only agents with memory are in it {#only-sessions}

> **A run without memory: true leaves nothing behind**
>
> It is not recorded, so it cannot be listed, reopened or recalled. That is the normal shape for a one-off task — and the reason an account can look empty after a lot of work.

## A conversation list {#pattern}

```javascript
const sessions = await api.agents.list();

// Open the most recent one
const [latest] = sessions;
const agent = api.agents.get(latest.id, { machine: pc });
const messages = await agent.getHistory();
```

## Removing one {#removing}

`agent.destroy()` on a reopened session removes the account's copy, the device journal and its checkpoints. A refusal from the account is raised rather than swallowed, so a session that still exists is never reported as gone.

- [getHistory()](/sdk/ref/local-agent/get-history): Reading one back.
- [destroy()](/sdk/ref/local-agent/destroy): Removing one.
- [api.agents](/sdk/ref/agents): Creating, reopening and listing.

```python
sessions = api.agents.list(limit=50)

for session in sessions:
    print(session.get("title"))
```

```python
sessions = api.agents.list()

# Open the most recent one
latest = sessions[0]
agent = api.agents.get(latest["id"], machine=pc)
messages = agent.get_history()
```
