Skip to content

Connect Notion

fasteiner edited this page Feb 22, 2025 · 1 revision

Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/update-property-schema-object schema: 2.0.0 Type: Command

Connect-Notion

SYNOPSIS

Connects to the Notion API using the provided Bearer token and URL.

SYNTAX

Connect-Notion [-BearerToken] <SecureString> [[-notionURL] <String>] [[-APIVersion] <String>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Connect-TSNotion function is used to establish a connection to the Notion API. It requires a Bearer token and the URL to the Notion API. Optionally, you can specify the API version.

How to obtain an Bearer Token / Notion API Key / Integration Key? 1. Register a new account at [https://notion.com\](https://notion.com) 2. [https://developers.notion.com\](https://developers.notion.com) -> Click "View my integrations" 3. At "My integrations" click Add (+) 4. Select the name, workspace, type and logo - Click "Save" 5. Click on "Configure" 6. Secret -> Click on "Show" 7. Click on "Copy" 8. That's your Bearer Token / API Key / Integration Token

EXAMPLES

EXAMPLE 1

Connect-Notion -BearerToken $secureToken -notionURL "https://api.notion.com/v1" -APIVersion '2022-06-28'

Connects to the Notion API using the specified Bearer token, URL, and API version.

EXAMPLE 2

$BearerToken = Read-Host -Prompt "Enter your Bearer token" | ConvertTo-Securestring -AsPlainText
Connect-Notion -BearerToken $BearerToken

Asks for the API token and connects to the Notion API.

PARAMETERS

-APIVersion

The version of the Notion API to use. Valid values are '2022-02-22' and '2022-06-28'. This parameter is optional and defaults to '2022-06-28'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: 2022-06-28
Accept pipeline input: False
Accept wildcard characters: False

-BearerToken

The Bearer token (aka APIKey) used for authentication. This parameter is mandatory.

Type: SecureString
Parameter Sets: (All)
Aliases: bearer

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

-notionURL

The URL to the Notion API. This parameter is optional and defaults to 'https://api.notion.com/v1'

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: Https://api.notion.com/v1
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

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

System.Collections.Hashtable

Returns a hashtable containing the URL and API version used for the connection.

NOTES

RELATED LINKS

Notion Module

Home
Module-FAQ
SetupOfIntegration

Commands
Classes
Enums

Clone this wiki locally