PluginsNotion
Notion Webhooks
All available Notion webhook events
The Notion plugin includes webhook handlers for Notion database page events.
Full Implementation: See the Notion plugin source code.
Setup
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";
export async function POST(request: Request) {
const headers = Object.fromEntries(request.headers);
const body = await request.json();
const result = await processWebhook(corsair, headers, body);
return result.response;
}Notion webhooks are identified by the x-notion-signature header.
Available Webhooks
databasePages.pageCreated
Fires when a page is created in a database.
Example:
notion({
webhookHooks: {
"databasePages.pageCreated": async (event) => {
console.log("Page created:", event.id);
console.log("Database:", event.parent?.database_id);
},
},
})Key fields: id, created_time, last_edited_time, properties, parent, url
databasePages.pageUpdated
Fires when a page is updated in a database.
Example:
notion({
webhookHooks: {
"databasePages.pageUpdated": async (event) => {
console.log("Page updated:", event.id);
console.log("Properties:", event.properties);
},
},
})Key fields: id, created_time, last_edited_time, properties, parent, url
verification
Fires during Notion's URL verification handshake when you register a webhook endpoint.
Corsair handles this automatically — no additional configuration is needed.
Example:
notion({
webhookHooks: {
"verification": async (event) => {
// Corsair responds automatically; this hook fires for observability
console.log("Webhook verified");
},
},
})