Remove NotionDatabase - fasteiner/Notion GitHub Wiki


Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/database (in_trash = true) https://developers.notion.com/reference/update-a-database schema: 2.0.0 Type: Command

Remove-NotionDatabase

SYNOPSIS

Moves a Notion database to the trash.

SYNTAX

Remove-NotionDatabase [-DatabaseId] <String> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The `Remove-NotionDatabase` function marks a Notion database as "in trash" by sending a PATCH request to the Notion API. This effectively removes the database from active use.

EXAMPLES

EXAMPLE 1

Remove-NotionDatabase -DatabaseId "12345678-abcd-1234-efgh-56789ijklmn0" -Confirm:$false

This example moves the database with the specified ID to the trash.

PARAMETERS

-DatabaseId

The ID of the Notion database to move to the trash. This parameter is mandatory.

Type: String
Parameter Sets: (All)
Aliases: Id

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

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

-Confirm

Prompts the user for confirmation before moving the database to the trash. The default is $true.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
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] | $null

Returns a notion_database object representing the trashed database. Returns $null if the operation is cancelled.

NOTES

Requires the `Invoke-NotionAPICall` function and appropriate API authentication to be configured. This function does not permanently delete the database but marks it as "in trash." Ensure you have appropriate permissions to modify the database in Notion.

Attention: Only pages can be restored via the GUI. Databases can only be restored via the API.

RELATED LINKS

[https://developers.notion.com/reference/database (in_trash = true) https://developers.notion.com/reference/update-a-database](https://developers.notion.com/reference/database (in_trash = true) https://developers.notion.com/reference/update-a-database)

https://developers.notion.com/reference/database (in_trash = true) https://developers.notion.com/reference/update-a-database

⚠️ **GitHub.com Fallback** ⚠️