> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Expire Memory

> Retire a memory without deleting it.

## Overview

Marks one memory `expired`. The memory keeps its content and remains recallable —
it is simply labelled as no longer current, and stamped with when it expired and
why. This is the reversible alternative to
[Delete Memory](/api-reference/data/delete-memory).

See the [Memory Lifecycle](/reference/memory-lifecycle) reference for the model.

## Authentication

API clients do not send an API key or `Authorization` header.

<ParamField header="X-Session-Token" type="string" required>
  Session token from [Activate Agent](/api-reference/sessions/activate-agent). Must match `agent_id`.
</ParamField>

## Path Parameters

<ParamField path="agent_id" type="string" required>
  The unique identifier of the agent.
</ParamField>

<ParamField path="memory_id" type="string" required>
  The ID of the memory to expire.
</ParamField>

## Body

<ParamField body="reason" type="string" default="manual">
  Why this memory expired, stamped as `expired_by`. Bounded to letters, digits,
  `.`, `_` and `-` so it stays a usable filter token. The body may be omitted
  entirely to accept the default.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
    "http://localhost:8000/api/v2/agents/my-agent/memories/b7c3cf31-e537-49f1-abc4-c50ac6adeac5/expire" \
    -H "X-Session-Token: your_session_token" \
    -H "Content-Type: application/json" \
    -d '{"reason": "superseded-by-rewrite"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "agent_id": "my-agent",
    "session_id": "sess_cf824a95d305",
    "memory_id": "b7c3cf31-e537-49f1-abc4-c50ac6adeac5",
    "status": "expired",
    "expired_at": "2026-08-18T19:56:29.873259+00:00",
    "expired_by": "superseded-by-rewrite"
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "detail": "Memory 'b7c3cf31-e537-49f1-abc4-c50ac6adeac5' was not found."
  }
  ```

  ```json 401 - Unauthorized (Missing Token) theme={null}
  {
    "detail": "Missing session token. Use X-Session-Token header."
  }
  ```
</ResponseExample>

## Notes

* Content, tags, confidence and timestamps are untouched — this is a metadata-only rewrite.
* `status`, `expired_at` and `expired_by` are always written together, so an expired memory always carries a *when* and a *why*.
* Editing an expired memory via [Edit Memory](/api-reference/data/edit-memory) preserves the stamp; only [Restore Memory](/api-reference/data/restore-memory) clears it.
* To retire memories in bulk by rule, use [Apply Expiry Policy](/api-reference/policy/apply-policy).

## Next Steps

* [Restore Memory](/api-reference/data/restore-memory) to reverse this
* [Recall](/api-reference/search/recall) with `status: "expired"` to list expired memories
