How to Sync Data into Notion Pages and Databases with Jinba
Summary
- To write to Notion, you need a Notion integration token and must explicitly share each target page or database with the integration; missing connections cause
403 Forbiddenerrors. - The core workflow uses five commands:
NOTION_SEARCHto find IDs,NOTION_CREATE_PAGEorNOTION_CREATE_DATABASE_ITEMto create content,NOTION_APPEND_BLOCK_CHILDRENto add body content, andNOTION_RETRIEVE_A_PAGEto verify. - Use
NOTION_SEARCHto look up pages and databases by title instead of hardcoding IDs, making workflows portable across workspaces. - Common API errors (
400,401,403,404,429) each have a specific cause; checking permissions and payloads before running saves debugging time. - Jinba Flow simplifies these steps by letting you build Notion workflows in natural language or a visual editor, with encrypted credentials and audit logging.
To write workflow output into Notion, use NOTION_CREATE_PAGE for a standard page or NOTION_CREATE_DATABASE_ITEM for a database entry. Both commands require a token (your Notion Internal Integration Token) and a target parent_page_id or database_id. The operation is complete when Notion returns the ID of the newly created page or item, which is available to downstream steps in the same workflow.
The five commands covered here are: NOTION_SEARCH, NOTION_CREATE_PAGE, NOTION_CREATE_DATABASE_ITEM, NOTION_APPEND_BLOCK_CHILDREN, and NOTION_RETRIEVE_A_PAGE.
Prerequisites: Setting Up Your Notion Integration
Any notion automation that writes to Notion requires a Notion integration. The integration acts as the identity that Jinba presents to the Notion API. Without it, no external tool has programmatic access to a workspace.
Step 1: Create a New Notion Integration
- Go to developers.notion.com.
- Click View my integrations, then + New integration.
- Name the integration (for example, "Jinba Workflow Sync") and associate it with the target workspace.
- Under Capabilities, enable Read content, Update content, and Insert content.
- Click Submit.
Step 2: Retrieve and Secure Your Integration Token
After submission, the Secrets tab displays your Internal Integration Token. Click Show, then Copy.
This value is your NOTION_TOKEN. The Notion authorization guide states explicitly that you must never share an installation access token or expose it in client-side code. Store it in Jinba's credentials manager, which keeps secrets encrypted and out of workflow source.
Step 3: Share Your Pages and Databases with the Integration
A Notion integration can only access resources that have been explicitly shared with it. This is the most common cause of 403 Forbidden errors.
For each page or database Jinba will write to:
- Open the page or database in Notion.
- Click the ... menu in the top-right corner.
- Click + Add connections and search for the integration name.
- Select it and confirm.
The integration now has edit access to that resource and all of its children.
The Core Workflow: Five Steps to Syncing Data
Step 1: Find the Target Page or Database with NOTION_SEARCH
Before creating content, the workflow needs the ID of the destination. NOTION_SEARCH queries the workspace by title and returns matching pages and databases, including their IDs.
Using NOTION_SEARCH rather than hardcoding IDs makes the workflow portable. IDs are tied to a specific workspace; a title search works across environments.
Pass the result's id field into the next step as the parent_page_id or database_id.

Step 2: Create a Notion Page with NOTION_CREATE_PAGE
NOTION_CREATE_PAGE creates a new sub-page under an existing page. The minimum required parameters are token, parent_page_id, and a properties object that sets the page title.
The underlying API call follows the Notion create-page endpoint:
curl --request POST \
--url https://api.notion.com/v1/pages \
--header 'Authorization: Bearer <your_notion_token>' \
--header 'Content-Type: application/json' \
--header 'Notion-Version: 2022-06-28' \
--data '{
"parent": { "page_id": "<your_parent_page_id>" },
"properties": {
"title": {
"title": [{ "text": { "content": "Workflow Output – 2025-07-01" } }]
}
}
}'
Or with the Notion JavaScript SDK:
const response = await notion.pages.create({
parent: { page_id: "<your_parent_page_id>" },
properties: {
title: {
title: [{ text: { content: "Workflow Output – 2025-07-01" } }]
}
}
});
The response object contains id, the new page's identifier. Capture it. Every subsequent step in this workflow uses it.
Step 3: Add a Row to a Database with NOTION_CREATE_DATABASE_ITEM
NOTION_CREATE_DATABASE_ITEM adds an entry to an existing database rather than creating a standalone page. The required parameters are token, database_id, and a properties object whose keys match the database's column names exactly.
For a database with columns Name, Status, and Due Date, the properties object must use those exact names. A mismatch returns a 400 Bad Request. Verify column names in the database schema before building the workflow step.
This command is the correct choice when the destination is a structured dataset, such as a task tracker, CRM, or content calendar.
Step 4 (Optional): Add Content with NOTION_APPEND_BLOCK_CHILDREN
Creating a page sets its title. It does not populate the body. To write paragraphs, headings, bullet lists, or any other block content inside the page, use NOTION_APPEND_BLOCK_CHILDREN.
The required parameters are token and block_id, which is the id returned by NOTION_CREATE_PAGE in step 2.
await notion.blocks.children.append({
block_id: response.id,
children: [
{
object: "block",
type: "heading_2",
heading_2: {
rich_text: [{ type: "text", text: { content: "Workflow Summary" } }]
}
},
{
object: "block",
type: "paragraph",
paragraph: {
rich_text: [{ type: "text", text: { content: "Generated automatically by a Jinba workflow." } }]
}
}
]
});
This is how workflows write detailed reports, run logs, or structured summaries directly into Notion without manual input.
Step 5: Verify the Result with NOTION_RETRIEVE_A_PAGE
After writing, use NOTION_RETRIEVE_A_PAGE to read the page back. The required parameters are token and page_id. A successful response confirms the data landed correctly and exposes the full property set for use in later steps.
For databases, NOTION_QUERY_DATA_SOURCE retrieves multiple items matching a filter, which is useful when a downstream step needs to cross-reference existing records before creating new ones.
Why Use Jinba for Notion Automation
Simplifying Complexity with a Workflow Orchestrator
Teams that write directly to the Notion API manage authentication, JSON formatting, error handling, and step sequencing in code. Jinba Flow abstracts those concerns. Operators describe workflows in natural language or build them in a visual editor; Jinba handles the API mechanics. The five commands in this guide map directly to discrete steps that can be chained without writing custom HTTP logic.
This lowers the implementation threshold for teams that have the integration idea but not the engineering bandwidth to build the plumbing from scratch.
Enterprise Security and Audit Logging
Storing a NOTION_TOKEN outside a secrets manager is a credential exposure risk. Jinba's credentials manager stores integration tokens encrypted and injects them at runtime. Credentials are never visible in workflow definitions.
For regulated environments, Jinba logs each workflow execution, providing a complete audit trail of what ran, when, and with what inputs and outputs. This is a concrete compliance requirement for many enterprise teams, not a convenience feature.
Common Errors and How to Avoid Them
Notion's API returns standard HTTP status codes. Understanding them shortens debugging time.
- 400 Bad Request: The JSON payload is malformed or a required property is missing. Compare your
propertiesobject against the Notion API reference field by field. - 401 Unauthorized: The
Authorizationheader is missing or the token is incorrect. Confirm the token matches what was copied from the integration's Secrets tab. - 403 Forbidden: The integration has not been connected to the target page or database. Return to the Notion UI and add the connection as described in the prerequisites.
- 404 Not Found: The
page_idordatabase_iddoes not exist or is formatted incorrectly. UseNOTION_SEARCHto retrieve IDs dynamically rather than typing them manually. - 429 Too Many Requests: The Notion API rate limit has been exceeded. For workflows that create many records, add a delay between iterations or implement exponential backoff on retries.
Three practices reduce the frequency of all five error types:
- Test individual API calls with a tool like Postman before embedding them in a multi-step workflow.
- Use the output of
NOTION_SEARCHto populateparent_page_idanddatabase_idinstead of hardcoding values. - Confirm that the integration has Can edit access on every page and database the workflow touches, including any sub-pages.

