Notion
Create, update, and query pages, databases, and blocks in Notion workspaces.
Authentication
| Type | Default | Details |
|---|---|---|
api_key | ✅ | Internal Integration Token |
oauth_2 | Public integration OAuth flow |
Notion requires the Notion-Version: 2022-06-28 header on every request. The plugin sets this automatically.
Endpoints
| Path | Risk | Description |
|---|---|---|
pages.get | read | Retrieve a page. |
pages.create | write | Create a page. |
pages.update | write | Update a page (archived:true soft-deletes). |
databases.get | read | Retrieve a database. |
databases.query | read | Query a database. |
blocks.children.list | read | List children of a block. |
blocks.children.append | write | Append children to a block. |
blocks.delete | destructive | Delete a block (recoverable from trash). |
search | read | Search pages and databases. |
pages.get
Retrieve a page by ID.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
page_id | string | ✅ | Page UUID |
Output: NotionPage
pages.create
Create a new page as a child of a database or another page.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
parent | object | ✅ | { database_id?: string; page_id?: string } |
properties | object | ✅ | Page properties keyed by property name |
children | array | Initial block children |
Output: NotionPage
pages.update
Update page properties or archive a page.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
page_id | string | ✅ | Page UUID |
properties | object | Properties to update | |
archived | boolean | Set true to archive (soft-delete) |
Output: NotionPage
databases.get
Get a database's schema and metadata.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
database_id | string | ✅ | Database UUID |
Output: NotionDatabase
databases.query
Query a database with filters, sorts, and pagination.
Input:
| Field | Type | Description |
|---|---|---|
database_id | string | ✅ Database UUID |
filter | object | Notion filter object |
sorts | array | Sort configurations |
page_size | number | Max results per page |
start_cursor | string | Pagination cursor |
Output: { results: NotionPage[]; next_cursor: string | null; has_more: boolean }
blocks.children.list
List the children blocks of a page or block.
Input:
| Field | Type | Description |
|---|---|---|
block_id | string | ✅ Block/page UUID |
start_cursor | string | Pagination cursor |
page_size | number | Max results |
Output: { results: NotionBlock[]; next_cursor: string | null; has_more: boolean }
blocks.children.append
Append new blocks to a parent block.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
block_id | string | ✅ | Parent block/page UUID |
children | array | ✅ | Block objects to append |
Output: { results: NotionBlock[] }
blocks.delete
Delete a block.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
block_id | string | ✅ | Block UUID |
Output: NotionBlock
search
Search pages and databases by title.
Input:
| Field | Type | Description |
|---|---|---|
query | string | Search text |
page_size | number | Max results |
start_cursor | string | Pagination cursor |
filter | object | { value: "page" | "database"; property: "object" } |
Output: { results: Array<NotionPage \| NotionDatabase>; next_cursor: string | null; has_more: boolean }
Usage
import { createFabric } from "@fabricorg/integrations";
import { notion } from "@fabricorg/integrations/plugins";
const fabric = createFabric({
plugins: [notion({ apiKey: process.env.NOTION_API_KEY })],
});
// Create a page in a database
const page = await fabric.notion.api.pages.create({
parent: { database_id: "a1b2c3d4-..." },
properties: {
Name: { title: [{ text: { content: "New Task" } }] },
Status: { select: { name: "In Progress" } },
},
});
// Query a database
const { results } = await fabric.notion.api.databases.query({
database_id: "a1b2c3d4-...",
filter: { property: "Status", select: { equals: "Done" } },
});Webhooks
Notion webhooks are not yet implemented in this plugin.
Types
interface NotionPage {
object: "page";
id: string;
created_time: string;
last_edited_time: string;
archived: boolean;
url: string;
properties: Record<string, unknown>;
parent?: { type: string; database_id?: string; page_id?: string };
}
interface NotionDatabase {
object: "database";
id: string;
created_time: string;
last_edited_time: string;
url: string;
title: unknown[];
properties: Record<string, unknown>;
}
interface NotionBlock {
object: "block";
id: string;
type: string;
created_time: string;
last_edited_time: string;
archived: boolean;
has_children: boolean;
}