v1
Re-apply the AI's intended edit on top of the user's current version of one section.
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.
POST
/
v1
/
sessions
/
{session_id}
/
chunks
/
{chunk_id}
/
re-edit
Re-apply the AI's intended edit on top of the user's current version of one section.
curl --request POST \
--url https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_current_html": "<string>",
"ai_original_old_html": "<string>",
"ai_proposed_new_html": "<string>",
"ai_explanation": "<string>",
"model_tier": "<string>",
"mode": "redo"
}
'import requests
url = "https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit"
payload = {
"user_current_html": "<string>",
"ai_original_old_html": "<string>",
"ai_proposed_new_html": "<string>",
"ai_explanation": "<string>",
"model_tier": "<string>",
"mode": "redo"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_current_html: '<string>',
ai_original_old_html: '<string>',
ai_proposed_new_html: '<string>',
ai_explanation: '<string>',
model_tier: '<string>',
mode: 'redo'
})
};
fetch('https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_current_html' => '<string>',
'ai_original_old_html' => '<string>',
'ai_proposed_new_html' => '<string>',
'ai_explanation' => '<string>',
'model_tier' => '<string>',
'mode' => 'redo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit"
payload := strings.NewReader("{\n \"user_current_html\": \"<string>\",\n \"ai_original_old_html\": \"<string>\",\n \"ai_proposed_new_html\": \"<string>\",\n \"ai_explanation\": \"<string>\",\n \"model_tier\": \"<string>\",\n \"mode\": \"redo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_current_html\": \"<string>\",\n \"ai_original_old_html\": \"<string>\",\n \"ai_proposed_new_html\": \"<string>\",\n \"ai_explanation\": \"<string>\",\n \"model_tier\": \"<string>\",\n \"mode\": \"redo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_current_html\": \"<string>\",\n \"ai_original_old_html\": \"<string>\",\n \"ai_proposed_new_html\": \"<string>\",\n \"ai_explanation\": \"<string>\",\n \"model_tier\": \"<string>\",\n \"mode\": \"redo\"\n}"
response = http.request(request)
puts response.read_body{
"chunk_id": "<string>",
"new_html": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
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.
⌘I
Re-apply the AI's intended edit on top of the user's current version of one section.
curl --request POST \
--url https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_current_html": "<string>",
"ai_original_old_html": "<string>",
"ai_proposed_new_html": "<string>",
"ai_explanation": "<string>",
"model_tier": "<string>",
"mode": "redo"
}
'import requests
url = "https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit"
payload = {
"user_current_html": "<string>",
"ai_original_old_html": "<string>",
"ai_proposed_new_html": "<string>",
"ai_explanation": "<string>",
"model_tier": "<string>",
"mode": "redo"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_current_html: '<string>',
ai_original_old_html: '<string>',
ai_proposed_new_html: '<string>',
ai_explanation: '<string>',
model_tier: '<string>',
mode: 'redo'
})
};
fetch('https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_current_html' => '<string>',
'ai_original_old_html' => '<string>',
'ai_proposed_new_html' => '<string>',
'ai_explanation' => '<string>',
'model_tier' => '<string>',
'mode' => 'redo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit"
payload := strings.NewReader("{\n \"user_current_html\": \"<string>\",\n \"ai_original_old_html\": \"<string>\",\n \"ai_proposed_new_html\": \"<string>\",\n \"ai_explanation\": \"<string>\",\n \"model_tier\": \"<string>\",\n \"mode\": \"redo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_current_html\": \"<string>\",\n \"ai_original_old_html\": \"<string>\",\n \"ai_proposed_new_html\": \"<string>\",\n \"ai_explanation\": \"<string>\",\n \"model_tier\": \"<string>\",\n \"mode\": \"redo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superdocs.app/v1/sessions/{session_id}/chunks/{chunk_id}/re-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_current_html\": \"<string>\",\n \"ai_original_old_html\": \"<string>\",\n \"ai_proposed_new_html\": \"<string>\",\n \"ai_explanation\": \"<string>\",\n \"model_tier\": \"<string>\",\n \"mode\": \"redo\"\n}"
response = http.request(request)
puts response.read_body{
"chunk_id": "<string>",
"new_html": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
