curl -X POST "http://localhost:8000/api/v2/agents/my-agent/deactivate"
{
"session_id": "9f733fdb-ebf2-494e-8eb6-fb3320d6020d",
"agent_id": "my-agent",
"started_at": "2026-05-09T02:40:00.313078Z",
"ended_at": "2026-05-09T03:15:00.000000Z",
"duration_hours": 0.58,
"memories_created": 3,
"summary_memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
{
"detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
}
{
"detail": {
"error": "SessionNotFound",
"message": "Session for agent 'my-agent' not found",
"details": {}
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "..."
}
}
}
Session Management
Deactivate Agent
End the active session for an agent and return a summary.
POST
/
api
/
v2
/
agents
/
{agent_id}
/
deactivate
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/deactivate"
{
"session_id": "9f733fdb-ebf2-494e-8eb6-fb3320d6020d",
"agent_id": "my-agent",
"started_at": "2026-05-09T02:40:00.313078Z",
"ended_at": "2026-05-09T03:15:00.000000Z",
"duration_hours": 0.58,
"memories_created": 3,
"summary_memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
{
"detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
}
{
"detail": {
"error": "SessionNotFound",
"message": "Session for agent 'my-agent' not found",
"details": {}
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "..."
}
}
}
Overview
Terminates the current session for the specified agent and returns a summary including the start/end time, total duration, and number of memories stored during the session. It also clears thememanto_session_token cookie.
No session token is needed: the management check below is enough, so a client that lost its token can still end the session.
Authentication
Bearer <key> — required unless the request originates from a loopback client. See Management Endpoint Authentication.Path Parameters
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/deactivate"
{
"session_id": "9f733fdb-ebf2-494e-8eb6-fb3320d6020d",
"agent_id": "my-agent",
"started_at": "2026-05-09T02:40:00.313078Z",
"ended_at": "2026-05-09T03:15:00.000000Z",
"duration_hours": 0.58,
"memories_created": 3,
"summary_memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
{
"detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
}
{
"detail": {
"error": "SessionNotFound",
"message": "Session for agent 'my-agent' not found",
"details": {}
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "..."
}
}
}
Next Steps
- Activate Agent to start a new session
- List Agents to view updated session counters