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

> ## Agent Instructions
> Maximem Synap is a managed memory layer for AI agents: it ingests conversations and documents, extracts structured memory, and returns scoped context to the agent at retrieval time.
> The Python and JavaScript/TypeScript SDKs are the supported way to use Synap. Write integration code with SDK calls, not raw HTTP requests.
> Start with the Quickstart: https://docs.maximem.ai/getting-started/quickstart.md. Every SDK method is documented in the SDK reference: https://docs.maximem.ai/sdk-reference/overview.md.
> For requests about adding Vity memory to OpenClaw, Hermes, an MCP client, or a browser, start with the Vity Quickstart: https://docs.maximem.ai/vity/quickstart.md.

# data.restore

> Bring deleted memories back before their purge date.

```python Python theme={null}
# One or more memories you deleted (up to 200 ids)
result = await sdk.data.restore(["a1b2c3d4-e5f6-7890-abcd-ef0123456789"])

# Every memory one data.delete call hid
result = await sdk.data.restore(deletion_id=deleted.deletion_id)
```

```typescript TypeScript theme={null}
const result = await client.data.restore(['a1b2c3d4-e5f6-7890-abcd-ef0123456789']);

const all = await client.data.restore({ deletionId: deleted.deletion_id });
```

A deleted memory is hidden from every read at once and stays restorable until its purge date, the end of the instance's deletion period (0 to 30 days, 30 by default). That date is fixed when the memory is deleted, so changing the period later never shortens it. After it, the memory is purged for good and cannot be restored.

This covers memories removed by [`memories.delete`](https://docs.maximem.ai/sdk-reference/memories/delete), by [`data.delete`](https://docs.maximem.ai/sdk-reference/data/delete), and by [`memories.forget`](https://docs.maximem.ai/sdk-reference/memories/forget), including a forget approved in the dashboard. A document hidden by a `data.delete` call comes back with its memories when you restore that call's `deletion_id`. A permanent delete has no restore.

Restoring needs the same key permissions as deleting, and reaches only the memories of your key's instance.

### Parameters

**memory\_ids** `string[]`

Up to 200 memory ids. Send this or `deletion_id`, not both.

**deletion\_id** `string`

The `deletion_id` of a [`data.delete`](https://docs.maximem.ai/sdk-reference/data/delete) result: restores every memory that call hid. Conversations, their turns and summaries, the profile and source text that call removed do not come back.

### Returns

**restored\_ids** `string[]`

Live again; served by the next fetch.

**not\_restorable\_ids** `string[]`

Not found in this instance, not deleted, or past the purge date. This is a result, not an error.

**still\_missing\_in** `string[]`

A store that could not be brought back in line (for example `graph`). The memory is restored either way.

**documents\_restored** `integer`

Only when you restore by `deletion_id` and that delete also hid documents: how many documents came back, with the memories made from them (`document_memories_restored`). If a document could not be restored, `still_missing_in` names `documents`.

**fully\_restored** `boolean`

True when `still_missing_in` is empty.

### Raises

* `InvalidInputError`: neither or both of `memory_ids` and `deletion_id`, an empty list, more than 200 ids, or an empty id. Checked before any request is sent.
* `AuthenticationError`: the key is missing or invalid (401), or not allowed to delete (403).

### See also

* [data.delete](https://docs.maximem.ai/sdk-reference/data/delete.md)
* [memories.delete](https://docs.maximem.ai/sdk-reference/memories/delete.md)
* [Delete data by scope](https://docs.maximem.ai/guides/delete-data-by-scope.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.