UnmarkdownDocs

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/:id

Update a document. Only the provided fields are changed.

Parameters

ParameterTypeDescription
titlestringNew document title
contentstringNew Markdown content
template_idstringNew template ID
theme_modestringColor theme: light or dark
descriptionstringPage meta description (set to null to clear)
page_widthstringPage 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

StatusDescription
200Document updated successfully
400Invalid body, unknown template_id, invalid page_width, or no valid fields
401Missing or invalid API key
403Permission denied
404Document not found
429Rate limit or quota exceeded
500Internal server error