PATCH
/v1/documents/:idUpdate Document
Update a document's content or settings.
Update one or more fields of an existing document. Only include the fields you want to change. If the document is published, changes are reflected on the published page immediately.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Document UUID |
Parameters
All parameters are optional. Only include the fields you want to update.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Document title |
content | string | No | Markdown content |
template_id | string | No | Template ID for styling. See Templates |
theme_mode | string | No | Color theme: "light" or "dark" |
description | string | No | Document description for SEO. Set to null to clear. |
page_width | string | No | Page width: "standard", "wide", or "full" |
Response
Returns the updated document fields.
| Field | Type | Description |
|---|---|---|
id | string | Document UUID |
title | string | Document title |
template_id | string | Template applied to the document |
theme_mode | string | Color theme |
page_width | string or null | Page width setting |
updated_at | string | ISO 8601 last update timestamp |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Invalid request body or parameter values |
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | Feature requires Pro tier (e.g., certain template IDs) |
| 404 | not_found | Document does not exist or does not belong to you |
| 429 | rate_limited | Rate limit or monthly quota exceeded |
| 500 | internal_error | Unexpected server error |
curl -X PATCH https://api.unmarkdown.com/v1/documents/d4f7a8b2-1234-5678-9abc-def012345678 \
-H "Authorization: Bearer um_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"title": "Weekly Report (Updated)",
"content": "# Weekly Report\n\n## Summary\n\nUpdated content with new metrics."
}'
const response = await fetch(
"https://api.unmarkdown.com/v1/documents/d4f7a8b2-1234-5678-9abc-def012345678",
{
method: "PATCH",
headers: {
"Authorization": "Bearer um_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
title: "Weekly Report (Updated)",
content: "# Weekly Report\n\n## Summary\n\nUpdated content with new metrics.",
}),
}
);
const data = await response.json();
console.log(data.updated_at);
import requests
response = requests.patch(
"https://api.unmarkdown.com/v1/documents/d4f7a8b2-1234-5678-9abc-def012345678",
headers={"Authorization": "Bearer um_your_key_here"},
json={
"title": "Weekly Report (Updated)",
"content": "# Weekly Report\n\n## Summary\n\nUpdated content with new metrics.",
},
)
data = response.json()
print(data["updated_at"])
Response 200 OK
{
"id": "d4f7a8b2-1234-5678-9abc-def012345678",
"title": "Weekly Report (Updated)",
"template_id": "executive",
"theme_mode": "light",
"page_width": "standard",
"updated_at": "2026-02-15T14:30:00.000Z"
}
Change only the template
curl -X PATCH https://api.unmarkdown.com/v1/documents/d4f7a8b2-1234-5678-9abc-def012345678 \
-H "Authorization: Bearer um_your_key_here" \
-H "Content-Type: application/json" \
-d '{"template_id": "tokyo-night", "theme_mode": "dark"}'