Task Routes

Webhook handlers for Notion integrations.

Endpoints

GET /debug-webhook

  • Purpose: Check webhook configuration status
  • Authentication: Required (X-API-KEY header)
  • Response: Configuration status and secret length

POST /test

  • Purpose: Test webhook authentication
  • Authentication: Required (X-API-KEY header)
  • Response: Success message if authentication passes

POST /url

  • Purpose: Update Notion page with glimpse URL
  • Authentication: Required (X-API-KEY header)
  • Request Body: Webhook payload with page ID
  • Response: Success/failure with constructed URL
  • Example Request:
    { "data": { "id": "notion-page-id" } }
  • Example Response:
    { "success": true, "message": "Page URL updated successfully", "pageId": "notion-page-id", "url": "https://your-domain.com/glimpse/notion-page-id", "timestamp": "2025-09-03T15:00:00.000Z" }

POST /notion-webhook

  • Purpose: General Notion webhook handler
  • Authentication: Required (X-API-KEY header)
  • Response: Success acknowledgment

Error Handling

  • 400: Missing page ID or host header
  • 401: Missing X-API-KEY header
  • 403: Invalid X-API-KEY value
  • 500: Notion API errors or server errors