---
title: "Apply a section-scoped Markdown patch under conservation checks."
method: POST
path: "/api/safepatch"
---

# Apply a section-scoped Markdown patch under conservation checks.

`POST /api/safepatch`

## Request

- Base URL: `https://whetstone.cyberelf.link`
- URL: `https://whetstone.cyberelf.link/api/safepatch`
- Auth: none declared

## Request body

- object: Apply deterministic, section-scoped Markdown replacements under conservation checks.
  - `document` string, required: Complete Markdown document to patch.
  - `operations` object[], required
    - `allow_token_changes` string[]: Protected literal tokens that this operation may intentionally change.
    - `find` string, required
    - `replace` string, required
    - `target_heading` string, required: Markdown heading text without the leading # characters.
  - `reason` string

## Response `200`

Deterministic receipt with item-level decision path and SHA-256 hashes.

## Other responses

- `400`: Input error (a hint points at /api/examples).
- `429`: Rate limited.

---

[API](https://skmtc.dev/cyberelf/apis/whetstone-tools.md) · [All operations](https://skmtc.dev/cyberelf/apis/whetstone-tools/llms.txt) · [OpenAPI document](https://skmtc.dev/cyberelf/apis/whetstone-tools/revisions/4c656180ee4d?raw)
