---
title: "POST /api/v1/{context_id}/fsck"
method: POST
path: "/api/v1/{context_id}/fsck"
---

# POST /api/v1/{context_id}/fsck

`POST /api/v1/{context_id}/fsck`

Memory hygiene sweep (duplicates / contradictions / injection / unscoped content)

## Path parameters

- `context_id` string, required

## Request body

- FsckRequestJson
  - `check` string, nullable
  - `duplicateThreshold` number, float, nullable
  - `maxResults` integer, nullable

## Response `200`

- FsckReportJson
  - `contradictions` ContradictionFindingJson[], required
    - `entity` string, required
    - `key` string, required
    - `values` string[], required
  - `duplicates` DuplicateFindingJson[], required
    - `entityA` string, required
    - `entityB` string, required
    - `similarity` number, float, required
  - `injection` InjectionFindingJson[], required
    - `kind` 'instruction_override' | 'role_override' | 'tool_override' | 'system_prompt_leak' | 'prompt_template_injection' | 'base64_instruction', required — The detector taxonomy — the closed set of injection-pattern categories the scanner can emit. Serialises to `snake_case` wire strings (`instruction_override`, `system_prompt_leak`, …) on the `/fsck` response and in the persisted `uncertainty.source.kinds` audit payload, consistent with the rest of the API's enums. Because the pattern table is keyed by this enum (not `&'static str`), adding a detector without a matching variant is a compile error.
    - `rowId` string, required
    - `snippet` string, required
  - `total` integer, required
  - `unscopedContent` UnscopedContentFindingJson[], required
    - `count` integer, required
    - `sampleIds` string[], required
    - `table` string, required

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `422` — Invalid context id

---

[API](https://skmtc.net/surrealdb/apis/spectron.md) · [All operations](https://skmtc.net/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/surrealdb/spectron/versions/52b41ab517b6/schema)
