---
title: "Forget Bulk"
method: POST
path: "/api/v1/memory/forget-bulk"
tags: ["memory"]
---

# Forget Bulk

`POST /api/v1/memory/forget-bulk`

## 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/memory/forget-bulk`
- Auth: none declared

Delete every memory in one context that matches the filters (#1941).

Filters combine with AND: ``created_before`` (exclusive),
``created_after`` (inclusive), ``type``, ``tags`` (any of). At least one
filter or ``all: true`` is required. ``dry_run`` defaults to ``true`` and
returns ``matched``; with ``dry_run: false`` the matches are deleted the
way ``/forget`` deletes one memory (soft delete, search point and graph
edges removed) and ``deleted`` is returned. One request deletes at most
2,000 memories; ``remaining: true`` means more match — repeat the request
with ``cursor`` set to the returned ``next_cursor``.

Permissions are ``/forget``'s: write access to the context (uniform 404
otherwise), then the per-memory delete check — a memory the caller may
not delete is skipped and not counted. Allowed while the workspace is over
its Free capacity: deleting is how it gets back under the cap.

## Headers

- `authorization` string, nullable

## Request body

- ForgetBulkRequest: Request schema for ``POST /memory/forget-bulk`` (#1941). Deletes every live memory in ONE context matching ALL the given filters. At least one filter, or an explicit ``all: true``, is required so an empty body can never wipe a context. ``dry_run`` defaults to true: the caller sees the count before anything is deleted.
  - `context_id` string, uuid, required: The context to delete from
  - `created_before` string, date-time, nullable: Only memories created before this instant (exclusive)
  - `created_after` string, date-time, nullable: Only memories created at or after this instant (inclusive)
  - `type` string, nullable: Only memories of this type
  - `tags` string[], nullable: Only memories carrying ANY of these tags
  - `all` boolean: Match every memory in the context (no filter)
  - `dry_run` boolean: Count the matches without deleting
  - `cursor` string, nullable: Resume point: the previous response's next_cursor, so rows this caller may not delete are not rescanned. Ignored on a dry run.

## Response `200`

Successful Response

- ForgetBulkResponse: Response schema for ``POST /memory/forget-bulk`` (#1941). ``matched`` (the full count) on a dry run; ``deleted``, ``remaining`` and ``next_cursor`` otherwise — one request deletes at most 2,000 memories; ``remaining: true`` means matching memories are left: repeat the request with ``cursor: next_cursor``.
  - `status` string
  - `dry_run` boolean, required
  - `matched` integer, nullable
  - `deleted` integer, nullable
  - `remaining` boolean, nullable
  - `next_cursor` string, nullable

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