Edit doc content

Edit the content body of an existing doc with block-level operations: insert_blocks, replace_block, delete_block and format_text. Content is provided as Markdown.

First call Get doc blocks (GET /v1/docs/:doc_id/blocks), then pass its version as expected_version and its block_refs in operations. If the doc has changed since, the edit is rejected with 409; fetch the blocks again and redo the edit. A successful edit also changes the version, so fetch the blocks again before the next edit — or make every change in one request.

The batch is atomic: if any operation fails, nothing changes. Operations apply in order, so an operation cannot target a block that an earlier operation in the batch replaced or deleted. Only blocks marked editable can be replaced, deleted or formatted; Dovetail modules (reference cards, reels, files, video, transcripts, mentions, citations) are never modified, moved or removed. Replacing or deleting a block with comments or highlights is rejected unless allow_annotation_loss is true. The doc's title is not part of its body; use Patch doc to change it.

🚧

Permissions

Please check you have the relevant permissions required to access this resource. This may include specific permissions on the object itself or its parent, or having the correct user role if you're making updates.

Required scope: insight:write

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Unique identifier of the doc.

Body Params

Body

integer
required
≥ 0

The version returned by Get doc blocks. The edit is rejected with 409 if the doc has changed since.

operations
array
required
length between 1 and 50

Operations, applied in order. The batch is atomic: if any operation fails, nothing changes.

operations*

Insert new blocks, parsed from markdown, at an anchor.

string
enum
required
Allowed:
anchor
required

Where to insert the blocks: exactly one of position, before or after. Use { "position": "end" } to append.

string
required
length between 1 and 100000

Block content as markdown. Supports paragraphs, headings (levels 1-3 render distinctly; deeper levels render as level 3), bulleted and numbered lists, task lists (- [ ] / - [x]), blockquotes, tables, and inline bold, italic and code. Use format_text for underline and strikethrough. Links and images are not supported — markdown containing one fails that operation, it is not stripped to plain text. Code blocks, horizontal rules and embeds are not supported.

boolean
Defaults to false

Allow replacing or deleting blocks that carry comments or highlights. Defaults to false.

Responses

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json