Newsletter is now available!
Quotion

Webhook

Webhooks enable real-time information flow between applications when specific events occur. Think of webhooks as 'reverse APIs'—instead of your application requesting information from Quotion, Quotion pushes information to your application when important events happen.

This feature allows you to:

  • Get notified when a note is updated/deleted
  • Build custom documentation sites
  • Create dynamic blogs
  • Develop content-driven applications
  • Implement real-time content management systems (CMS)

Event Types

Currently, Quotion supports the following webhook events:

  • noteCreations
  • noteDeletions
  • subscriberCreations
  • subscriberCancellations

Setup Requirements

Prerequisites

  • HTTP server supporting POST requests (HTTPS required)
  • Database for note storage (recommended):
    • SQL: PostgreSQL, MySQL
    • NoSQL: MongoDB
    • Cache: Redis
  • Alternative: Memory cache or local file storage

Configuration Steps

  1. Access Quotion dashboard
  2. Navigate to Site Settings
  3. Select the events you want to receive
  4. Set the Webhook URL and Authorization Header
  5. Save configuration

Webhook Configuration

After saving, your HTTP server will receive events within 2 minutes of any relevant event occurring.

Implementation Guide

Security Verification

Always verify webhook requests using the authorization header. Here's a Next.js example:

import { type NextRequest } from 'next/server';

export async function POST(req: NextRequest) {
  if (req.headers.get('authorization') !== 'MySecretToken') {
    return Response.json({ message: 'Unauthorized' }, { status: 401 });
  }
  return Response.json({ message: 'Webhook received' });
}

Webhook Payload Structure

Note example payload:

{
  "site": {
    "id": "8652bd70-b55d-43ad-99d2-422c7957d24b",
    "subdomain": "emma"
  },
  "posts": [
    {
      "id": "suLA7Gc4ajawG4LLtHtSQ2",
      "md": "hello world,\n* [ ] milk\n* [ ] egg\n* [ ] potato\n* [ ] carrot\n",
      "title": "A new note",
      "tags": "Code,Test",
      "draft": false,
      "featured": false,
      "hidden": false,
      "createdAt": "2025-03-06T07:44:44.8572",
      "updatedAt": "2025-03-0608:08:05.212Z",
      "type": "added"
    }
  ]
}

Newsletter example payload:

{
  "site": {
    "id": "8652bd70-b55d-43ad-99d2-422c7957d24b",
    "subdomain": "emma"
  },
  "newsletters": [
    {
      "type": "subscriberCancellations",
      "subscriberId": "97af9d1e-9ac1-4e8b-8078-093f52ff3d8c",
      "subscriberEmail": "hello@example.com"
    }
  ]
}

Payload Properties

  • site: Identifies the event source

    • id: Unique site identifier
    • subdomain: Site subdomain
  • posts: Array of note events

    • type: Event type (added or removed)
    • md: Note content in Markdown format
    • tags: Note tags, separated by commas
    • Additional metadata: title, draft, featured, etc.
  • newsletters: Array of newsletter events

    • type: Event type (subscriberCreations or subscriberCancellations)
    • subscriberId: Unique subscriber identifier
    • subscriberEmail: Subscriber email address

FAQs

Need Additional Features?

For custom requirements or additional event types: Contact Support

How is this guide?