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

# List sessions

> List Sessions with cursor pagination.

`GET /api/v1/cloud/sessions`

Retrieves Sessions under the current account. Archived Sessions are excluded by default.

## Headers

| Header          | Required | Description         |
| --------------- | -------- | ------------------- |
| `Authorization` | Yes      | `Bearer $QODER_PAT` |

## Query parameters

| Parameter          | Type            | Required | Description                                                                                                                                                           |
| ------------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `limit`            | integer         | No       | Maximum number of records to return. Default 20, range 1-100. Values above 100 return `400 invalid_request_error`.                                                    |
| `page`             | string          | No       | Opaque cursor from a previous response's `next_page`                                                                                                                  |
| `order`            | string          | No       | Sort direction: `desc` (default) or `asc`                                                                                                                             |
| `include_archived` | boolean         | No       | Set to `true` to include archived Sessions                                                                                                                            |
| `statuses`         | string or array | No       | Filter by Session lifecycle status. Allowed values: `running`, `idle`, `rescheduling`, `terminated`. Archived Sessions are filtered separately via `include_archived` |
| `agent_id`         | string          | No       | Filter by Agent ID                                                                                                                                                    |
| `agent_version`    | integer         | No       | Filter by Agent version                                                                                                                                               |
| `deployment_id`    | string          | No       | Filter by Deployment ID                                                                                                                                               |
| `memory_store_id`  | string          | No       | Filter Sessions that have a Memory Store resource                                                                                                                     |
| `created_at[gt]`   | string          | No       | Return Sessions created after this RFC 3339 timestamp                                                                                                                 |
| `created_at[gte]`  | string          | No       | Return Sessions created at or after this RFC 3339 timestamp                                                                                                           |
| `created_at[lt]`   | string          | No       | Return Sessions created before this RFC 3339 timestamp                                                                                                                |
| `created_at[lte]`  | string          | No       | Return Sessions created at or before this RFC 3339 timestamp                                                                                                          |

## Example request

```bash theme={null}
curl -X GET "https://api.qoder.com/api/v1/cloud/sessions?limit=3&include_archived=true" \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
      "type": "session",
      "agent": {
        "id": "agent_019e390add9f7bac9b6cc806db46fcbd",
        "type": "agent",
        "version": 2,
        "name": "doc-verification-agent",
        "description": "",
        "model": {"id": "ultimate", "effective_context_window": 200000},
        "system": "You are an expert software engineer.",
        "tools": [{"enabled_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep"], "type": "agent_toolset_20260401"}],
        "skills": [],
        "mcp_servers": []
      },
      "environment_id": "env_019e2590d33f711fabf42f2857cecd8a",
      "title": "API-doc-verification-session",
      "status": "idle",
      "metadata": {},
      "resources": [],
      "vault_ids": [],
      "deployment_id": null,
      "outcome_evaluations": [],
      "stats": {"active_seconds": 0, "duration_seconds": 0},
      "environment_variables": {},
      "archived_at": null,
      "created_at": "2026-05-18T15:26:15.747298Z",
      "updated_at": "2026-05-18T15:26:15.747298Z"
    }
  ],
  "first_id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "has_more": false,
  "last_id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "next_page": null
}
```

## Response fields

| Field       | Type           | Description                                                                   |
| ----------- | -------------- | ----------------------------------------------------------------------------- |
| `data`      | array          | Array of [Session objects](/cloud-agents/api/sessions/schemas#session-object) |
| `has_more`  | boolean        | `true` when additional pages exist beyond the current result set              |
| `first_id`  | string         | ID of the first Session in the current page                                   |
| `last_id`   | string         | ID of the last Session in the current page                                    |
| `next_page` | string \| null | Opaque cursor for the next page, or `null` when there are no more results     |

## Errors

| HTTP | Type                    | Trigger                                |
| ---- | ----------------------- | -------------------------------------- |
| 400  | `invalid_request_error` | Invalid pagination or filter parameter |
| 401  | `authentication_error`  | PAT invalid or expired                 |

**HTTP 400 Bad Request**

```json theme={null}
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "invalid_request_error",
    "message": "Field 'limit' must be a positive integer."
  }
}
```

See [Errors](/cloud-agents/api/conventions/errors) for the full error envelope.

## Related

<CardGroup cols={2}>
  <Card title="Start a session" icon="play" href="/cloud-agents/sessions">
    Run an agent against an environment as a stateful conversation.
  </Card>
</CardGroup>
