Doc body

Replace a single section by heading

Targeted-edit counterpart to PUT /doc (full replacement) and POST /doc/sections (append). Finds the FIRST heading whose plain text matches heading (case-sensitive, trimmed), then replaces everything from that heading up to the next heading at the same or shallower level. markdown is the FULL replacement INCLUDING the heading line; pass an empty string to delete the section. Returns 404 when no matching heading exists, by design, so a misremembered heading fails loudly. Same byte/depth/node-count guard as PUT /doc; same writeDocBody attribution path.

patch/api/workspaces/{slug}/doc/sections

Request

  • Base URL
    https://trydock.ai
  • Auth
    HTTP bearer

Path parameters

slugstring required

Request body

headingstring required
markdownstring required
allowBlockLossboolean
ifUnmodifiedSincestring
ifSectionHashstring

Response

Replaced.

contentunknown
markdownstring

CommonMark + GFM. Returned when ?format=markdown (or Accept: text/markdown with no ?format).

textstring

Plain text, formatting marks stripped. Returned when ?format=text (or Accept: text/plain with no ?format).

updatedAtstring date-time required
updatedBystring required

Changes

No recorded changes to this operation across all 2 revisions of this API.