Get credentials
Create an integration
Go to Notion Integrations and click New integration. Set the type to Public, this is required for OAuth with external users.Configure OAuth settings
In the integration settings, scroll to OAuth Domain & URIs. Add your redirect URI:Copy credentials
Under Basic Information, copy the OAuth client ID and generate an OAuth client secret.Configuration
lib/kavach.ts
Endpoints
| Endpoint | URL |
|---|---|
| Authorization | https://api.notion.com/v1/oauth/authorize |
| Token | https://api.notion.com/v1/oauth/token |
| User info | Embedded in token response (owner.user) |
Scopes
Notion does not use granular OAuth scopes. Permissions are configured at the integration level in the Notion UI. When a user authorizes your integration, they choose which pages and databases to share.User data returned
| Field | Source | Notes |
|---|---|---|
id | owner.user.id | Stable Notion user UUID |
email | owner.user.person.email | Present only for person-type authorizations |
name | owner.user.name | Full display name |
avatar | owner.user.avatar_url | May be null if the user has no profile photo |
Notion returns user identity as part of the token exchange response, there is no separate
/me endpoint. KavachOS caches the token payload internally so no extra network call is made.Workspace data
The token response also includes workspace context, available inuserInfo.raw: