Skip to main content
The Create Page endpoint lets you programmatically add new pages to your Pharen Hub workspace. Send a POST request with a JSON body containing at minimum a title for the page. The API creates the page and returns the full page object, including its newly assigned id, which you can use in subsequent requests.

Endpoint

POST https://api.pharen.de/v1/new-page

Request Body

title
string
required
The title of the new page. Must be between 1 and 255 characters. Titles do not need to be unique across your workspace.
content
string
The body content of the page. Accepts plain text or Markdown. If omitted, the page is created with an empty content body. There is no enforced maximum length, but extremely large payloads may affect performance.

Request Example

curl https://api.pharen.de/v1/new-page \
  --request POST \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "title": "Q3 Product Roadmap",
    "content": "## Overview\n\nThis page outlines our product goals for Q3 2024..."
  }'

Response

A successful request returns a 201 Created status and the full page object for the newly created page.

Response Fields

id
string
The unique identifier assigned to the new page. Store this if you need to reference, update, or delete the page later.
title
string
The title of the page, exactly as provided in your request.
content
string
The body content of the page. Returns an empty string if no content was provided.
created_at
string
ISO 8601 timestamp recording when the page was created.
updated_at
string
ISO 8601 timestamp recording when the page was last modified. On creation, this matches created_at.

Response Example

{
  "id": "page_03kz1m4o5pswY6g7t8v9a0w1r",
  "title": "Q3 Product Roadmap",
  "content": "## Overview\n\nThis page outlines our product goals for Q3 2024...",
  "created_at": "2024-06-15T10:22:45Z",
  "updated_at": "2024-06-15T10:22:45Z"
}

Validation Errors

If the request body is invalid, the API returns 422 Unprocessable Entity with details about which field failed validation:
{
  "error": {
    "code": "validation_error",
    "message": "The 'title' field is required and cannot be blank.",
    "details": {
      "field": "title"
    }
  }
}
The title field is required. Omitting it or passing an empty string will result in a 422 error. All other fields are optional.