---
title: "Re-apply the AI's intended edit on top of the user's current version of one section."
method: POST
path: "/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit"
tags: ["v1", "sessions"]
---

# Re-apply the AI's intended edit on top of the user's current version of one section.

`POST /v1/sessions/{session_id}/chunks/{chunk_id}/re-edit`

## Request

- Base URL: `https://api.superdocs.app`
- URL: `https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit`
- Auth: HTTP bearer

Resolve a concurrent-edit conflict on ONE section. When a user edited a section while the AI
was also changing it, this re-applies the AI's intended change on top of the user's current text
(mode="redo"), or blends the user's and AI's versions into one (mode="merge"). Returns only the
rewritten section HTML. Performs one AI edit and counts as one billable operation.

## Path parameters

- `session_id` string, required
- `chunk_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- ReEditChunkRequest: Re-apply the AI's intended change on the user's current section HTML, OR (mode='merge') combine the user's version and the AI's version into one.
  - `user_current_html` string, required
  - `ai_original_old_html` string, nullable
  - `ai_proposed_new_html` string, nullable
  - `ai_explanation` string, nullable
  - `model_tier` string, nullable
  - `mode` string, nullable
  - `window_id` string, nullable

## Response `200`

Successful Response

- ReEditChunkResponse
  - `chunk_id` string, required
  - `new_html` string, nullable
  - `error` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/superdocs/apis/universal-document-ai-api.md) · [All operations](https://skmtc.dev/superdocs/apis/universal-document-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/superdocs/apis/universal-document-ai-api/revisions/37d03122940b?raw)
