Update Document
Update an existing document. Only include the fields you want to change (PATCH semantics).
Updates the specified document with the provided fields. Fields not included in the request body remain unchanged.
Important
If the document is published, updating it does not automatically republish the changes. Call the Publish endpoint again to push updates live.
PATCH
/v1/documents/:idUpdate a document. Only the provided fields are changed.
Parameters
| Parameter | Type | Description |
|---|---|---|
title | string | New document title |
content | string | New Markdown content |
template_id | string | New template ID |
theme_mode | string | Color theme: light or dark |
description | string | Page meta description (set to null to clear) |
page_width | string | Page width: full, wide, or standard |
Request
bash
curl -X PATCH https://api.unmarkdown.com/v1/documents/d290f1ee-6c54-4b01-90e6-d701748f0851 \
-H "Authorization: Bearer um_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Roadmap",
"content": "# Updated Roadmap\n\nRevised Q1 goals.",
"page_width": "wide"
}'Response
json
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"title": "Updated Roadmap",
"template_id": "swiss",
"theme_mode": "light",
"page_width": "wide",
"updated_at": "2026-02-17T11:00:00Z"
}Error Response
json
{
"error": {
"code": "validation_error",
"message": "No valid fields provided",
"status": 400
}
}Status Codes
| Status | Description |
|---|---|
| 200 | Document updated successfully |
| 400 | Invalid body, unknown template_id, invalid page_width, or no valid fields |
| 401 | Missing or invalid API key |
| 403 | Permission denied |
| 404 | Document not found |
| 429 | Rate limit or quota exceeded |
| 500 | Internal server error |