An integration needs a capability for each: Insert content to add, and Update content to change or delete. Markdown edits only need Update content. See Capabilities.
Add a document
A row goes in a database, and a subpage goes under a document.Add and change blocks
Add blocks to the end of the document. The response includes the new blocks and their IDs.Edit as text
Read the document, then replace a piece of text.When people are editing
Writes go into the live document, so people with it open see them right away.- A block write only touches that block’s lines, and text people are typing elsewhere stays.
update_contentworks the same way. It only touches the lines it changes.replace_contenthas no version check. It overwrites what was typed after you read the document.- If someone is typing on the line you change, their cursor can move to the next line when the write changes what holds it, such as adding the first indented child to a paragraph.
When requests overlap
Applying a template to a document that’s already applying one returns 409conflict_error. Nothing is written. Send the request again. Other writes to the same document at the same time are saved one after another.
Undo a delete
Deleted blocks stay in the trash for 30 days, and you can restore them. This includes blocks removed by Markdown edits anderase_content. See Delete a block.
Mentions
Mentioning a person in new content notifies them. To skip this, sendnotifications: { "mode": "silent" } with Append block children, Create a page, or Update a page. Updating a block and Markdown edits always notify.
The notification doesn’t name your integration. It says someone mentioned them.
Webhooks
Your own writes sendpage.content_updated events too. To avoid a loop, skip events written only by your bot. See Authors.