Skip to contents

Handle all pages operations in the Notion API

Note: Access this endpoint through the client instance, e.g., notion$pages. Not to be instantiated directly.

Value

A list containing the parsed API response.

Public fields

properties

Pages properties endpoint

Methods


Method new()

Initialise pages endpoint. Not to be called directly, e.g., use notion$pages instead.

Usage

PagesEndpoint$new(client)

Arguments

client

Notion Client instance


Method create()

Create a page

Usage

PagesEndpoint$create(
  parent,
  properties,
  children = NULL,
  icon = NULL,
  cover = NULL
)

Arguments

parent

Named list (JSON object) (required). The parent page or database where the new page is inserted.

properties

Named list (JSON object) (required). Key-value pairs representing the properties of the page.

children

List of lists (JSON array). Block objects to append as children to the page.

icon

Named list (JSON object). An icon for the page.

cover

Named list (JSON object). A cover image for the page.


Method retrieve()

Retrieve page properties

Usage

PagesEndpoint$retrieve(page_id, filter_properties = NULL)

Arguments

page_id

Character (required.). The ID for a Notion page.

filter_properties

Character. Page property value IDs to include in the response schema. If NULL, all properties are returned.

Examples

notion <- notion_client()

# ----- create a page
notion$pages$create(
  list(page_id = "22f33ea0c1e480b99c77d1ab72aedff9"),
  list(
    title = list(list(
      text = list(
        content = "Test Page for notionapi"
      )
    ))
  )
)
#> {
#>   "object": "page",
#>   "id": "23933ea0-c1e4-81d6-a6f6-dd5b57ad4aba",
#>   "created_time": "2025-07-23T05:00:00.000Z",
#>   "last_edited_time": "2025-07-23T05:00:00.000Z",
#>   "created_by": {
#>     "object": "user",
#>     "id": "6b786605-e456-4237-9c61-5efaff23c081"
#>   },
#>   "last_edited_by": {
#>     "object": "user",
#>     "id": "6b786605-e456-4237-9c61-5efaff23c081"
#>   },
#>   "cover": {},
#>   "icon": {},
#>   "parent": {
#>     "type": "page_id",
#>     "page_id": "22f33ea0-c1e4-80b9-9c77-d1ab72aedff9"
#>   },
#>   "archived": false,
#>   "in_trash": false,
#>   "properties": {
#>     "title": {
#>       "id": "title",
#>       "type": "title",
#>       "title": [
#>         {
#>           "type": "text",
#>           "text": {
#>             "content": "Test Page for notionapi",
#>             "link": {}
#>           },
#>           "annotations": {
#>             "bold": false,
#>             "italic": false,
#>             "strikethrough": false,
#>             "underline": false,
#>             "code": false,
#>             "color": "default"
#>           },
#>           "plain_text": "Test Page for notionapi",
#>           "href": {}
#>         }
#>       ]
#>     }
#>   },
#>   "url": "https://www.notion.so/Test-Page-for-notionapi-23933ea0c1e481d6a6f6dd5b57ad4aba",
#>   "public_url": {},
#>   "request_id": "a46593d0-18a7-436e-ab7c-b3049b00c8e8"
#> } 

# ----- retrieve a page
notion$pages$retrieve("23933ea0-c1e4-81d6-a6f6-dd5b57ad4aba")
#> {
#>   "object": "page",
#>   "id": "23933ea0-c1e4-81d6-a6f6-dd5b57ad4aba",
#>   "created_time": "2025-07-23T05:00:00.000Z",
#>   "last_edited_time": "2025-07-23T05:00:00.000Z",
#>   "created_by": {
#>     "object": "user",
#>     "id": "6b786605-e456-4237-9c61-5efaff23c081"
#>   },
#>   "last_edited_by": {
#>     "object": "user",
#>     "id": "6b786605-e456-4237-9c61-5efaff23c081"
#>   },
#>   "cover": {},
#>   "icon": {},
#>   "parent": {
#>     "type": "page_id",
#>     "page_id": "22f33ea0-c1e4-80b9-9c77-d1ab72aedff9"
#>   },
#>   "archived": false,
#>   "in_trash": false,
#>   "properties": {
#>     "title": {
#>       "id": "title",
#>       "type": "title",
#>       "title": [
#>         {
#>           "type": "text",
#>           "text": {
#>             "content": "Test Page for notionapi",
#>             "link": {}
#>           },
#>           "annotations": {
#>             "bold": false,
#>             "italic": false,
#>             "strikethrough": false,
#>             "underline": false,
#>             "code": false,
#>             "color": "default"
#>           },
#>           "plain_text": "Test Page for notionapi",
#>           "href": {}
#>         }
#>       ]
#>     }
#>   },
#>   "url": "https://www.notion.so/Test-Page-for-notionapi-23933ea0c1e481d6a6f6dd5b57ad4aba",
#>   "public_url": {},
#>   "request_id": "b9ea5c65-77df-48fb-b165-5bb2ffffe555"
#> }