Edit a page

Contents

    Edit an existing page. Only fields included in the request body are updated; omitted fields keep their current value.

    Requires the API Token and an Authentication Token. See Authentication.

    HTTP Request

    PUT /api/pages/{key}

    Parameters

    Key Type Description
    token (required) string API Token.
    authentication (required) string User Authentication Token.
    title string Page title.
    content string Page content (Markdown supported).
    description string Short description.
    tags string Comma-separated tags.
    category string Category key.
    type string published, draft, static, sticky, or scheduled.
    date string Publish date.
    parent string Parent page key.
    position integer Page position.
    coverImage string Cover image filename or URL.
    template string Theme template name.
    noindex boolean Set the noindex meta tag.
    nofollow boolean Set the nofollow meta tag.
    noarchive boolean Set the noarchive meta tag.

    Editing a page may change its key if the title or slug is updated. The new key is returned in data.key.

    Response

    HTTP Code: 200
    Content-Type: application/json
    Body:
    {
      "status": "0",
      "message": "Page edited.",
      "data": {
        "key": "my-dog",
        "uuid": "8a4f2b3c-1234-5678-9abc-def012345678",
        "title": "My dog",
        "type": "published",
        "slug": "my-dog",
        "content": "<p>...</p>",
        "contentRaw": "...",
        "...": "..."
      }
    }

    The full updated page object is returned. See Page object for the complete field reference.

    Errors

    Code Reason
    400 Edit operation failed (validation, persistence error).
    401 Missing or invalid authentication token.
    404 No page exists with the given key.

    CURL command example

    data.json:

    {
      "token": "<api-token>",
      "authentication": "<auth-token>",
      "title": "My dog",
      "content": "Updated content."
    }
    $ curl -X PUT \
        -H "Content-Type: application/json" \
        -d @data.json \
        "https://www.example.com/api/pages/my-dog"