Notion Integration Guide
What is Notion for developers?
new Client({ auth, notionVersion: '2026-03-11' }) → dataSources.query → pages.create({ markdown }).
Use @notionhq/client 5.27.1, and pin the version yourself: the SDK still defaults to 2025-09-03. 2026-03-11 renames archived to in_trash, replaces the append 'after' string with position { after_block | start | end }, and renames transcription blocks to meeting_notes. A single query stops at 10,000 rows, so use collectAllDataSourceRows. Rate limits are 180 req/min per connection (600 on Business/Enterprise) plus a per-workspace budget shared by every connection. Honor Retry-After, and treat a 503 on a write as 'maybe saved'. Verify webhooks with verifyWebhookSignature() over the raw body. Multi-member Free workspaces hit a 1,000-block limit through the API. For codeAmani, Notion is the PM hub only: tokens stay server-side, and no customer PII or M-Pesa data goes on synced pages.
Five Notion primitives
Pick the surface first: hosted MCP for Claude, the SDK for code, webhooks to react.
███╗ ██╗ ██████╗ ████████╗██╗ ██████╗ ███╗ ██╗
████╗ ██║██╔═══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║
██╔██╗ ██║██║ ██║ ██║ ██║██║ ██║██╔██╗ ██║
██║╚██╗██║██║ ██║ ██║ ██║██║ ██║██║╚██╗██║
██║ ╚████║╚██████╔╝ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝Notion Integration Guide
Focus: Automating documentation, project management, and knowledge-base workflows from Claude Code with the hosted Notion MCP and the Notion REST API (
@notionhq/client).
Overview
Notion is an all-in-one workspace for docs, databases, wikis, and project management. It now has five developer surfaces, and picking the right one saves a lot of work:
| Surface | What it is | Use it for |
|---|---|---|
| Notion MCP (hosted) | Remote MCP server at https://mcp.notion.com/mcp, OAuth, Markdown-native tools | Driving Notion conversationally from Claude Code, Cursor, Codex |
REST API (@notionhq/client, notion-client) | https://api.notion.com/v1, versioned by the Notion-Version header | App code, CI scripts, Claude Code hooks |
| Webhooks | Signed HTTP POSTs when pages, data sources, comments, views or file uploads change | Reacting to workspace changes without polling |
| Notion Workers (beta) | Notion-hosted TypeScript programs (@notionhq/workers, deployed with the ntn CLI) | Scheduled syncs into Notion, tools for Custom Agents, inbound webhooks |
| Notion Agent APIs (public beta) | Sessions/agents endpoints for Custom Agents | Bringing a Custom Agent into Slack, an internal tool, or a mobile client |
Terminology changed in 2026. Notion's docs now say connection where they used to say integration: an internal connection (one workspace, static
ntn_…token, acts as its own bot), a public connection (OAuth, installs into many workspaces), and the new personal access token (PAT, acts as you). You manage all of them in the Developer portal (https://app.notion.com/developers; the oldnotion.so/profile/integrationslinks redirect there).
Versions at a glance (verified 2026-10-20)
| Thing | Current | Notes |
|---|---|---|
Latest Notion-Version header | 2026-03-11 | Required on every REST request. Breaking changes vs 2025-09-03: archived→in_trash, append after→position, transcription block→meeting_notes |
| Data-source model | since 2025-09-03 | A database is a container of one or more data sources |
@notionhq/client (npm) | 5.27.1 (2026-10-16) | Supports 2026-03-11 since 5.12.0, but its default is still 2025-09-03, so set notionVersion explicitly. Node ≥ 18 |
notion-client (PyPI) | 3.1.0 (2026-05-12) | Data-source model; default version 2025-09-03 |
@notionhq/notion-mcp-server (npm) | 2.5.2 | No longer actively maintained; use the hosted MCP |
ntn (Notion CLI, npm) | 0.23.20 | Workers, ntn api … requests, file uploads. Node 22+ for the npm install |
@notionhq/workers (npm) | 0.9.3 | Workers runtime library (beta) |
Official Documentation
MCP Server Setup
Option A — Hosted Notion MCP (recommended)
claude mcp add --transport http notion https://mcp.notion.com/mcpThen run /mcp inside Claude Code and finish the OAuth flow. Add --scope project to share it through .mcp.json (see examples/mcp-config.json), or --scope user for every project. Notion also ships a Claude Code plugin (makenotion/claude-code-notion-plugin) that bundles the server, Skills, and slash commands.
What you get, compared with the REST API:
- Markdown-native tools.
notion-fetchreads pages, databases, and views.notion-create-pagesandnotion-update-pagewrite enhanced Markdown.update_contentbatches are atomic as of 2026-08-25, and partial misses returnwarningssince 2026-10-16. - Search split (2026-09-02).
notion-searchis keyword search (plus user lookup).notion-ai-searchis semantic search across Notion and connected apps (Slack, Drive, Jira…) and needs Notion AI. Callnotion-get-tool-accessto see which tools and parameters the workspace plan allows. - Data.
notion-query-data-sourcesruns SQL over one data source on any plan, within a metered allowance. Multi-source SQL is unlimited on Business/Enterprise with Notion AI, andmode: "view"queries a saved view for free. Also:notion-create-database,notion-update-data-source,notion-create-view/notion-update-view. - Custom Agents and Skills. Session tools (
notion-spawn-session,notion-send-message-to-session,notion-wait-session…) and Notion Skills (notion-create-pageswithis_skill: true,notion-download-skill). - Tokens and limits. Access tokens last about 8 hours (since 2026-07-14). The hosted MCP uses the standard API rate limits. It retries a 429 once if the wait is ≤ 2 s; otherwise it returns a
rate_limitedtool error withretry_after_seconds. - Admin control. Workspace owners control which MCP clients may connect under Settings → Notion MCP. Allow-listing clients needs Enterprise.
Option B — Open-source local server (legacy)
@notionhq/notion-mcp-server (v2.x, API 2025-09-03, hyphenated tool names such as query-data-source) still installs. Notion says it is no longer actively maintained and may be sunset. Use it only when you need bearer-token auth for fully headless automation, with the token kept in the environment (never in a committed file):
claude mcp add notion-local -- npx -y @notionhq/notion-mcp-server # reads NOTION_TOKEN from the envFor headless automation, a small script on @notionhq/client is usually the better choice.
Authentication — pick the right credential
| Credential | Acts as | Page access | Best for |
|---|---|---|---|
Internal connection token (ntn_…) | Its own bot user | Only pages shared with the connection (••• → Connections, or the portal's Content access tab) | Team-owned automations, CI, server jobs |
| Personal access token (PAT) | You | Everything you can access | Local scripts, the ntn CLI, Workers, Agent APIs. Expires after 7/30/90/180 days or 1 year (default). Not for multi-user products |
| Public connection (OAuth 2.0) | The authorizing user | Pages picked in the OAuth page picker | Products that many Notion workspaces install |
How public-connection OAuth works:
- Send users to the authorization URL from the portal.
- Exchange the
codeatPOST https://api.notion.com/v1/oauth/tokenwith HTTP Basic auth (client_id:client_secret) andgrant_type: "authorization_code". You get anaccess_tokenand arefresh_token. - Refresh with
grant_type: "refresh_token".
Since 2026-06-08, new public connections mint a fresh token pair on every authorization, so store the pair from every response. The SDK wraps this flow as notion.oauth.token(...), oauth.introspect, and oauth.revoke.
Installation scope is fixed when you create the connection: Any workspace (can be listed on the Marketplace) or Selected workspaces only.
REST API with @notionhq/client
npm install @notionhq/client@5.27.1import { Client, isFullPage, collectAllDataSourceRows } from "@notionhq/client";
// Pin the latest API version: the SDK default is still 2025-09-03.
const notion = new Client({ auth: process.env.NOTION_TOKEN, notionVersion: "2026-03-11" });
// 1. Resolve the data source inside a database (single-source DBs use [0]).
const db = await notion.databases.retrieve({ database_id: process.env.NOTION_TASKS_DB_ID! });
if (!("data_sources" in db)) throw new Error("partial database response");
const dataSourceId = db.data_sources[0].id;
// 2. Query one page of rows (max page_size 100).
const res = await notion.dataSources.query({
data_source_id: dataSourceId,
filter: { property: "Status", status: { equals: "In progress" } },
sorts: [{ property: "Due Date", direction: "ascending" }],
page_size: 100,
});
const open = res.results.filter(isFullPage);
// 3. Every row, including past the 10,000-result cap of a single query.
const allRows = await collectAllDataSourceRows(notion, { data_source_id: dataSourceId });
// 4. Create a row with a Markdown body.
const page = await notion.pages.create({
parent: { type: "data_source_id", data_source_id: dataSourceId },
properties: {
Name: { title: [{ text: { content: "Fix auth middleware" } }] },
Status: { status: { name: "Not started" } },
"Due Date": { date: { start: "2026-10-31" } },
},
markdown: "## Notes\n\nUse RS256 signing.",
});
// 5. Insert blocks at the top (2026-03-11: `position` replaces `after`).
await notion.blocks.children.append({
block_id: page.id,
position: { type: "start" },
children: [
{ object: "block", type: "callout", callout: { rich_text: [{ type: "text", text: { content: "Auto-created" } }] } },
],
});
// 6. Trash it (2026-03-11: `in_trash` replaces `archived`).
await notion.pages.update({ page_id: page.id, in_trash: true });
console.log(open.length, allRows.length);The full runnable version is examples/client.ts.
What else the API covers now
| Area | SDK method / endpoint | Since |
|---|---|---|
| Markdown page content | pages.retrieveMarkdown, pages.updateMarkdown (insert_content, update_content, replace_content, replace_content_range), pages.create({ markdown }) | Feb–Mar 2026. The markdown_version: "v2" Notion-flavored Markdown preview (2026-09-30) is not yet typed in 5.27.1 |
| Async large writes | allow_async: true + asyncTasks.retrieve({ task_id }) | 2026-06-29 / SDK 5.23.0 |
| Views | views.create/retrieve/update/delete/list, views.queries.* | 2026-03-19 (needs 2025-09-03+) |
| Typed databases | databases.create({ database_type: "tasks" | "projects" | "skills" }) | 2026-09-02 |
| Trash and archive | search with filter.in_trash; dataSources.query({ is_archived: true }) | 2026-07-15 |
| Trim responses | filter_properties on pages.create/pages.update and search | 2026-08 / 2026-10 |
| Meeting notes | blocks.meetingNotes.create, query meeting notes | 2026-05 / 5.24.0 |
| Comments | create, list, update, delete (with a markdown body) | 2026-04 |
| Custom Agents (beta) | agents.*, sessions.* (stream, cancel, events) | 2026-08-20 |
Python
pip install notion-client==3.1.0from notion_client import Client
import os
notion = Client(auth=os.environ["NOTION_TOKEN"], notion_version="2026-03-11")
db = notion.databases.retrieve(database_id=os.environ["NOTION_TASKS_DB_ID"])
data_source_id = db["data_sources"][0]["id"]
results = notion.data_sources.query(
data_source_id=data_source_id,
filter={"property": "Status", "status": {"equals": "Done"}},
)
for page in results["results"]:
print(page["id"])Pagination and the 10,000-row cap
Every list or query endpoint returns results, has_more, and next_cursor. Send start_cursor and page_size (max 100). Pass next_cursor back verbatim; cursors are opaque. The SDK has two families of helpers:
| Helper | Use |
|---|---|
iteratePaginatedAPI(fn, args) / collectPaginatedAPI(fn, args) | Any paginated method (search, blocks.children.list, users.list, comments.list, dataSources.query) |
iterateAllDataSourceRows(notion, args) / collectAllDataSourceRows(notion, args) | Data sources that may exceed 10,000 rows. A single query stops there even with paging; these helpers window by created_time and de-duplicate (SDK ≥ 5.23.0) |
import { Client, iteratePaginatedAPI, iterateAllDataSourceRows } from "@notionhq/client";
const notion = new Client({ auth: process.env.NOTION_TOKEN, notionVersion: "2026-03-11" });
for await (const block of iteratePaginatedAPI(notion.blocks.children.list, {
block_id: process.env.NOTION_DOCS_PAGE_ID!,
})) {
console.log(block.id);
}
for await (const row of iterateAllDataSourceRows(notion, {
data_source_id: process.env.NOTION_DATA_SOURCE_ID!,
})) {
console.log(row.id);
}Rate limits and size limits
| Limit | Value (2026-10-20) |
|---|---|
| Per connection | 180 requests/min (about 3/s) on Free and Plus; 600 requests/min (about 10/s) on Business and Enterprise. Fixed 60 s window, burstable. Retry-After is 60 s or less |
| Per workspace | Shared by all of the workspace's connections and scaled to the plan; Retry-After can exceed a minute |
| Per endpoint | Some endpoints have their own limit (rate_limit_reason: public_api_endpoint_rate_limit) |
| Payload | 1,000 block elements and 500 KB per request; arrays of 100 elements; rich-text content 2,000 chars; URL 2,000; relation/people/multi-select 100 per request |
How 429s work:
- A 429 (
rate_limited) or 529 (service_overload) includesRetry-Afterand repeats it in the body asadditional_data.retry_after. additional_data.rate_limit_reasonsays which limit you hit. Never retrypublic_api_request_blocked.- The SDK retries 429/529 on every method and 500/503 on GET/DELETE (never 502/504), honoring
Retry-Afterup to 60 s. Configure it withretry: { maxRetries, initialRetryDelayMs, maxRetryDelayMs }or turn it off withretry: false.
Writes that time out. A 503 can mean the write was saved. Read
additional_data.retry_guidanceandcommitted_resource_idbefore you retry. Markdown page writes return 504gateway_timeoutinstead, and that doesn't mean the write was undone either.
Free-plan block limit through the API (from September 2026). Free workspaces with 2 or more members have a lifetime limit of 1,000 blocks. After the 3-day grace period ends, any API write that creates blocks returns 403
restricted_resourcewithadditional_data.block_limit: "block_creation". The limit applies to internal connections and selected-workspace OAuth connections, but not to PATs or any-workspace OAuth. Retrying won't help; the workspace has to upgrade.
File uploads
| Mode | When | Steps |
|---|---|---|
single_part (default) | ≤ 20 MiB | fileUploads.create → fileUploads.send({ file }) → attach |
multi_part | > 20 MiB (paid workspaces) | create({ mode: "multi_part", number_of_parts, filename }) → send each 5–20 MiB part with part_number (10 MiB recommended; the last part can be smaller) → complete → attach |
external_url | File already at a public HTTPS URL | create({ mode: "external_url", external_url, filename }) → poll retrieve until uploaded |
- Size: 5 MiB per file on Free, 5 GiB on paid workspaces. Read the exact limit from
users.me()→bot.workspace_limits.max_file_upload_size_in_bytes. - Expiry: attach within 1 hour or the upload expires. You can attach one upload id many times.
- Targets:
image/file/pdf/audio/videoblocks,embed(an uploaded.htmlfile becomes an interactive HTML block),filesproperties, and pageicon/cover. - Formats: CAD and 3D files (
.dwg,.step,.stl,.glb…) are accepted as of 2026-09-22. A file labeledapplication/octet-streamgets its type from the filename extension. - Webhook events:
file_upload.created,.completed,.expired,.upload_failed.
See examples/file-upload.ts (type-checked against 5.27.1).
Webhooks (with signature verification)
- In the Developer portal, open your connection → Webhooks → Create a subscription. Enter a public HTTPS URL (ngrok or a preview deploy in development) and choose the event types. Pick the subscription API version;
2026-03-11payloads are identical to2025-09-03. - Notion POSTs a one-time
{ "verification_token": "…" }. Paste it into Verify in the portal and store it as a secret. - Every event carries
X-Notion-Signature: sha256=<hex>, an HMAC-SHA256 of the raw body keyed with that token. Verify it before doing anything else:
import { verifyWebhookSignature } from "@notionhq/client"; // SDK >= 5.23.0
export async function POST(request: Request): Promise<Response> {
const rawBody = await request.text(); // raw bytes, not re-serialized JSON
const ok = await verifyWebhookSignature({
body: rawBody,
signature: request.headers.get("x-notion-signature"),
verificationToken: process.env.NOTION_WEBHOOK_VERIFICATION_TOKEN!,
});
if (!ok) return new Response("invalid signature", { status: 401 });
// enqueue JSON.parse(rawBody), then return quickly
return new Response(null, { status: 200 });
}signWebhookPayload() generates signatures for tests. The helper works on Node 18+, Bun, Deno, Cloudflare Workers, and Vercel Edge. The full handler, including the handshake, is in examples/webhook-route.ts.
Event families:
page.*: created, content_updated, properties_updated, moved, deleted, undeleted, locked, unlockeddata_source.*: created, content_updated, schema_updated, moved, deleted, undeleteddatabase.*:database.content_updatedanddatabase.schema_updatedare deprecated in2025-09-03+comment.*,view.*,file_upload.*
Delivery rules:
- Events are signals, not snapshots: re-fetch the entity.
- Delivery is at-most-once, with up to 8 retries over about 24 h.
- Events can arrive out of order; sort by
timestamp. - High-frequency types are aggregated (usually under a minute late). Every event should arrive within 5 minutes.
Notion AI, Custom Agents, Workers — what matters to developers
- Notion Agent APIs (public beta, 2026-08-20). Chat with a Custom Agent through sessions (
sessions.updateto start or send a message,sessions.stream,sessions.queryEvents,sessions.cancel) and manage agents (agents.query,retrieveInsights,updateStatus,updateCreditLimit,batch). Authenticate with a PAT (acts as you) or a connection token with the View sessions and interact with agents capability. The private alpha routes had to be migrated by 2026-09-30. - Notion Workers (beta, Business+). Run
ntn workers new, writeworker.sync(...),worker.tool(...), orworker.webhook(...)insrc/index.ts, thenntn workers deploy. Syncs run every 30 minutes by default. Default per-workspace limits: 600 tool/webhook runs per hour (60/min burst), 600 sync runs per hour, 100 deploys per day. - Notion CLI
ntn. Install withcurl -fsSL https://ntn.dev | bash,npm i -g ntn, orwinget install Notion.ntn. Runntn login, thenntn api v1/usersfor quick authenticated requests. - Notion Skills. Reusable instruction pages that MCP clients can create, fetch, and download as
SKILL.mdarchives.
Pricing (API-relevant, notion.com/pricing, 2026-10-20)
| Plan | Price | What matters for the API |
|---|---|---|
| Free | $0 | Public API and webhooks included. 180 req/min per connection. 1,000-block lifetime limit for 2+ member workspaces, enforced through the API. 5 MB file uploads |
| Plus | $10 per seat/month | Unlimited blocks; uploads up to about 5 GB; Notion AI trial only; 180 req/min |
| Business | $20 per seat/month | 600 req/min; Notion Agent, Custom Agents, Workers (beta), Enterprise Search (beta); 1,500 Standard + 500 Select AI credits per seat per month; multi-source SQL in MCP |
| Enterprise | Custom | Everything in Business plus zero data retention with LLM providers, SCIM, audit log/SIEM, Admin API, MCP client allow-listing |
Extra AI usage is bought as Notion credits. The pricing page lists per-seat monthly prices but doesn't say whether they're annual-billing rates, so confirm in checkout before you quote a customer.
Environment Variables
Secrets (store in the vault / .env.local, server-side only):
NOTION_TOKEN=ntn_... # internal connection token or PAT
NOTION_WEBHOOK_VERIFICATION_TOKEN=secret_... # from the webhook verification handshake
NOTION_OAUTH_CLIENT_SECRET=... # public connections onlyNon-secret settings (plain config):
| Variable | Purpose |
|---|---|
NOTION_OAUTH_CLIENT_ID | Public connection client ID |
NOTION_OAUTH_REDIRECT_URI | OAuth redirect (HTTPS) |
NOTION_TASKS_DB_ID | Task tracker database ID (container) |
NOTION_DATA_SOURCE_ID | Data source inside that database (query/create target) |
NOTION_DOCS_PAGE_ID | Docs root page |
NOTION_CHANGELOG_PAGE_ID | Changelog page used by the hook below |
NOTION_SPRINT_DB_ID | Sprint planning database |
Take IDs from id fields, not from URLs. Record links moved from www.notion.so/{id} to app.notion.com/p/{id} in June 2026, and Notion says the format may change again.
Automation Workflows
Claude Code hook: append feat: commits to a changelog page
.claude/settings.json:
{
"hooks": {
"Stop": [
{ "hooks": [{ "type": "command", "command": "node scripts/notion-update-docs.mjs" }] }
]
}
}scripts/notion-update-docs.mjs:
import { Client } from "@notionhq/client";
import { execFileSync } from "node:child_process";
const notion = new Client({ auth: process.env.NOTION_TOKEN, notionVersion: "2026-03-11" });
const commitMsg = execFileSync("git", ["log", "-1", "--pretty=%B"]).toString().trim();
if (!commitMsg.startsWith("feat:")) process.exit(0);
await notion.pages.updateMarkdown({
page_id: process.env.NOTION_CHANGELOG_PAGE_ID,
type: "insert_content",
insert_content: {
content: `- [${new Date().toISOString().slice(0, 10)}] ${commitMsg}\n`,
position: { type: "start" },
},
});Slash command: create a task
.claude/commands/notion-task.md:
Create a new task in the Notion tasks data source for: $ARGUMENTS
Use the Notion MCP (notion-create-pages) with:
- Name: $ARGUMENTS
- Status: Not started
- Priority: Medium
- Source: "Claude Code"
Report the URL of the created Notion page.CI: record a release on deploy
# .github/workflows/notion-update.yml
name: Update Notion on Deploy
on:
workflow_run:
workflows: ["Deploy to Production"]
types: [completed]
jobs:
update-notion:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/setup-node@v4 # pin to a full commit SHA in real workflows
with: { node-version: '22' }
- run: npm install @notionhq/client@5.27.1
- name: Update Notion
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_SPRINT_DB_ID: ${{ vars.NOTION_SPRINT_DB_ID }}
SHA: ${{ github.sha }}
run: |
node --input-type=module -e "
import { Client } from '@notionhq/client';
const notion = new Client({ auth: process.env.NOTION_TOKEN, notionVersion: '2026-03-11' });
const db = await notion.databases.retrieve({ database_id: process.env.NOTION_SPRINT_DB_ID });
await notion.pages.create({
parent: { type: 'data_source_id', data_source_id: db.data_sources[0].id },
properties: {
Name: { title: [{ text: { content: 'Deployed: ' + process.env.SHA } }] },
Date: { date: { start: new Date().toISOString().slice(0, 10) } },
},
});
"Common Use Cases
| Use case | Approach |
|---|---|
| Task tracking | MCP notion-create-pages into the tasks data source |
| Sprint review | MCP notion-query-data-sources (mode: "view" on a saved view is free on every plan) |
| Auto-changelog | Hook → pages.updateMarkdown insert_content |
| Knowledge-base search | MCP notion-ai-search (Notion AI) or notion-search (keyword) |
| React to edits | Webhook subscription → verify → queue → re-fetch |
| Import assets | File Upload API (external_url for migrations) |
| Pull external data into Notion | Notion Worker sync (beta) |
Troubleshooting
| Issue | Fix |
|---|---|
401 unauthorized | Bad or expired token. PATs expire, and admins can revoke them or change the PAT policy |
404 object_not_found | Internal connection not shared with the page (••• → Connections or the portal's Content access) |
databases.query is not a function | SDK v5: use dataSources.query({ data_source_id }) |
archived / after ignored or rejected | You're on 2026-03-11: use in_trash, and position: { type: "after_block", after_block: { id } }. The SDK logs a warning for unknown params |
| Only 10,000 rows come back | Use collectAllDataSourceRows / iterateAllDataSourceRows |
403 restricted_resource with block_limit | Free multi-member workspace is out of blocks. Upgrade; retrying won't help |
429 rate_limited | Honor Retry-After / additional_data.retry_after; check rate_limit_reason (workspace-shared vs per-connection) |
| 503 on a write | Check additional_data.retry_guidance / committed_resource_id; the write may already be saved |
| Webhook signature never matches | Verify the raw body, not JSON.stringify(await req.json()) |
Formula or rollup is type: "unsupported" | Too many related pages or nested formulas; treat the value as unavailable |
codeAmani notes
- Role. Notion is the docs and PM hub (sprints, specs, changelogs, meeting notes). Claude Code drives it through the hosted MCP; scripts and CI use
@notionhq/clientpinned to2026-03-11. - Credentials. Server-side only, stored in the vault, never in client bundles. Use an internal connection for team-owned automation (CI, hooks) so access never depends on one person, a PAT for personal scripts and the
ntnCLI, and public OAuth only if we ship a Notion-installable product. - Webhooks. Always verify
X-Notion-SignaturewithverifyWebhookSignature()before processing (same rule as Stripe, Svix, and M-Pesa callbacks). Use ngrok or a Vercel preview URL in development. - AI routing. Notion AI and Custom Agents are workspace features, not our model layer. Product AI stays on Claude (primary) → OpenAI → HuggingFace per
AI_WORKFLOWS.md. The Notion Agent APIs are fine for internal tooling. - Payments. None in Notion. Stripe is the default rail; M-Pesa/Daraja only for Kenya-targeted projects. Never put card or M-Pesa transaction data on Notion pages.
- Plan. The Business plan's 600 req/min and Workers matter if we run heavy syncs. On Free/Plus, budget about 3 req/s per connection, shared with every other connection in the workspace.
- African market / compliance. Keep customer PII and M-Pesa phone numbers off pages that sync to external tools or Notion AI (KDPA 2019 for Kenya-targeted projects; see
COMPLIANCE_GUIDE.md). Only Enterprise gets zero data retention with Notion's LLM providers.