PATCH/v1/documents/:id

Update 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

ParameterTypeRequiredDescription
idstringYesDocument UUID

Parameters

All parameters are optional. Only include the fields you want to update.

ParameterTypeRequiredDescription
titlestringNoDocument title
contentstringNoMarkdown content
template_idstringNoTemplate ID for styling. See Templates
theme_modestringNoColor theme: "light" or "dark"
descriptionstringNoDocument description for SEO. Set to null to clear.
page_widthstringNoPage width: "standard", "wide", or "full"

Response

Returns the updated document fields.

FieldTypeDescription
idstringDocument UUID
titlestringDocument title
template_idstringTemplate applied to the document
theme_modestringColor theme
page_widthstring or nullPage width setting
updated_atstringISO 8601 last update timestamp

Errors

StatusCodeDescription
400validation_errorInvalid request body or parameter values
401unauthorizedMissing or invalid API key
403forbiddenFeature requires Pro tier (e.g., certain template IDs)
404not_foundDocument does not exist or does not belong to you
429rate_limitedRate limit or monthly quota exceeded
500internal_errorUnexpected 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"}'