---
title: "Apply suggested edits: swap in the exact wording reviewers proposed, as text, and resolve them."
method: POST
path: "/sites/{idOrSlug}/feedback/apply"
tags: ["Feedback"]
---

# Apply suggested edits: swap in the exact wording reviewers proposed, as text, and resolve them.

`POST /sites/{idOrSlug}/feedback/apply`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/sites/{idOrSlug}/feedback/apply`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.stacktr.ee/oauth/authorize`, token URL `https://api.stacktr.ee/oauth/token`, scopes: `sites:write`, `sites:read`)

Owner only. Each suggested edit (a feedback item with suggested_text) is applied only inside the element it was left in, only when its words occur there exactly once, and escaped as plain text. The page keeps its URL and the content it had is kept as a version first (GET /sites/{idOrSlug}/versions), so the returned version id restores it. Suggestions that cannot be applied come back in not_applied with a reason, and the rest are applied anyway. Retrying the same ids changes nothing more: the first call resolved them. On a page with several files only suggestions on its main page (index.html) are applied.

## Request body

- object
  - `ids` string[], required: Feedback ids of the suggested edits to apply.
  - `note` string: What each reviewer sees next to their applied suggestion. Default "Applied as suggested."
  - `change_note` string: A sentence on what changed, for readers coming back to the page (the same field PUT takes).
  - `quiet` boolean: A correction readers should not be told about (the same field PUT takes).
  - `expected_updated_at` integer: Refuse with 409 content_changed if the page was updated after this.

## Response `200`

Applied what could be applied. Nothing is written when nothing applies.

- object
  - `ok` boolean
  - `id` string
  - `url` string
  - `applied` object[]
    - `id` string
    - `from` string
    - `to` string
    - `note` string
  - `not_applied` object[]
    - `id` string
    - `reason` 'not_found' | 'ambiguous' | 'crosses_formatting' | 'overlaps' | 'other_page' | 'already_resolved' | 'not_a_suggestion' | 'not_open'
    - `message` string
  - `version` string, nullable: The snapshot of the page before this change: POST /sites/{idOrSlug}/versions/{version}/restore undoes it.
  - `updated_at` integer, nullable
  - `open_left` integer
  - `next` string

## Other responses

- `400`: No ids, more than 50, or an end-to-end encrypted page.
- `401`: Not signed in.
- `404`: No page on this account matches.
- `409`: site_deleted, managed_portal, or content_changed (the page changed while the edits were applied, or after expected_updated_at). Nothing was changed.
- `422`: content_blocked: the page the edits would make fails the publish safety check.

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
