---
title: "Hygiene Compact Memory Endpoint"
method: POST
path: "/api/admin/users/{user_id}/hygiene-compact-memory"
tags: ["admin"]
---

# Hygiene Compact Memory Endpoint

`POST /api/admin/users/{user_id}/hygiene-compact-memory`

Re-audit a user's MEMORY.md against the Do-Not-Include list.

Runs the compaction LLM in hygiene-only mode: the model reads the
user's current MEMORY.md and removes every line that violates the
exclusion list (customer IDs, phone numbers, stale bug notes, etc.),
even if no new conversation triggered the compaction. This is the
"clean my memory now" operation that scrubs pre-existing violations
that were written before the compliance rule existed.

Unlike ``POST /admin/users/{user_id}/compact-now``, this endpoint
does not require untrimmed conversation messages and does not
advance the trim watermark. It only touches MEMORY.md.

Audit-logged via ``AdminAction.HYGIENE_COMPACT_MEMORY``.

## Path parameters

- `user_id` string, required

## Response `200`

Successful Response

- HygieneCompactMemoryResponse — Outcome of an admin-triggered hygiene-only memory re-audit. ``memory_updated`` indicates whether at least one exclusion-list violation was removed from MEMORY.md. ``memory_text`` carries the new full MEMORY.md content (empty string if nothing changed) so the admin can preview the diff without re-reading the user's memory file.
  - `memory_updated` boolean, required
  - `memory_text` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mozilla-ai/apis/clawbolt.md) · [All operations](https://skmtc.net/mozilla-ai/apis/clawbolt/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mozilla-ai/clawbolt/revisions/0e52fe5f8d33/schema)
