> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Credentials

> Step-by-step instructions for Notion internal integration tokens, OAuth, and webhook verification for the Corsair Notion plugin.

This guide walks you through obtaining all required credentials for the Notion plugin.

## Authentication Methods

The Notion plugin supports two authentication methods:

* **[`api_key`](/concepts/api-key)** (default) — Internal integration secret (starts with `secret_`)
* **[`oauth_2`](/concepts/oauth)** — Notion OAuth 2.0 for user / workspace authorization

## API Key (Internal Integration)

### Step 1: Create an Internal Integration

1. Open [My integrations](https://www.notion.so/my-integrations) in Notion.
2. Click **New integration**.
3. Choose the **Associated workspace** and give the integration a name.
4. Under **Capabilities**, enable the content capabilities your app needs (read/write comments, content, etc.).
5. Submit and open the integration’s **Secrets** tab.
6. Copy the **Internal Integration Secret** (starts with `secret_`).

### Step 2: Share Pages or Databases With the Integration

Internal integrations only see pages and databases you explicitly share:

1. Open the Notion page or database.
2. Use **Share** → invite your integration (or **Connections** / **Add connections** depending on UI).

**Storing credentials:**

```bash theme={null}
pnpm corsair setup --plugin=notion api_key=secret_XXXXXXXXXXXX
```

Verify:

```bash theme={null}
pnpm corsair auth --plugin=notion --credentials
```

## OAuth 2.0

Use OAuth when you need per-user or multi-workspace access instead of a single internal integration.

### Step 1: Create a Public OAuth Integration

1. In [My integrations](https://www.notion.so/my-integrations), create an integration and set the type to **Public** (OAuth-capable) when prompted.
2. Note the **OAuth client ID** and **OAuth client secret** from the integration settings.

### Step 2: Register Redirect URLs

1. In the integration settings, add the **Redirect URI** that Corsair will use (for example, the callback URL your app exposes for Notion OAuth).
2. Save changes.

Notion’s OAuth flow does not use traditional scope strings the same way some providers do; access is determined by workspace sharing and integration capabilities.

**Storing credentials and completing authorization:**

```bash theme={null}
pnpm corsair setup --plugin=notion client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=notion
```

Open the printed authorization URL, approve access, and return — tokens are stored for Corsair to use.

## Webhook Verification Secret

When you enable Notion webhooks for a subscription, Notion provides a secret used with the `X-Notion-Signature` header.

1. Configure your webhook subscription in the Notion API / integration settings (per Notion’s current webhook documentation).
2. Copy the **verification / signing secret** for that subscription.

**Storing credentials:**

```bash theme={null}
pnpm corsair setup --plugin=notion webhook_signature=your-notion-webhook-secret
```

## Required Credentials Summary

| Credential                  | Required for                   | Where to find                           |
| --------------------------- | ------------------------------ | --------------------------------------- |
| Internal integration secret | [`api_key`](/concepts/api-key) | My integrations → integration → Secrets |
| Client ID / secret          | [`oauth_2`](/concepts/oauth)   | Same integration, OAuth section         |
| Webhook secret              | Webhooks                       | Webhook subscription configuration      |

For general information about how Corsair handles authentication, see [Authentication](/concepts/auth). For tenant-specific OAuth URLs, see [Multi-tenancy](/concepts/multi-tenancy).