Next Steps
Start with the simplest version: a workflow that searches for a parent page, creates a child page with a title, and retrieves it to confirm success. Once that runs cleanly, add NOTION_APPEND_BLOCK_CHILDREN to populate the body, then extend to NOTION_CREATE_DATABASE_ITEM when the destination is a structured database.
- Explore Jinba Flow to build and deploy your first workflow.
- Review the Jinba documentation for full command references and credential setup.
- Consult the Notion API reference for the complete property schema for each endpoint.
Frequently Asked Questions
How do I create a page in Notion using the API?
Use the NOTION_CREATE_PAGE command in Jinba, or make a POST request to https://api.notion.com/v1/pages with your integration token. The page must be created under a parent page or database that your integration can access. After creation, the API returns the new page ID, which you can use for appending content or verification.
This guide walks through the exact parameters needed, including the JSON payload for the Notion API and the equivalent JavaScript SDK call. Remember to set the Notion-Version header to a valid date like 2022-06-28.
What is a Notion integration token and where do I get it?
A Notion integration token is a secret credential that identifies your integration to the Notion API. You create it by visiting developers.notion.com, selecting View my integrations, and creating a new integration. The token appears under the Secrets tab after submission. Store it securely in Jinba's credentials manager and never expose it in client-side code.
Why am I getting a 403 Forbidden error when writing to Notion?
A 403 error means your integration does not have permission to access the target page or database. Notion requires you to explicitly share each resource with the integration. Open the page or database, click the ... menu, select + Add connections, and choose your integration. After connecting, the integration will have edit access and the 403 error should resolve.
What is the difference between NOTION_CREATE_PAGE and NOTION_CREATE_DATABASE_ITEM?
NOTION_CREATE_PAGE creates a standalone page under a parent page, while NOTION_CREATE_DATABASE_ITEM adds a new row to an existing Notion database. Use NOTION_CREATE_PAGE when you need a free-form document, and NOTION_CREATE_DATABASE_ITEM when your data fits a structured schema with columns. Both return an ID that you can use in later steps.
How do I append content blocks to a Notion page?
After creating a page with NOTION_CREATE_PAGE, use the NOTION_APPEND_BLOCK_CHILDREN command to add paragraphs, headings, lists, and other block content. Pass the block_id (the page ID returned from creation) and an array of block objects. The article includes a JavaScript example that appends a heading and a paragraph.
What is Jinba Flow and how does it simplify Notion automation?
Jinba Flow is a workflow orchestrator that lets you describe automation tasks in natural language or a visual editor instead of writing raw API calls. It handles authentication, JSON formatting, error handling, and step sequencing for you. The five commands covered in this guide map directly to Jinba workflow steps, so you can chain them without custom HTTP logic.
How can I avoid hardcoding Notion page IDs in my workflow?
Use the NOTION_SEARCH command to look up pages and databases by title at runtime. This returns the current ID, making your workflow portable across workspaces and environments. Hardcoding IDs can break if a page is moved, duplicated, or if you switch workspaces.
What rate limits apply to the Notion API?
Notion applies rate limits to API requests. When you exceed them, you receive a 429 Too Many Requests error. The article recommends adding delays between iterations or implementing exponential backoff for workflows that create many records. Also test individual calls before running high-volume workflows.