Skip to content

Add NotionDatabaseToParent

fasteiner edited this page Aug 23, 2025 · 1 revision

Add-NotionDatabaseToParent

SYNOPSIS

Creates a new Notion database.

SYNTAX

Add-NotionDatabaseToParent [[-parent_obj] <Object>] [[-title] <Object[]>] [-properties] <Hashtable>
 [<CommonParameters>]

DESCRIPTION

The function Add-NotionDatabaseToParent creates a new Notion database within the specified parent object, title, and properties. It converts the provided parameters to the appropriate types and makes an API call to create the database in Notion.

EXAMPLES

EXAMPLE 1

$parent = @{
    type    = "page_id"
    page_id = "12345678901234567890"
}
$title = "My New Database"
$properties = @{
    Name = @{
        type = "title"
        title = @{}
    }
}
Add-NotionDatabaseToParent -parent_obj $parent -title $title -properties $properties

This command creates a new Notion database within the specified parent page, title, and properties.

PARAMETERS

-parent_obj

The parent object of the page. If not provided, a default parent will be used.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-properties

The properties objects of the database. This parameter is mandatory.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-title

The title (or title object) of the database. Can be a string or an array of rich text objects.

Type: Object[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

[notion_database]

Returns a notion_database object representing the newly created database.

NOTES

This function requires the Invoke-NotionAPICall and Remove-NullValuesFromObject helper functions, as well as the notion_database, notion_parent, rich_text, rich_text_text, and notion_databaseproperties types.

RELATED LINKS

https://developers.notion.com/reference/create-a-database

Notion Module

Home
Module-FAQ
SetupOfIntegration

Commands
Classes
Enums

Clone this wiki locally