---
title: "Admin Force Erase User"
method: POST
path: "/api/v1/admin/users/{user_id}/erase"
tags: ["admin"]
---

# Admin Force Erase User

`POST /api/v1/admin/users/{user_id}/erase`

## 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/users/{user_id}/erase`
- Auth: none declared

Force-erase a user account (admin-only, GDPR Art.17 / APPI compliance).

Skips the 7-day cooling-off period: the deletion executes immediately.
Cross-store cleanup (Stripe + Qdrant + Postgres + Redis) is handled
by AccountErasureService following the same orchestration as the
self-service path.

Required body:
    reason_code: one of user_request_via_support / legal_order /
        inactivity_policy / abuse_violation / other
    reason_detail: free-form admin note (max 1000 chars)

Protections (mirrors SystemAdminService.can_delete_admin):
    - 403 if target is the initial admin
    - 403 if target is the last remaining admin
    - 403 if admin tries to erase their own account
    - 409 if an erasure request is already in flight for this user
    - 409 if the target owns a shared workspace and no alternate
      admin exists for auto-transfer

This endpoint replaces the older `DELETE /admin/users/{user_id}` for
new integrations. The old route is kept temporarily for backward
compatibility but does NOT clean Qdrant or all OAuth artifacts.

## Path parameters

- `user_id` string, required

## Request body

- AdminErasureRequestBody: Payload for POST /admin/users/{user_id}/erase. ``reason_detail`` is free-form admin notes bounded to 1000 chars at the service layer (matches the ``valid_erasure_*`` CHECK constraint in the migration).
  - `reason_code` 'user_request_via_support' | 'legal_order' | 'inactivity_policy' | 'abuse_violation' | 'other', required
  - `reason_detail` string, nullable

## Response `200`

Successful Response

- object

## 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/09f17f5ada29?raw)
