-
Notifications
You must be signed in to change notification settings - Fork 1
Add NotionBlockToPage
Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/patch-block-children schema: 2.0.0 Type: Command
Adds one or more Notion blocks to a specified Notion page.
Add-NotionBlockToPage -Page <notion_page> -Block <notion_block[]> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Add-NotionBlockToPage -pageID <Object> -Block <notion_block[]> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
The Add-NotionBlockToPage function allows adding Notion blocks to an existing Notion page. The function takes a notion_page object representing the parent page and one or more notion_block objects representing the content to be added. It then makes an API request to update the page with the new blocks.
$Page = Get-NotionPage -Id "12345678-90ab-cdef-1234-567890abcdef"
$Block = New-NotionBlock -Type "paragraph" -Text "Hello, Notion!"
Add-NotionBlockToPage -Page $Page -Block $Block
Description: This example retrieves a Notion page by ID and creates a new paragraph block, then adds it to the page.
$Page = Get-NotionPage -Id "12345678-90ab-cdef-1234-567890abcdef"
$Block1 = New-NotionBlock -Type "heading_1" -Text "Main Heading"
$Block2 = New-NotionBlock -Type "paragraph" -Text "This is a paragraph under the heading."
Add-NotionBlockToPage -Page $Page -Block @($Block1, $Block2)
Description: This example retrieves a Notion page and adds a heading block followed by a paragraph block to it.
Specifies the Notion block(s) to be added to the page. Type: notion_block[] Required: Yes Position: Named Accept pipeline input: No Help Message: The block to add to the page.
Type: notion_block[]
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the parent Notion page to which the block(s) will be added. Type: notion_page Required: Yes Position: Named Accept pipeline input: No ParameterSetName: Page Help Message: The parent page to add the block to.
Type: notion_page
Parameter Sets: Page
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the page id of the parent page. Type: string Required: Yes Position: Named Accept pipeline input: No ParameterSetName: PageID Help Message: The page id of the parent page.
Type: Object
Parameter Sets: PageID
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- This function currently requires a notion_page object as input. Future updates may add support for specifying a Page ID directly.
- The function converts the blocks into JSON before making an API request.
https://developers.notion.com/reference/patch-block-children
Home
Module-FAQ
SetupOfIntegration
Commands
- Connect-Notion
- ConvertTo-NotionObject
- Disconnect-Notion
- Invoke-NotionApiCall
- Block
- Add-NotionBlockToPage
- Get-NotionBlock
- Get-NotionBlockChildren
- New-NotionBlock
- Remove-NotionBlock
- Update-NotionBlock
- _RichText
- Bookmark
- Breadcrumb
- BulletedListItem
- Callout
- ChildDatabase
- Code
- Column
- ColumnList
- Divider
- Embed
- Equation
- File
- Heading
- Image
- LinkPreview
- NumberedListItem
- Paragraph
- Quote
- Synced
- Table
- TableOfContents
- TableRow
- ToDo
- Toggle
- Video
- Database
- Emoji
- File
- Page
- Parent
- User
Classes
- Block
- Comment
- Database
- Database
- DatabaseProperties
- Emoji
- File
- General
- Page
- page
- page_reference
- PageProperties
- Parent
- Unfurl attribute
- User
Enums
- notion_color
- icontype
- Block
- blocktype
- RichText
- rich_text_type
- rich_text_mention_type
- Type
- MentionType
- DatabaseProperties
- File
- PageProperties
- Parent
- Properties
- User