> ## 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.

# Restore Memory

> Return an expired memory to the active state.

## Overview

Returns an `expired` memory to `active` and clears its expiry stamp entirely —
`expired_at` and `expired_by` are removed from the stored document, not left
behind.

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 restore.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
    "http://localhost:8000/api/v2/agents/my-agent/memories/b7c3cf31-e537-49f1-abc4-c50ac6adeac5/restore" \
    -H "X-Session-Token: your_session_token"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "agent_id": "my-agent",
    "session_id": "sess_cf824a95d305",
    "memory_id": "b7c3cf31-e537-49f1-abc4-c50ac6adeac5",
    "status": "active"
  }
  ```

  ```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

* Restoring a memory that is already `active` is harmless — it simply re-writes the record with no stamp.
* A memory removed by [Delete Memory](/api-reference/data/delete-memory) or [Purge Expired Memories](/api-reference/policy/purge-expired) **cannot** be restored.
* A later policy sweep can expire the memory again if it still matches a rule.

## Next Steps

* [Expire Memory](/api-reference/data/expire-memory)
* [Get Expiry Policy](/api-reference/policy/get-policy) to see what would re-expire it
