KNotion Pages
Interface for managing Notion pages through the Notion API. This interface provides methods to create, retrieve, update, and archive pages in your Notion workspace. Pages can be created either as children of databases or other pages, with support for various content types and properties.
Example usage:
// Retrieve a page
val page = client.pages.getPage("page-id")
// Create a page in a database
val newPage = client.pages.createPage(
parentDatabase = DatabaseReference("database-id"),
properties = PropertyValueList().apply {
title("Name", "My New Page")
}
)Functions
Creates a new page as a child of a database. This method allows you to create a page with custom properties and optional content blocks.
Creates a new page as a child of a database using a block producer. This overload allows for more dynamic block creation using a BlockListProducer.
Creates a new page as a child of another page. This method creates a subpage with a title and optional content blocks.
Creates a new page as a child of another page using a block producer. This overload allows for more dynamic block creation using a BlockListProducer.
Retrieves a page by its ID. This method fetches all page properties, content, and metadata.
Archives or unarchives a page. Archived pages are not deleted but are hidden from the Notion UI. They can be unarchived later using this method with archived = false.
Updates the properties of an existing page. This method allows you to modify the page's icon, cover, and properties. Note that page content cannot be updated using this method - use KNotionBlocks instead.