---
title: "Deactivate Agent"
method: POST
path: "/api/v2/agents/{agent_id}/deactivate"
tags: ["Sessions & Agents"]
---

# Deactivate Agent

`POST /api/v2/agents/{agent_id}/deactivate`

## Request

- The document declares no server URL.
- Auth: none declared

Deactivate agent and end session

Terminates the current session and returns statistics.

## Path parameters

- `agent_id` string, required

## Headers

- `authorization` string, nullable
- `X-Api-Key` string, nullable

## Response `200`

Successful Response

- SessionSummary: Summary of ended session
  - `session_id` string, required
  - `agent_id` string, required
  - `started_at` string, date-time, required
  - `ended_at` string, date-time, required
  - `duration_hours` number, required
  - `memories_created` integer, required
  - `summary_memory_id` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-23** `570d93acaaab`: 2 warning
  - deleted the `cookie` request parameter `memanto_session_token`
  - deleted the `header` request parameter `x-session-token`
- **2026-07-14** `51ea5daee7e4`: 2 info
  - added the new optional `header` request parameter `X-Api-Key`
  - added the new optional `header` request parameter `authorization`
- **2026-07-09** `6c0f57766d0f`: 1 info
  - added the new optional `cookie` request parameter `memanto_session_token`
- **2026-06-23** `3f3d8570f1a6`: 3 warning
  - deleted the `cookie` request parameter `memanto_session_token`
  - deleted the `header` request parameter `X-Api-Key`
  - deleted the `header` request parameter `authorization`

[Operation history](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/changes/api/v2/agents/:agent_id/deactivate/post.md)

---

[API](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love.md) - [All operations](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/llms.txt) - [OpenAPI document](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/revisions/ef842776283e?raw)
