Functions

append-children

fn (block-id: Str, children: Vec): Map
fn (block-id: Str, children: Vec, opts: Map): Map

PATCH /blocks/{id}/children - Append blocks to a page or block (build them with the ::notion helpers).

Example

::notion::blocks/append-children("59833787-2cf9-4fdf-8782-e53db20768a5", [
  ::notion/to-do("Review the pinecone package"),
  ::notion/paragraph("Added by the standup agent.")
])

delete-block

fn (block-id: Str): Map
fn (block-id: Str, opts: Map): Map

DELETE /blocks/{id} - Move a block to the trash.

Example

::notion::blocks/delete-block("c02fc1d3-db8b-45c5-a222-27595b15aea7")

get-children

fn (block-id: Str): Map
fn (block-id: Str, opts: Map): Map

GET /blocks/{id}/children - A page's (or block's) content blocks. Returns {results, has_more, next_cursor}.

Example

content ::notion::blocks/get-children("59833787-2cf9-4fdf-8782-e53db20768a5")
map(content.results, %.type)
fn (query: Str): Map
fn (query: Str, opts: Map): Map
fn (query: Str, object-type: Str): Map
fn (query: Str, object-type: Str, opts: Map): Map

POST /search - Search everything shared with the integration. The 2-arity form filters to "page" or "database" objects.

Example

hits ::notion::blocks/search("quarterly roadmap", "page")
first(hits.results).url