Skip to main content

Overview

Webhooks let you receive an HTTP POST notification at your own endpoint every time a conversion completes. Use them to trigger workflows in Zapier, Make, n8n, or any custom backend.
Webhooks are a PRO plan feature. Each user can register up to 3 webhook endpoints.

Setup

  1. Open the Web2MD extension and go to Settings.
  2. Scroll to the Webhooks section.
  3. Enter your endpoint URL and click Add Webhook.
  4. Copy the signing secret — you will need it to verify incoming requests.

Payload

When a conversion completes, Web2MD sends a POST request to your endpoint with the following JSON body:
{
  "event": "conversion.completed",
  "data": {
    "conversionId": "conv_abc123",
    "url": "https://example.com/article",
    "title": "Example Article",
    "markdownLength": 4820,
    "timestamp": "2026-03-21T12:00:00.000Z"
  }
}
FieldTypeDescription
eventstringAlways "conversion.completed"
data.conversionIdstringUnique ID for this conversion
data.urlstringThe source URL that was converted
data.titlestringThe page title
data.markdownLengthnumberCharacter length of the generated Markdown
data.timestampstringISO 8601 timestamp of the conversion

Security

Every webhook request includes an X-Web2MD-Signature header containing an HMAC-SHA256 signature of the raw request body, signed with your webhook’s signing secret.
Always verify the signature before processing a webhook. This prevents attackers from sending forged requests to your endpoint.

Verification example (Node.js)

const crypto = require("crypto");

function verifyWebhookSignature(payload, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(payload)
    .digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// In your request handler:
app.post("/webhooks/web2md", (req, res) => {
  const signature = req.headers["x-web2md-signature"];
  const rawBody = JSON.stringify(req.body);

  if (!verifyWebhookSignature(rawBody, signature, process.env.WEB2MD_WEBHOOK_SECRET)) {
    return res.status(401).send("Invalid signature");
  }

  const { event, data } = req.body;
  console.log(`Conversion completed: ${data.title} (${data.url})`);

  res.status(200).send("OK");
});
Use crypto.timingSafeEqual instead of === to prevent timing attacks when comparing signatures.

Retry behavior

AttemptTimingTimeout
FirstImmediate5 seconds
Retry1 second after first failure5 seconds
If both attempts fail (non-2xx response or timeout), the delivery is dropped. Web2MD does not retry beyond the single retry attempt.

Use cases

Zapier / Make / n8n

Use a Webhook trigger in your automation platform to start a workflow whenever a page is converted — post to Slack, add a row to a spreadsheet, or save to Notion.

Slack notifications

Send a message to a Slack channel every time a team member converts a page, keeping everyone in the loop.

Auto-save to external storage

Fetch the full Markdown via the REST API (using conversionId) and save it to S3, Google Drive, or your own database.

Analytics pipeline

Track conversion volume and content types by forwarding webhook events to your analytics backend.

Testing webhooks

During development, use a tool like webhook.site or ngrok to expose a local endpoint and inspect incoming payloads before deploying your handler to production.