Webhooks Guide

Webhooks allow MassBlogger to push content directly to your website's database or CMS. Whenever a post or programmatic page is created, updated, or published, we'll send a POST request to your endpoint with the full content.

How it works

When you connect a website using the Custom (Webhook) platform, MassBlogger becomes a headless CMS for your site. You write and manage content in MassBlogger, and we "push" it to your server in real-time.

  • Real-time updates: Content appears on your site the moment you hit publish.
  • Full control: You decide how to store and render the HTML content.
  • Secure: Every request is signed with a secret key so you can verify it's from us.

Setup Process

1. Create an Endpoint

Create a POST route on your website (e.g., /api/webhook) that can receive JSON payloads.

2. Configure in MassBlogger

When adding a new website, select Custom Site and then Webhook. Enter your endpoint URL.

3. Save your Secret

Copy the Signing Secret provided during setup and add it to your server's environment variables as MASSBLOGGER_WEBHOOK_SECRET.

Blog Post Payload

Sent for standard blog posts (Writer, Automate).

{
  "event": "post.published",
  "timestamp": "2026-02-18T14:30:00.000Z",
  "websiteId": "abc123",
  "data": {
    "id": "67b1234567890abcdef12345",
    "title": "10 Tips for Better SEO",
    "slug": "10-tips-for-better-seo",
    "content": "<h2>Introduction</h2><p>Full HTML content...</p>",
    "category": "SEO",
    "tags": ["SEO", "Marketing"],
    "featuredImage": "https://example.com/image.jpg",
    "metaTitle": "10 Tips for Better SEO | Blog",
    "metaDescription": "Learn the top 10 SEO tips...",
    "published": true,
    "createdAt": "2026-02-18T10:00:00.000Z",
    "updatedAt": "2026-02-18T14:30:00.000Z",
    "internalLinks": [
      { "keyword": "SEO", "url": "/blog/what-is-seo" }
    ]
  }
}

pSEO Payload

Sent for programmatic SEO pages. Note that content contains template tags like [var] or [[anchor]] that should be resolved at render time.

{
  "event": "pseo.page.updated",
  "timestamp": "2026-02-18T14:30:00.000Z",
  "data": {
    "pageId": "p_123",
    "campaignId": "c_456",
    "websiteId": "abc123",
    "status": "published",
    "targetSlug": "best-hotels-in-london",
    "html": "<h2>Hotels in [city_name]</h2>...",
    "variables": { "city_name": "London", "year": "2026" },
    "internalLinks": [
      { "keyword": "London", "url": "/guide/london", "internal": true }
    ]
  }
}

Event Types

EventDescription
Standard Posts
post.createdA new post was saved
post.updatedAn existing post was edited
post.publishedA post was published
post.deletedA post was removed
Programmatic SEO
pseo.page.updatedA pSEO page was created or updated
pseo.page.deletedA pSEO page was removed
pseo.internalLinks.updatedCampaign-wide internal links updated

Signature Verification

To ensure requests are genuinely from MassBlogger, every request includes an X-Webhook-Signature header. This is an HMAC-SHA256 hash of the request body, signed with your secret.

Node.js Example

import crypto from 'crypto';

const signature = req.headers['x-webhook-signature'];
const body = JSON.stringify(req.body);
const secret = process.env.MASSBLOGGER_WEBHOOK_SECRET;

const expected = crypto
  .createHmac('sha256', secret)
  .update(body)
  .digest('hex');

if (signature !== expected) {
  return res.status(401).send('Invalid signature');
}

Need help? Contact us at support@massblogger.com