Skip to main content
A session groups messages, runs, and memory for one continuous interaction with an agent — one session per end user, chat thread, or integration conversation.

List Sessions

GET /api/v1/managed-agents/agents/{agentId}/sessions
limit
number
default:"25"
1–100
offset
number
default:"0"
sessions
Session[]
total
number
Total session count, for pagination

Create Session

POST /api/v1/managed-agents/agents/{agentId}/sessions
metadata
object
Arbitrary custom metadata to attach to the session.
end_user_id
string
Identifier for the end user this session belongs to, if applicable.
curl -X POST https://suite.sundaypyjamas.com/api/v1/managed-agents/agents/3fae1c2e-.../sessions \
  -H "Authorization: Bearer spj_ai_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "end_user_id": "user_123" }'
{
  "session": {
    "id": "sess_44bc...",
    "mount": null,
    "created_at": "2026-07-08T10:00:00Z"
  }
}
Session creation is rate-limited per workspace. A 429 is returned if you exceed the limit — see Rate Limits.

Get Session

GET /api/v1/managed-agents/sessions/{sessionId}
{
  "session": {
    "id": "sess_44bc...",
    "title": "Q2 report review",
    "mount": null,
    "app_id": "3fae1c2e-...",
    "last_message_at": "2026-07-08T10:12:00Z",
    "created_at": "2026-07-08T10:00:00Z"
  }
}

Delete Session

DELETE /api/v1/managed-agents/sessions/{sessionId}
{ "deleted": true }