Zum Inhalt springen
Leadtime
Deutsch
Esc
↑↓navigieren↵öffnen⌘Jvorschau

Apply exact HTML edits to one documentation page

Applies an ordered batch of exact HTML search-and-replace edits atomically. Use canonical HTML, contentGeneration, and contentEtag from a current tree, search, partial-read, page-detail, or prior edit response. Each search must match exactly once in the same current document. The server rejects missing, ambiguous, overlapping, stale, malformed, or schema-lossy edits. HTML fragments are normalized with the editor HTML parser before matching. The edit stays in the active collaboration generation and connected editors receive its incremental update. The response is a small receipt and does not include the page body.

POST/projects/documentation/{id}/content-edits
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstring<uuid>required

Project documentation page UUID. Folder UUIDs cannot receive content edits.

Request body
requiredapplication/json
commandIdstringrequired

Stable client command identity. An exact retry returns the stored receipt. Reusing it for another request returns a conflict.

max length 100
contentEtagstringrequired

Current content ETag from a tree, search, partial-read, page-detail, or previous edit response. Treat it as opaque and send the complete string unchanged, including quotes when present.

contentGenerationnumberrequired

Current content generation from the page detail or a previous edit receipt.

min 1
editsProjectDocumentationHtmlEditDto[]required
Show properties
Array of ProjectDocumentationHtmlEditDto
replacestringrequired

Replacement HTML fragment. Use an empty string to remove the matched fragment.

searchstringrequired

Exact HTML fragment from the canonical content returned by the API.

Responses
200
commandIdstringrequired
contentEtagstringrequired

Quoted strong ETag after the edit. Keep the double quotes for the next exact edit.

contentGenerationnumberrequired
min 1
duplicatebooleanrequired

True when the server returned the stored command receipt.

matchesProjectDocumentationHtmlEditMatchDto[]required
Show properties
Array of ProjectDocumentationHtmlEditMatchDto
editIndexnumberrequired
matchCountnumberrequired
Allowed:1
matchedCharactersnumberrequired
stateBytesnumberrequired

Bytes in the durable aggregate editor state.

updateBytesnumberrequired

Bytes in the incremental live-editor update.

400

Invalid page identifier, malformed HTML, or HTML that the editor schema cannot preserve.

errorstring | object

HTTP error name or a structured HTTP exception response.

Show properties
One of:
string
string
object
object
messagestring | string[] | objectrequired

Error message, validation message list, or request-field validation message map.

Show properties
One of:
string
string
string[]
Array of string
string
object
object
statusCodenumberrequired

HTTP status code for this response.

401

Unauthorized - Invalid or missing authentication token

403

Forbidden - Insufficient API scopes or permissions

404

The page does not exist or is not accessible.

errorstring | object

HTTP error name or a structured HTTP exception response.

Show properties
One of:
string
string
object
object
messagestring | string[] | objectrequired

Error message, validation message list, or request-field validation message map.

Show properties
One of:
string
string
string[]
Array of string
string
object
object
statusCodenumberrequired

HTTP status code for this response.

409

Stale content, a missing or ambiguous search, overlapping matches, or command identity reuse.

errorstring | object

HTTP error name or a structured HTTP exception response.

Show properties
One of:
string
string
object
object
messagestring | string[] | objectrequired

Error message, validation message list, or request-field validation message map.

Show properties
One of:
string
string
string[]
Array of string
string
object
object
statusCodenumberrequired

HTTP status code for this response.

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "https://leadtime.app/api/public/projects/documentation/550e8400-e29b-41d4-a716-446655440000/content-edits" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "commandId": "revise-risk-section-2026-08-08",
  "contentEtag": "8e2ffa0587a5c9e89d3a5228fc2b6693b8941588d06a249dd7bfb6b7e8d871a1",
  "contentGeneration": 3,
  "edits": [
    {
      "replace": "<p>The revised text.</p>",
      "search": "<p>The old text.</p>"
    }
  ]
}'
Response
{
  "commandId": "string",
  "contentEtag": "\"pd-3-DykV4wYdAQ\"",
  "contentGeneration": 1,
  "duplicate": true,
  "matches": [
    {
      "editIndex": 0,
      "matchCount": 1,
      "matchedCharacters": 24
    }
  ],
  "stateBytes": 0,
  "updateBytes": 0
}