---
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
- `503` — Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header.

## Changes

- **2026-08-24** `9f1598713067` — 1 info
  - added the non-success response with the status `503`
- **2026-06-16** `52b41ab517b6` — 6 warning, 1 info
  - added the new `base64_instruction` enum value to the `injection/items/kind` response property for the response status `200`
  - added the new `instruction_override` enum value to the `injection/items/kind` response property for the response status `200`
  - added the new `prompt_template_injection` enum value to the `injection/items/kind` response property for the response status `200`
  - added the new `role_override` enum value to the `injection/items/kind` response property for the response status `200`
  - …3 more
- **2026-06-08** `741d58b9ef89` — 1 breaking, 6 info
  - removed the required property `unscopedContent` from the response with the `200` status
  - removed the `base64_instruction` enum value from the `injection/items/kind` response property for the response status `200`
  - removed the `instruction_override` enum value from the `injection/items/kind` response property for the response status `200`
  - removed the `prompt_template_injection` enum value from the `injection/items/kind` response property for the response status `200`
  - …3 more

[Change history](https://skmtc.dev/surrealdb/apis/spectron/changes/api/v1/:context_id/fsck/post.md)

---

[API](https://skmtc.dev/surrealdb/apis/spectron.md) · [All operations](https://skmtc.dev/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/surrealdb/spectron/revisions/9f1598713067/schema)
