getBlock

abstract suspend fun getBlock(id: UuidString, retrieveChildrenRecursively: Boolean = false): Block

Retrieves a specific block by its ID.

Note:

  • When retrieveChildrenRecursively is false, 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.

  • When retrieveChildrenRecursively is true, all nested children blocks will be retrieved. Caution: This can result in many API calls for blocks with many children.

Return

The requested Block object

Parameters

id

The unique identifier of the block to retrieve

retrieveChildrenRecursively

Whether to fetch all nested children blocks

See also

Throws

NotionApiException

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