---
title: "Delete one memory, one slot, or a verified user partition"
method: POST
path: "/v1/forget"
tags: ["memory"]
---

# Delete one memory, one slot, or a verified user partition

`POST /v1/forget`

## Request

- Base URL: `https://api.contextdb.ai`
- URL: `https://api.contextdb.ai/v1/forget`
- Auth: HTTP bearer

Scope is derived from the project key plus the required `user_id`.
Choose exactly one mode: `memory_id`, `entity` + `attribute`, or
`erase_partition=true`. Whole-partition erasure also requires
`confirmation` equal to `user_id` and an `Idempotency-Key`.

## Headers

- `Idempotency-Key` string

## Request body

- ForgetRequest
  - `user_id` string, required: End-user memory partition key. Not an identity assertion.
  - `memory_id` string
  - `entity` string
  - `attribute` string
  - `erase_partition` boolean
  - `confirmation` string

## Response `200`

Erasure result

- ForgetResponse
  - `mode` 'memory' | 'slot' | 'partition', required
  - `deleted` integer, required
  - `verified` boolean, nullable, required: Non-null only for whole-partition erasure
  - `request_id` string, required
  - `memory_version` integer, required: Monotonic consistency version within one organization/project.
  - `primary_wal_lsn` string, nullable, required: Primary PostgreSQL WAL position observed after commit.

## Other responses

- `400`: Malformed request or failed validation
- `401`: Missing, malformed, unknown, or revoked API key
- `403`: Authenticated but not allowed (entitlement or billing state)
- `404`: Target not found in the caller's partition (or missing)
- `409`: The key was reused with a different request, an identical request is still running, or a previous process ended with an ambiguous outcome.
- `413`: Body or batch exceeds the configured cap
- `429`: The client IP/project exceeded its request rate, or the project's idempotency retention capacity is full until older keys expire.
- `503`: Memory or metadata store unreachable

---

[API](https://skmtc.dev/contextdb/apis/contextdb-cloud-data-plane-api.md) · [All operations](https://skmtc.dev/contextdb/apis/contextdb-cloud-data-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextdb/apis/contextdb-cloud-data-plane-api/revisions/9e441d2e21a7?raw)
