curl --request PATCH \
--url https://scribe.skeptrune.com/api/docs/{id}/content \
--header 'Content-Type: text/markdown' \
--header 'X-Base-Version: <x-base-version>' \
--cookie scribe_session= \
--data '<string>'import requests
url = "https://scribe.skeptrune.com/api/docs/{id}/content"
payload = "<string>"
headers = {
"cookie": "scribe_session=",
"X-Base-Version": "<x-base-version>",
"Content-Type": "text/markdown"
}
response = requests.patch(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
cookie: 'scribe_session=',
'X-Base-Version': '<x-base-version>',
'Content-Type': 'text/markdown'
},
body: '<string>'
};
fetch('https://scribe.skeptrune.com/api/docs/{id}/content', 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://scribe.skeptrune.com/api/docs/{id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: text/markdown",
"X-Base-Version: <x-base-version>"
],
]);
$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://scribe.skeptrune.com/api/docs/{id}/content"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "scribe_session=")
req.Header.Add("X-Base-Version", "<x-base-version>")
req.Header.Add("Content-Type", "text/markdown")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://scribe.skeptrune.com/api/docs/{id}/content")
.header("cookie", "scribe_session=")
.header("X-Base-Version", "<x-base-version>")
.header("Content-Type", "text/markdown")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/docs/{id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'scribe_session='
request["X-Base-Version"] = '<x-base-version>'
request["Content-Type"] = 'text/markdown'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"merged": true,
"wordCount": 1284,
"charCount": 8241,
"version": "Vt3q9ZkpR1aB"
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Merge document content
Merges markdown edited from a known base version into the live document, CRDT-style. Send the edited markdown as a text/markdown request body plus the required X-Base-Version header (the X-Doc-Version returned by GET /content). The server diffs the edit against the base snapshot and applies only that diff to the live document, so edits humans made since the base merge in instead of being overwritten — no locks, no lost keystrokes. If the base version has expired (roughly: older than the last 15 writes or 24 hours), 409 version_gone is returned; re-GET the content and reapply the edit. API keys with edit access write as their agent identity; legacy keys without one are recorded as the key itself. Line breaks: a single newline renders as a line break, so stacked lines (a signature, an address) appear on their own lines as written. Use a blank line between blocks to start a new paragraph.
curl --request PATCH \
--url https://scribe.skeptrune.com/api/docs/{id}/content \
--header 'Content-Type: text/markdown' \
--header 'X-Base-Version: <x-base-version>' \
--cookie scribe_session= \
--data '<string>'import requests
url = "https://scribe.skeptrune.com/api/docs/{id}/content"
payload = "<string>"
headers = {
"cookie": "scribe_session=",
"X-Base-Version": "<x-base-version>",
"Content-Type": "text/markdown"
}
response = requests.patch(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
cookie: 'scribe_session=',
'X-Base-Version': '<x-base-version>',
'Content-Type': 'text/markdown'
},
body: '<string>'
};
fetch('https://scribe.skeptrune.com/api/docs/{id}/content', 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://scribe.skeptrune.com/api/docs/{id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: text/markdown",
"X-Base-Version: <x-base-version>"
],
]);
$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://scribe.skeptrune.com/api/docs/{id}/content"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "scribe_session=")
req.Header.Add("X-Base-Version", "<x-base-version>")
req.Header.Add("Content-Type", "text/markdown")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://scribe.skeptrune.com/api/docs/{id}/content")
.header("cookie", "scribe_session=")
.header("X-Base-Version", "<x-base-version>")
.header("Content-Type", "text/markdown")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/docs/{id}/content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'scribe_session='
request["X-Base-Version"] = '<x-base-version>'
request["Content-Type"] = 'text/markdown'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"merged": true,
"wordCount": 1284,
"charCount": 8241,
"version": "Vt3q9ZkpR1aB"
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Authorizations
Browser session cookie set by the WorkOS sign-in flow.
Headers
The X-Doc-Version token of the GET /content snapshot this edit was made from. An unquoted version token from GET /content, e.g. verCURRENT01.
"Vt3q9ZkpR1aB"
Path Parameters
Id of the document to merge markdown into.
Body
The edited markdown, based on the X-Base-Version snapshot. A single newline renders as a line break (stacked lines stay on their own lines); use a blank line to start a new paragraph.
The full edited markdown source, based on the base version.
Response
The edit was merged into the live document.
Result of merging API-edited markdown into the live document.
Always true: the edit was merged into the live document.
true true
Word count after the merge.
1284
Character count after the merge.
8241
Version token of the merged result — use it as the X-Base-Version of a follow-up edit.
"Vt3q9ZkpR1aB"