createPage

abstract suspend fun createPage(parentDatabase: DatabaseReference, icon: EmojiOrFile? = null, cover: File? = null, properties: PropertyValueList = PropertyValueList(), content: MutableBlockList? = null): Page

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.

Return

The created Page object

Parameters

parentDatabase

Reference to the parent database

icon

Optional emoji or file to use as the page icon

cover

Optional file to use as the page cover

properties

List of property values for the page (required for database pages)

content

Optional list of blocks to add as page content

See also

Throws

NotionApiException

if the database doesn't exist or the API request fails


abstract suspend fun createPage(parentDatabase: DatabaseReference, icon: EmojiOrFile? = null, cover: File? = null, properties: PropertyValueList = PropertyValueList(), content: BlockListProducer): Page

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.

Return

The created Page object

Parameters

parentDatabase

Reference to the parent database

icon

Optional emoji or file to use as the page icon

cover

Optional file to use as the page cover

properties

List of property values for the page (required for database pages)

content

Block producer function to generate page content

See also


abstract suspend fun createPage(parentPage: PageReference, title: RichTextList = RichTextList(), icon: EmojiOrFile? = null, cover: File? = null, content: MutableBlockList? = null): Page

Creates a new page as a child of another page. This method creates a subpage with a title and optional content blocks.

Return

The created Page object

Parameters

parentPage

Reference to the parent page

title

The title of the new page as a rich text list

icon

Optional emoji or file to use as the page icon

cover

Optional file to use as the page cover

content

Optional list of blocks to add as page content

See also

Throws

NotionApiException

if the parent page doesn't exist or the API request fails


abstract suspend fun createPage(parentPage: PageReference, title: RichTextList = RichTextList(), icon: EmojiOrFile? = null, cover: File? = null, content: BlockListProducer): Page

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.

Return

The created Page object

Parameters

parentPage

Reference to the parent page

title

The title of the new page as a rich text list

icon

Optional emoji or file to use as the page icon

cover

Optional file to use as the page cover

content

Block producer function to generate page content

See also