BlocksEndpoint: R6 Class for Blocks Endpoint

BlocksEndpointR Documentation

R6 Class for Blocks Endpoint

Description

Handle all block operations in the Notion API

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

Value

A list containing the parsed API response.

Public fields

children

Block children endpoint

Methods

Public methods


Method new()

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

Usage
BlocksEndpoint$new(client)
Arguments
client

Notion Client instance


Method retrieve()

Retrieve a block

Usage
BlocksEndpoint$retrieve(block_id)
Arguments
block_id

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

Details

Endpoint documentation


Method update()

Update a block

Usage
BlocksEndpoint$update(block_id, in_trash = NULL, ...)
Arguments
block_id

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

in_trash

Boolean. Set to TRUE to trash (delete) a block. Set to FALSE to restore a block.

...

<dynamic-dots> Block-specific properties to update. Each argument should be named after a block type (e.g., heading_1, paragraph) with a named list value containing the block configuration.

Details

Endpoint documentation


Method delete()

Delete a block

Usage
BlocksEndpoint$delete(block_id)
Arguments
block_id

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

Details

Endpoint documentation

Examples


notion <- notion_client()

# ----- Retrieve a block
notion$blocks$retrieve("34033ea0-c1e4-8123-be95-e77dcc78e47d")


# ----- Update a block
notion$blocks$update(
  "34033ea0-c1e4-8123-be95-e77dcc78e47d",
  heading_2 = list(
    rich_text = list(list(
      text = list(
        content = "Updated Test Heading"
      )
    ))
  )
)


# ----- Delete a block
notion$blocks$delete(
  "34033ea0-c1e4-8123-be95-e77dcc78e47d"
)



notionapi documentation built on April 13, 2026, 9:07 a.m.