The internal integration token from Notion. It starts with ntn_.
Notion Integration
Connect a Notion database and every vote from the "Was this helpful?" widget lands in it as a row: the page path, a thumbs up or down, and the time it came in. You read feedback right in Notion, filter it, share it with your team. A free Notion plan is enough.
Why an integration at all? By default, votes are written to a JSONL file on your server. That works on any normal Node host. It doesn't work on Vercel, where the filesystem is read-only — the write fails and your reader sees an error. Notion is the fix for those hosts.
The setup needs two values:
NOTION_API_KEYstringrequiredNOTION_DATABASE_IDstringrequiredThe database that receives the votes. A 32-character ID, copied from the database URL.
Pick one of two ways to get them.
Option 1: Click through Notion
No terminal needed. About five minutes.
-
Create the integration
Open notion.so/profile/integrations and choose New integration. Name it something like
docs-feedback, pick your workspace, and save. Copy the Internal Integration Secret — it starts withntn_. That token is yourNOTION_API_KEY. If that link ever moves, Notion's developer portal at notion.so/developers/tokens is the fallback from their official quick-start guide. -
Create the database
Add a new page in Notion and choose Table. Name it
Docs Feedback(any name works). Then give it exactly these three properties:PathtitlerequiredThe page's URL path, like
/integrations/notion. Notion adds a title property for you — rename it toPathif it says something else.HelpfulcheckboxrequiredChecked for a thumbs up, empty for a thumbs down.
SubmitteddaterequiredWhen the vote came in.
Match the names exactly, capital first letter included. OwnDocs looks them up by name.
-
Share the database with the integration
Open the database, click the ⋯ menu at the top right, choose Connections, and pick the integration from step 1. This screen has no direct URL of its own — the Connections menu lives on each page and database, two clicks from the database you just made. Until you do this, the token sees nothing. Notion keeps bots out of your content by default.
-
Copy the database ID
Open the database as a full page and look at the URL. The 32 characters between the last dash and the
?v=part are the ID — highlighted here:Plain TextPlain Texthttps://www.notion.so/myworkspace/Docs-Feedback-218fb8926f02e83e52a542a8869bb279?v=594fa6dddfef38df9e92acffe2f1f1e1That's your
NOTION_DATABASE_ID.
Option 2: One API call
Faster if you live in a terminal. One catch first: a bot can only create a database inside a page that's already shared with it. So share any page with your integration (step 3 above), then run one command.
Export your token and the parent page's ID — the 32 characters at the end of its URL:
export NOTION_API_KEY="ntn_your-token"
export PARENT_PAGE_ID="ec55e31f5861e743bbd21fbff15d80f6"Now create the database with the exact schema OwnDocs expects:
curl -X POST https://api.notion.com/v1/databases \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2026-03-11" \
-d '{
"parent": { "type": "page_id", "page_id": "'"$PARENT_PAGE_ID"'" },
"title": [{ "type": "text", "text": { "content": "Docs Feedback" } }],
"initial_data_source": {
"properties": {
"Path": { "title": {} },
"Helpful": { "checkbox": {} },
"Submitted": { "date": {} }
}
}
}'The id in the response is your NOTION_DATABASE_ID:
{ "object": "database", "id": "218fb892-6f02-e83e-52a5-42a8869bb279" }ℹ️ NOTE Skip the sharing step and Notion answers with a
validation_erroraboutparent.page_id. Bots can't create anything at the workspace root. Share the page, run the same command again, and it goes through.
Wire it into OwnDocs
For local development, put both values in .env.local:
NOTION_API_KEY="ntn_your-token"
NOTION_DATABASE_ID="218fb8926f02e83e52a542a8869bb279"For Vercel, add the same two under Project → Settings → Environment Variables, then redeploy.
Now open any page and vote. A row lands in the database within a second or two.