> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List sessions

> List Agent Vault sessions with the Python SDK.

`client.agent_vault.sessions.list()` lists the [sessions](https://infisical.com/docs/documentation/platform/agent-vault/sessions) in an Agent Vault project. Admins can list every session, and members only their own.

## Parameters

**project\_id** `str` *required*

The ID of the [Agent Vault project](https://infisical.com/docs/documentation/platform/agent-vault/projects.md#find-the-project-id) to list sessions from.

**scope** `Union[AgentVaultSessionScope, str]`

Whose sessions to list, either `AgentVaultSessionScope.MINE` (`"mine"`) for your own sessions or `AgentVaultSessionScope.ALL` (`"all"`) for every session if you're an admin (defaults to `AgentVaultSessionScope.MINE`).

**statuses** `List[Union[AgentVaultSessionStatus, str]]`

The statuses to include, from `AgentVaultSessionStatus.ACTIVE` (`"active"`), `AgentVaultSessionStatus.REVOKED` (`"revoked"`), and `AgentVaultSessionStatus.EXPIRED` (`"expired"`) (defaults to all three).

**search** `str`

Text to find in each session's [label](https://infisical.com/docs/documentation/platform/agent-vault/sessions#label-a-session-and-add-metadata), owner name, owner email, access bundle name, or the name or email of the user that the session was [created on behalf of](https://infisical.com/docs/documentation/platform/agent-vault/sessions-on-behalf-of-users.md).

**metadata** `Dict[str, str]`

Only sessions whose [metadata](https://infisical.com/docs/documentation/platform/agent-vault/sessions#label-a-session-and-add-metadata) has every one of these keys with exactly these values (up to 20).

**limit** `int`

The maximum number of sessions to return, from 1 to 100 (defaults to `20`).

**offset** `int`

The number of sessions to skip (defaults to `0`).

## Returns

**response** `ListAgentVaultSessionsResponse`

The sessions in `sessions`, and the total number of matching sessions in `totalCount`.

```python Basic theme={"dark"}
response = client.agent_vault.sessions.list(project_id="<project-id>")
```

```python With filters theme={"dark"}
from infisical_sdk import AgentVaultSessionScope, AgentVaultSessionStatus

response = client.agent_vault.sessions.list(
    project_id="<project-id>",
    scope=AgentVaultSessionScope.MINE,
    statuses=[AgentVaultSessionStatus.ACTIVE],
    search="nightly deploy",
    metadata={"runId": "8812"},
    limit=20,
    offset=0,
)
```

```json Response theme={"dark"}
{
  "sessions": [
    {
      "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "label": "nightly deploy",
      "actor": {
        "type": "machineIdentity",
        "id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
        "name": "deploy-bot"
      },
      "onBehalfOf": null,
      "status": "active",
      "expiresAt": "2026-12-02T13:00:00.000Z",
      "revokedAt": null,
      "createdAt": "2026-12-02T12:00:00.000Z",
      "accessBundle": {
        "id": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
        "name": "release"
      },
      "services": [],
      "metadata": { "runId": "8812" }
    }
  ],
  "totalCount": 1
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.