Skip to content
Back to skills

Notion

ASecurity

> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18 > **Official Docs:** https://developers.notion.com/reference/intro

  • 13 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsbashgitapidatabasesecurity

Works with

  • cursor
  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add ashish7802/awesome-api-skills --skill notion --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Notion?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Notion
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashish7802-notion/badge)](https://www.skillsdirectory.com/skills/ashish7802-notion)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Notion API & SDK Skill

> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18  
> **Official Docs:** https://developers.notion.com/reference/intro

## Overview
The Notion API enables programmatic reading and writing of workspace pages, databases (data sources), rich-text blocks, comments, and users via `@notionhq/client`.

## Installation
```bash
npm install @notionhq/client
pip install notion-client
```

## Authentication
Authenticate using an Internal Integration Token (`NOTION_API_KEY`, sent as `Authorization: Bearer <token>`) or OAuth 2.0 public integration tokens. Always pass the `Notion-Version` header (handled automatically by `@notionhq/client`). Remember: **an integration can only access pages/databases explicitly shared with it** via the page's Connections menu.

## Core Concepts
- **Cursor Pagination**: List endpoints (`databases.query`, `blocks.children.list`, `search`) return up to 100 items with `has_more` and `next_cursor`. Always loop until `has_more === false`.
- **Blocks Tree**: Page content is stored as nested child blocks; reading full page text requires traversing `blocks.children.list` recursively for blocks where `has_children === true`.
- **Rate Limits**: Average sustained limit is **3 requests per second per integration** (with short bursts). HTTP `429` responses include a `Retry-After` header in seconds.

## Error Handling & Rate Limits
- Check `isNotionClientError(err)` and inspect `err.code` (`APIErrorCode.RateLimited`, `ObjectNotFound`, `ConflictError`).
- Respect `Retry-After` on HTTP `429` and throttle concurrent sync jobs to <= 3 RPS.

## Security Best Practices
- Grant integrations minimum required capabilities (e.g., Read Content only for static site generators).
- Never expose `NOTION_API_KEY` in browser code.

## AI Pitfalls
- Assuming an integration token automatically has workspace-wide access (produces `404 object_not_found` until shared with the integration).
- Ignoring `has_more` / `next_cursor`, silently truncating results at 100 items.
- Firing `Promise.all()` across hundreds of pages without concurrency throttling, immediately triggering HTTP `429`.

## Production Checklist
- [ ] `NOTION_API_KEY` stored in server-side env vars with least-privilege capabilities
- [ ] All list/query calls paginate via `has_more` + `next_cursor`
- [ ] Concurrency queue caps throughput around 3 req/sec and honors `Retry-After`
- [ ] `object_not_found` errors handled with clear sharing diagnostics

## References
- [Notion API Reference](https://developers.notion.com/reference/intro)
- [Notion Request Limits](https://developers.notion.com/reference/request-limits)

## Related skills
- [`linear`](../linear/SKILL.md) — works well with
- [`slack`](../slack/SKILL.md) — works well with
- [`github`](../github/SKILL.md) — works well with

Files in this skill

  • SKILL.md2.8 KB
  • examples/quickstart.ts824 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.