Skip to main content

List durable turns

GET 

/session/turns

Lists the session's stored turns, newest first. A turn is one run of the agent in response to a message, from the moment Peen accepts it until it completes, fails, is cancelled or is interrupted. Each turn names the context and prompt snapshots it ran with, which you can read from GET /session/context-snapshots/{contextHash} and GET /session/prompt-snapshots/{promptHash}.

  • Ordering: by startedAt descending, then id descending.
  • Paging: limit (1 to 200, default 50) and offset (default 0). hasMore is true when at least one more turn exists after this page.
  • Errors: 400 VALIDATION_FAILED for a limit or offset outside the allowed values. 404 SESSION_NOT_FOUND when no session has the X-Session-ID ID.

Request​

Responses​

One page of the session's turns, newest first.

Response Headers
    X-Session-ID

    The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.

    X-Request-ID

    The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.