Documentation

Comment trigger

Write a Notion comment starting with a trigger prefix on any task page connected to the integration.

TriggerModelExample
#claudeOpus (default)#claude hva er status?
#opusOpus#opus analyser denne koden
#sonnetSonnet (faster, cheaper)#sonnet gi et kort svar
#newOpus#new start fra scratch

Claude svarer som en ny kommentar i samme tråd. Fortsett samtalen med en ny trigger-kommentar — historikken følger med. Bruk #new for å starte en helt ny sesjon (sletter cache og historikk).

Context Claude gets

SourceAlways?Details
Personal memoryYesCloned from personal-memory repo, reads MEMORY.md
Page bodyYesPrompt property or page block content
Entity contextYesNames, types, URLs of related entities
Conversation historyYesAll prior comments tagged [Bruker]/[Claude]
Entity repoIf availableCloned if entity has Type=Repository or GitHub URL

API endpoints

MethodPathAuthDescription
POST/runAPI keyTrigger code generation from Notion task
POST/run-manualAPI keyDirect trigger with repo + prompt
POST/ingestAPI keyUpdate personal-memory from Notion task
POST/commentAPI keyAnswer question (direct API call)
POST/webhook/notionHMACNotion webhook for comment.created
GET/thread/:jobIdAPI keyJob chain thread data
POST/reply/:jobIdAPI keyReply to continue a job
POST/review/:jobIdAPI keyTrigger code review on PR
POST/merge/:jobIdAPI keyGuarded merge of PR
GET/status/:jobIdAPI keyJob status + log tail
GET/jobsAPI keyList all jobs
GET/healthPublicHealth check

POST /run

POST /run
Content-Type: application/json
X-API-Key: <key>

{"pageId": "notion-page-uuid"}

Fetches task from Notion, clones entity repo, runs Claude, creates PR.

POST /comment

POST /comment
Content-Type: application/json
X-API-Key: <key>

{"pageId": "notion-page-uuid", "comment": "optional override"}

Same as webhook trigger but via API. If comment is omitted, uses latest Notion comment.

Webhook setup

  1. Enable Read comments capability on Notion integration
  2. Create webhook subscription — URL: https://runner.nettsmed.dev/webhook/notion
  3. Copy verification_token from server logs → paste in Notion verify dialog
  4. Set NOTION_WEBHOOK_SECRET=<token> in .env
  5. Restart service

Known gotchas

Notion signature prefix: X-Notion-Signature uses sha256=<hex> format, not raw hex.

Nginx routing: New endpoints need explicit location blocks in Plesk nginx config.