Contents
Update document content
Replaces the content of the document with the given Markdown.
The plain field returned by the document APIs is the Markdown of the current content, so the intended flow is to read plain, edit it, and send it back as content.
The update is rejected without changing the document when the given Markdown cannot be converted back without losing content. See moreInfo in the error response for the reason.
This endpoint updates the content only. To update the title or the emoji, use Update document title and emoji.
The user who calls this API must be a member of the project that the document belongs to.
Role
Permission
All permissions
Restriction
No restriction
Method
PATCH
URL
/api/v2/documents/:documentId/content
URL parameters
| Parameter Name | Type | Description |
|---|---|---|
| documentId (Required) | String | Document ID |
Form parameters
| Parameter Name | Type | Description |
|---|---|---|
| content (Required) | String | The content of the document. This is parsed as Markdown. |
Response example
Response Body
{
"id": "019b4e27b88b7cc4ae16d72c3de62299",
"projectId": 1,
"title": "document title",
"json": {
"type": "doc",
"content": [
{
"type": "heading",
"attrs": {
"id": "NmU",
"level": 1
},
"content": [
{
"type": "text",
"text": "head"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Updated document content"
}
]
}
]
},
"plain": "# head\n\nUpdated document content",
"statusId": 1,
"emoji": "👍",
"createdUserId": 2,
"created": "2025-12-24T02:19:42Z",
"updatedUserId": 2,
"updated": "2025-12-25T04:11:08Z",
"code": null
}
Notes on the response
| Field | Description |
|---|---|
| plain | The content after the update, re-serialized as Markdown. This is the normalized form of the document, so it does not always match the content you sent. |
| code | The reason the document was not updated. NO_CHANGE is returned when the submitted content is identical to the current content. null when the document was updated. |