Skip to main content
The Update Page endpoint lets you modify an existing page in your workspace. Send a PUT request with any combination of the updatable fields — title and content. You only need to include the fields you want to change; any fields you omit retain their current values. The API returns the full updated page object on success.

Endpoint

PUT https://api.pharen.de/v1/new-page/{id}

Path Parameters

id
string
required
The unique identifier of the page you want to update. Retrieve this from the List Pages or Create Page endpoints.

Request Body

title
string
The new title for the page. Must be between 1 and 255 characters. If omitted, the page’s existing title is preserved.
content
string
The new body content for the page. Accepts plain text or Markdown. If omitted, the page’s existing content is preserved. Pass an empty string to explicitly clear the content body.
At least one of title or content must be present in the request body. Sending an empty JSON object {} returns a 422 Unprocessable Entity error.

Request Example

curl https://api.pharen.de/v1/new-page/page_01hx9k2m3nqvw4e5r6t7y8u9p \
  --request PUT \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "title": "Getting Started Guide (Updated)",
    "content": "## Welcome to Pharen Hub\n\nThis updated guide reflects our new onboarding flow..."
  }'

Response

A successful request returns a 200 OK status and the full page object reflecting all changes.

Response Fields

id
string
The unique identifier for the page. Unchanged by the update.
title
string
The current title of the page after the update.
content
string
The current body content of the page after the update.
created_at
string
ISO 8601 timestamp recording when the page was originally created. Unchanged by the update.
updated_at
string
ISO 8601 timestamp recording when this update was applied. This value changes with every successful update.

Response Example

{
  "id": "page_01hx9k2m3nqvw4e5r6t7y8u9p",
  "title": "Getting Started Guide (Updated)",
  "content": "## Welcome to Pharen Hub\n\nThis updated guide reflects our new onboarding flow...",
  "created_at": "2024-06-01T09:00:00Z",
  "updated_at": "2024-06-15T16:05:30Z"
}

Error Responses

Page not found (404):
{
  "error": {
    "code": "not_found",
    "message": "No page with ID 'page_01hx9k2m3nqvw4e5r6t7y8u9p' exists in this workspace."
  }
}
Validation error (422):
{
  "error": {
    "code": "validation_error",
    "message": "The request body must include at least one updatable field.",
    "details": {
      "fields": ["title", "content"]
    }
  }
}
Update operations are destructive for the fields you provide. If you supply a content value, the existing content is fully replaced — there is no partial or delta update. If you only want to change the title, omit content from your request body entirely.