Skip to main content

Sessions API

Retrieve active conversation sessions from the OpenClaw gateway. These are agent conversation sessions, not wallet payment sessions.

List sessions

GET /api/sessions
Requires session authentication. Returns up to 50 conversation sessions from the gateway.
New instances are provisioned with per-sender session scope, meaning each sender gets an isolated conversation. Sessions reset daily at 4:00 AM server time and are pruned after 30 days (with a maximum of 500 entries per sender). You can change these defaults using the config API.

Response

{
  "sessions": [
    {
      "key": "main",
      "agentId": "agent_abc123",
      "status": "active",
      "messageCount": 24,
      "lastActivity": "2026-03-30T01:15:00Z",
      "createdAt": "2026-03-29T10:00:00Z",
      "model": "openrouter/xiaomi/mimo-v2-pro"
    }
  ],
  "total": 1,
  "source": "gateway"
}

Session object

FieldTypeDescription
keystringSession key identifier (for example, main, telegram-123, discord-456)
agentIdstring | nullID of the agent handling this session
statusstringSession status. Defaults to active.
messageCountnumberNumber of messages (turns) in this session
lastActivitystring | nullISO 8601 timestamp of the most recent activity
createdAtstring | nullISO 8601 timestamp when the session was created
modelstring | nullAI model used for this session

Response fields

FieldTypeDescription
sessionsarrayList of session objects
totalnumberTotal number of sessions returned
sourcestringData source — gateway on success, gateway-error when the gateway is unreachable

Gateway errors

When the gateway is unreachable, the endpoint returns HTTP 200 with an empty session list and the error detail:
{
  "sessions": [],
  "error": "Gateway unreachable",
  "source": "gateway-error"
}

Errors

CodeDescription
401Unauthorized — no valid session

Example

curl -X GET https://agentbot.raveculture.xyz/api/sessions \
  -H "Cookie: next-auth.session-token=YOUR_SESSION"