How to Use Notion's API for Custom Automation: Webhooks, Polling and Limits
Set up the Notion API for custom automation: create an integration, share pages, subscribe webhooks, poll as a safety net and design around rate limits.

To use Notion's API for custom automation, create an integration, share the target pages or databases with it, subscribe a webhook to the events you care about, and call the API to fetch what changed. Webhooks are the trigger and a scheduled poll is the safety net. Plan every call against a ceiling of about three requests per second per connection.
Major fits at the point where a script stops being enough. An agent works out once how a Notion page becomes work in another system, then builds an app with its own database that runs the repeatable steps. The model is called only for the judgment. If your need is "set a status and ping a channel", Notion's built-in database automations are enough, and the next section shows where they run out.
What Notion's built-in automations cover before you reach for the API
Database automations trigger on four things: a page added, a property edited, a recurring schedule, or a button click. Actions include editing a property, adding or editing pages in another database, notifying people, sending mail, posting to Slack, and sending a webhook. Notion's database automations documentation lists them all.
Four gaps send teams to the API.
- No lookups. A rule cannot check whether a matching record exists and behave differently.
- No branching. A condition decides whether the rule runs. After that it does the one configured thing.
- No usable response. Send webhook posts to a URL and nothing comes back.
- No memory. Rules cannot trigger other rules, and a rule that errors pauses itself until someone reactivates it.
The last gap is the one the API does not close on its own. You have to build the memory yourself.
How to set up the Notion API for custom automation
The setup is short. Create an internal integration in your workspace, copy its token, and share each page or database with the integration, because it sees nothing by default. Send the Notion-Version header on every request and pin it so a version change never surprises you.
Then pick a trigger. Custom automation scenarios cluster into three shapes: react to a change, run on a schedule, or answer a question on demand. The first needs events. The second needs a clock. The third needs search and read calls. Most useful builds combine the first two.
Notion API polling vs webhook: which trigger to use
Use webhooks as the primary trigger and polling as a sweep. Polling a database every few minutes spends your request budget on pages that did not change, and it hides latency behind the interval you chose.
Notion supports webhook subscriptions for events including page.content_updated, comment.created, page.locked, and data_source.schema_updated, per Notion's webhook reference. Four caveats shape the build.
- The endpoint must be publicly reachable over SSL, so localhost receives nothing.
- Activation means catching a one-time POST with a
verification_tokenand pasting it back into the connection settings. - The payload carries metadata only: entity ID, event type, timestamp. You call the API to learn what changed.
page.content_updatedevents are aggregated and can lag a minute or two.
That lag is why a daily or hourly poll still earns a place. It catches anything the aggregated events missed, and it is cheap when the poll compares timestamps before it reads any content.
Notion API rate limits that decide your design
Notion allows an average of three requests per second per connection, with limited bursts. A second per-workspace limit scales with the plan and is not quantified. Exceeding either returns HTTP 429 with a Retry-After header, and heavy load can return 529 service_overload. Honor Retry-After exactly and add jitter, because several workers retrying together re-trigger the limit.
One spec page with nested toggles can take six paginated calls to read, so the budget disappears fast. A few more constraints to design around.
- Request payloads cap at 500 KB and 1,000 block elements.
text.contentcaps at 2,000 characters.- Relation and people requests cap at 100 items.
- Paginate on
has_more, never on result count, and setpage_sizeexplicitly because Notion's own docs disagree on the default.
The practical rule: never use Notion as the place to store automation bookkeeping. Every ledger row you write back to Notion costs a request you needed for real work.
When an agent over Notion earns its place
Use an agent when the work needs judgment plus memory across runs. Four patterns clear that bar, and each touches a second system because a Notion-only workflow rarely needs one. AI agents for Notion covers more workflows that use Notion as the data layer.
- Spec-to-ticket routing. A spec is marked ready. The agent decides which paragraphs are discrete engineering work and opens the missing issues in Linear.
- Knowledge-base answers in Slack. The agent searches Notion, reads the two or three pages that matter, and answers in thread with links.
- Doc-drift checks against GitHub. A runbook describes a deploy process. The agent flags the page when the deploy config in the repo diverges.
- Meeting-note routing. The agent pulls decisions and owners out of notes and files follow-ups against the right projects.
The same rules-to-agent progression shows up in other tools. See Asana automation and Airtable automation for the equivalent boundary.
Build the spec-to-ticket agent on Major
Here is the first pattern as a concrete build with the Notion, Linear, and Slack connectors.
- Trigger. A webhook on
page.content_updatedfor the specs data source fires the workflow. A daily scheduled run sweeps for anything the aggregated events missed. - App with state. The agent builds an app with a managed database holding a ledger:
spec_page_id, a content hash, the resultinglinear_issue_ids, and a run timestamp. Writing this ledger back to Notion would burn the three-requests-per-second budget on bookkeeping, so it lives in the app. - Deterministic path. The app fetches the page and child blocks, paginates on
has_more, backs off on 429 usingRetry-After, and compares the hash. An unchanged hash means no work and no model call, so a typo fix never re-derives the same tickets. - Agent judgment. For new content only, the agent decides what counts as a work item. That is the one step that needs a model.
- Actions. The app creates the missing Linear issues, records the mapping, and posts one Slack summary naming what was created and what was skipped.
- Governance. Three scoped credentials: a Notion connection limited to the specs database, a Linear credential that can create issues in one team, and a Slack credential that can post in one channel. Role-based access controls who can open the app, and the audit log ties every issue to the spec page and run that produced it.
The app is also the control surface. The ops lead who owns the specs database can open it, see what was processed and skipped, and fix a mapping without touching the agent. The agent reasons once, then the app runs the repeatable work, so cost is front-loaded and then flat rather than climbing with every spec. Build your first Notion agent on Major.
The downstream pieces have their own guides: Linear AI agent for issue triage and Slack AI agent for governed escalation workflows. For the repo-facing pattern, see GitHub automation.
This pattern does not cover multi-workspace setups or Notion's comment-driven flows. Those are separate problems.
More use cases by tool: More Linear use cases, More Notion use cases, More Slack use cases.
Start building on Major
Describe the spec-to-ticket triage agent to Major and it builds the app that holds the ledger, opens the issues under scoped credentials, and posts the summary, with every action logged. Your specs stay in Notion, and the durable part lives where it can be governed.
Related articles
Frequently asked questions
- How do I use Notion's API for custom automation?
- Create an internal integration, share your pages or databases with it, subscribe a webhook to the events you need, and call the API to fetch what changed. Add a scheduled sweep as a fallback, stay under about three requests per second per connection, and keep run state in a database outside Notion.
- Should I use polling or webhooks with the Notion API?
- Use webhooks as the trigger and a scheduled poll as a safety net. Webhook events carry metadata only and page.content_updated events can lag a minute or two, so a periodic timestamp comparison catches anything missed without spending your request budget on unchanged pages.
- What is the Notion API rate limit?
- An average of three requests per second per connection, with limited bursts tolerated. A second per-workspace limit scales with the plan and is not published. Exceeding either returns HTTP 429 with a Retry-After header in seconds, so back off for exactly that long and add jitter.
- Does Notion have webhooks?
- Yes. Notion supports webhook subscriptions for events including page.content_updated, comment.created, page.locked, and data_source.schema_updated. The endpoint must be a publicly reachable HTTPS URL, activation needs a one-time verification token, and payloads carry metadata only, so you call the API for the details.
- What can Notion's built-in automations not do?
- They cannot look anything up before deciding, branch once triggered, use the response from an external call, or remember earlier runs. They also cannot trigger each other, and a rule that errors pauses until reactivated. Those cases need the Notion API or an agent that builds an app to hold the state.
- Do I need to code to automate Notion through the API?
- Built-in database automations need no code. API automation traditionally does, covering webhook endpoints, pagination, retries, and state. On Major you describe the workflow and an agent builds the app that handles those steps, with scoped credentials and an audit log applied from the first run.