---
title: "List agent sessions"
method: GET
path: "/agent/sessions"
tags: ["agent"]
---

# List agent sessions

`GET /agent/sessions`

Lists sessions for the current user. `listAgentSessions` uses `AgentSessionPaginationMode=cursor` or an `AgentSessionCursor` value to return cursor pages and `nextCursor`; cursor mode rejects `Page` because mixed cursor/page requests are ambiguous, while `PerPage` still controls page size. Without cursor mode it uses `Page` and `PerPage` offset pagination. `RemoteNode` selects the target node for either pagination mode. Malformed or invalid cursor values return 400.

## Query parameters

- `remoteNode` string
- `paginationMode` 'offset' | 'cursor'
- `cursor` string
- `page` integer
- `perPage` integer

## Response `200`

Paginated list of sessions

- ListAgentSessionsResponse — Paginated list of agent sessions
  - `sessions` AgentSessionWithState[], required
    - `sessionId` string, required
    - `working` boolean, required
    - `hasPendingPrompt` boolean — Whether the agent is waiting for user input
    - `model` string
    - `totalCost` number, double, required — Total accumulated cost in USD
    - `session` AgentSession, required — Agent chat session metadata
      - `id` string, required
      - `userId` string
      - `dagName` string
      - `title` string
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required
      - `parentSessionId` string
      - `delegateTask` string
  - `pagination` Pagination, required
    - `totalRecords` integer, required — total number of records
    - `currentPage` integer, required — current page number
    - `totalPages` integer, required — total number of pages
    - `nextPage` integer, required — next page number
    - `prevPage` integer, required — previous page number
  - `nextCursor` string — Opaque cursor for loading the next page of older sessions

## Other responses

- `401` — Not authenticated
- `default` — Unexpected error

## Changes

- **2026-05-24** (v1) `8a2d5d3e9608` — 2 warning
  - added the new `rate_limited` enum value to the `code` response property for the response status `401`
  - added the new `rate_limited` enum value to the `code` response property for the response status `default`
- **2026-05-08** (v1) `15dabdf71c21` — 3 info
  - added the new optional `query` request parameter `cursor`
  - added the new optional `query` request parameter `paginationMode`
  - added the optional property `nextCursor` to the response with the `200` status
- **2026-04-30** (v1) `50e1d517afc1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/dagucloud/apis/dagu/changes/agent/sessions/get.md)

---

[API](https://skmtc.dev/dagucloud/apis/dagu.md) · [All operations](https://skmtc.dev/dagucloud/apis/dagu/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dagucloud/dagu/revisions/8a2d5d3e9608/schema)
