Update a document

Replace a page body, rename an item, or move it to another folder without changing its numeric ID.

{
    "title": "Update a document",
    "description": "",
    "method": "PUT",
    "baseUrl": "https://app.docuwriter.ai",
    "endpoint": "/api/spaces/{space}/documents/{spaceMenuItem}",
    "headers": [
        {
            "key": "Authorization",
            "value": "Bearer YOUR_API_TOKEN",
            "type": "string",
            "required": true
        },
        {
            "key": "Accept",
            "value": "application/json",
            "type": "string",
            "required": true
        },
        {
            "key": "Content-Type",
            "value": "application/json",
            "type": "string",
            "required": true
        }
    ],
    "queryParams": [],
    "pathParams": [
        {
            "key": "space",
            "value": "Numeric Space ID.",
            "type": "integer",
            "required": true
        },
        {
            "key": "spaceMenuItem",
            "value": "Numeric document/menu-item ID belonging to the Space.",
            "type": "integer",
            "required": true
        }
    ],
    "bodyType": "json",
    "requestBody": "{\n  \"title\": \"Payment lifecycle\",\n  \"content\": \"# Payment lifecycle\\n\\nPayments are created, authorized and settled.\"\n}",
    "formData": [],
    "rawBody": "",
    "responses": {
        "200": {
            "description": "HTTP 200: success: true, message, and data.id, name, type, parent_id, url, updated_at, plus public_url for public Spaces. The response does not include the full body; GET the document to confirm the result. Illustrative JSON example; sample values are fictional. Some optional or additional resource fields may be omitted.",
            "body": "{\n  \"success\": true,\n  \"data\": {\n    \"id\": 456,\n    \"name\": \"Payment lifecycle\",\n    \"parent_id\": null\n  },\n  \"message\": \"Document updated successfully\"\n}"
        },
        "401": {
            "description": "Missing or invalid account API token.Missing or invalid account API token. Example JSON response.",
            "body": "{\n  \"message\": \"Unauthenticated.\"\n}"
        }
    }
}

Request fields

Field Requirement
title Optional title: string up to 255 characters.
content Optional content: Markdown string.
parent_id Optional parent_id: nullable integer referring to an active folder in this Space
Behavior null moves to the root.
Behavior Only supplied fields are updated.
content content replaces the whole body rather than appending a fragment.

Usage notes

  • Requires Space management access.
  • An archived folder is not a valid parent; the endpoint returns HTTP 422 without applying the update.
  • 404 for a document/Space mismatch, 422 for invalid fields or parent, 403 without permission.
  • There is no revision precondition in this endpoint: coordinate concurrent writers and retain a copy before replacement.
  • Changes in public Spaces affect publicly visible content.

API authentication.