Notion

Notion workspace and knowledge management platform for AI agents

15 tools available · OAuth authentication

SDK Usage #

// Import typed helpers for full type safety
import { Hotglue } from "@hotglue/sdk";
import { toolName } from "@hotglue/sdk/notion";
const client = new Hotglue({ apiKey: "hg_live_xxx" });
const result = await client.execute({
...toolName({ /* typed input */ }),
userId: "user_123",
});
// result is fully typed!
import { Hotglue } from "@hotglue/sdk";
const client = new Hotglue({ apiKey: "hg_live_xxx" });
const result = await client.execute({
integration: "notion",
tool: "tool_name",
userId: "user_123",
input: { /* ... */ },
});
import { createHotglueTools } from "@hotglue/sdk";
import { Agent } from "@mastra/core/agent";
const hotglueTools = createHotglueTools({ apiKey: "hg_live_xxx" });
const agent = new Agent({
name: "Notion Agent",
model: "anthropic/claude-sonnet-4-0",
tools: () => hotglueTools({
integrations: ["notion"],
userId: "user_123",
}),
});

Authentication Setup #

Create an integration in Notion to get a Client ID and Client Secret for OAuth authentication.

1. Create Integration

  1. Go to notion.so/my-integrations
  2. Click New integration
  3. Enter a name for your integration
  4. Select the workspace to associate with
  5. Click Submit

2. Configure OAuth Settings

In your integration settings, go to Distribution and enable Public integration:

Redirect URIs
https://hotglue.tech/api/auth/callback
Company name
Your company name (users see this)
Website
Your application URL
Privacy policy
Your privacy policy URL
Terms of use
Your terms of use URL

3. Configure Capabilities

Set the capabilities your integration needs under Capabilities:

Content
Read content, Update content, Insert content
Comments
Read comments, Insert comments (optional)
User info
User information with or without email

// Request minimal capabilities needed for your use case.

4. Get OAuth Credentials

OAuth client ID — shown in Secrets section
OAuth client secret — click "Show" to reveal, then copy

// Store these credentials securely — you'll need them for OAuth flow.

Capability Reference

Each capability enables specific actions:

Read content — search, get pages/databases/blocks
Update content — update pages/blocks, archive
Insert content — create pages, append blocks
Read users — list users, get user info

Grant Page Access

After a user authorizes your integration, they must share specific pages or databases with the integration. The integration can only access content explicitly shared with it via the Share menu → Invite → select your integration.

Scopes #

When users connect their Notion account, they'll be asked to grant some of these permissions, depending on which tools you configured for connection:

read_content Read pages, databases, and blocks that have been shared with the integration
update_content Update existing pages, databases, and blocks
insert_content Create new pages and append content to existing pages
read_users Read user information from the workspace