xiaohongshu
xiaohongshu
notion-management
Complete guide for working with Notion API in Node.js/JavaScript projects. Use when creating, updating, fetching, or managing Notion pages, databases, and properties. Includes proper handling of rich text, database schemas, multi-select fields, dates, and complex content structures. Triggers on t...
Full skill instructions
Master working with the Notion API for Node.js/JavaScript development. This skill provides patterns, tools, and references for all common Notion operations.
// Fetch a page or database
const page = await notion_notion-fetch({
id: "page-id-or-url"
});
// Pages return markdown content and properties
// Databases return schema, data sources, and views
// Single page creation
const pages = await notion_notion-create-pages({
pages: [{
properties: {
title: "My Page Title",
// Other properties based on database schema
},
content: "# Markdown content here\n\nSupports rich markdown."
}],
parent: {
data_source_id: "collection-id" // or page_id, or database_id
}
});
// Update properties
await notion_notion-update-page({
page_id: "page-id",
command: "update_properties",
properties: {
title: "Updated Title",
status: "Done"
}
});
// Replace all content
await notion_notion-update-page({
page_id: "page-id",
command: "replace_content",
new_str: "# New content here"
});
// Replace specific section
await notion_notion-update-page({
page_id: "page-id",
command: "replace_content_range",
selection_with_ellipsis: "# Old heading...last paragraph.",
new_str: "# New heading\nNew content"
});
// Insert content after a section
await notion_notion-update-page({
page_id: "page-id",
command: "insert_content_after",
selection_with_ellipsis: "## Section...end of section.",
new_str: "\n## New Section\nNew content here"
});
"__YES__" or "__NO__"// single_select: Just use the option name
properties: {
Status: "In Progress" // Must match exact option name
}
// multi_select: Single string or comma-separated
// ❌ WRONG: ["option1", "option2"] // Don't use arrays
// ❌ WRONG: "option1,option2" // Don't use commas
// ✅ CORRECT: Need to use separate API calls or specific format
// Date properties use expanded format with three keys
properties: {
"date:Due Date:start": "2025-01-30",
"date:Due Date:end": null, // Optional end date
"date:Due Date:is_datetime": 0 // 0 for date, 1 for datetime
}
// Place/location properties use expanded format
properties: {
"place:Office:name": "HQ",
"place:Office:address": "123 Main St",
"place:Office:latitude": 37.7749,
"place:Office:longitude": -122.4194,
"place:Office:google_place_id": "optional-id"
}
Properties named "id" or "url" (case-insensitive) must be prefixed with "userDefined:":
properties: {
"userDefined:id": "value",
"userDefined:URL": "https://example.com"
}
Common mistake: Multi-select fields have strict validation. When creating or updating pages in a database with multi_select properties:
Fetch the database first to see available options:
const db = await notion_notion-fetch({ id: "database-id" });
// Response shows: "Tags": {"options": [{"name": "Option1"}, {"name": "Option2"}]}
Use only valid option names:
properties: {
Tags: "Option1" // Single option as string
}
For multiple options: Currently the API has limitations. Best practice:
Error handling: If you get "Invalid multi_select value", check:
const db = await notion_notion-fetch({
id: "database-id-or-url"
});
// Returns:
// - Database title and icon
// - Data sources (collections) within the database
// - Schema for each data source
// - Views available
const db = await notion_notion-create-database({
title: [{type: "text", text: {content: "My Database"}}],
parent: {page_id: "parent-page-id"},
properties: {
"Task Name": {type: "title"},
"Status": {
type: "select",
select: {
options: [
{name: "To Do", color: "red"},
{name: "In Progress", color: "yellow"},
{name: "Done", color: "green"}
]
}
},
"Due Date": {type: "date"}
}
});
await notion_notion-update-database({
database_id: "db-id",
title: [{type: "text", text: {content: "New Title"}}],
properties: {
"New Property": {type: "rich_text"},
"Property to Rename": {name: "Renamed Property"},
"Property to Delete": null // Set to null to remove
}
});
# H1, ## H2, etc.- item, ordered 1. item`code` and code blocks**bold**, *italic*[text](url)> quoted text▶ Collapsed content\n\tHidden items (Note: indentation with tabs)Toggles are created with the ▶ character followed by content that should be hidden:
▶ Click to expand
Hidden content line 1
Hidden content line 2
- Nested list item
Important: Content after ▶ must be indented with tabs or spaces.
Content can include color and style annotations:
# Heading {color="blue"}
Some text {color="red"} and {bold="true"}
const results = await notion_notion-search({
query: "search term",
query_type: "internal" // or "user" for user search
});
// Filter by creation date
const filtered = await notion_notion-search({
query: "recent docs",
filters: {
created_date_range: {
start_date: "2025-01-01",
end_date: "2025-01-31"
}
}
});
// List teams
const teams = await notion_notion-get-teams({
query: "engineering" // optional search
});
// List users
const users = await notion_notion-get-users({
query: "john", // optional search
page_size: 100
});
// Get specific user
const user = await notion_notion-get-users({
user_id: "user-id-or-self"
});
Cause: Option name doesn't exist or format is wrong Solution:
Cause: Wrong property format or type Solution:
Cause: Wrong ID or insufficient permissions Solution:
Cause: Notion integration doesn't have permission Solution:
data_source_id instead of database_id as parentSee references/advanced-patterns.md for:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience