---
title: "Recover Context"
method: POST
path: "/api/v1/admin/contexts/recover"
tags: ["admin"]
---

# Recover Context

`POST /api/v1/admin/contexts/recover`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/admin/contexts/recover`
- Auth: none declared

Recover a deleted context from surviving Qdrant data.

Issue #86: Admin endpoint to reconstruct context and memory records
from Qdrant point payloads when a context has been accidentally deleted.

#1798: deleting a context now removes its points, and the orphan sweep
removes points left by earlier deletions, so this finds nothing for a
context deleted on v0.88.0 or later. Its soft-deleted rows stay in
Postgres until the tombstone purge; ``POST /contexts/{context_id}/restore``
(#1804) brings it back from them.

Default is dry_run=True — shows what would be recovered without making changes.

## Request body

- ContextRecoveryRequest: Request to recover a deleted context from Qdrant data.
  - `context_id` string, required
  - `workspace_id` string, nullable
  - `context_name` string, nullable
  - `dry_run` boolean

## Response `200`

Successful Response

- ContextRecoveryResponse: Result of context recovery attempt.
  - `context_id` string, required
  - `workspace_id` string, required
  - `qdrant_points_found` integer, required
  - `memories_recovered` integer, required
  - `memories_already_existed` integer, required
  - `context_record_created` boolean, required
  - `search_config_restored` boolean, required
  - `dry_run` boolean, required
  - `errors` string[], required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/aa9df1a21db9?raw)
