getBlockList

abstract suspend fun getBlockList(parentId: UuidString, pagination: Pagination = Pagination()): ResultPage<Block>

Retrieves the immediate children blocks of a specified parent object (page or block). This method only retrieves the direct children and does not fetch nested blocks.

Note: This will not retrieve nested children blocks. Blocks that can have children will have their Block.children property set to an empty list, while blocks that cannot have children will have it set to null. Use getAllBlockListRecursively to fetch all nested blocks.

Return

A ResultPage containing a list of Block objects and pagination information

Parameters

parentId

The unique identifier of the parent page or block

pagination

Optional pagination parameters to control the number of results

See also

Throws

NotionApiException

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