import type { Metadata } from "next"; import Link from "next/link"; import { ArrowLeft } from "lucide-react"; export const metadata: Metadata = {}; export default function WebhookDocsPage() { return (
Back to Webhooks

Webhook Documentation

Learn how to integrate Epicure webhooks with your own tools, Zapier, and Make.

{/* Section 1: Webhook Events */}

Webhook Events

Event Description Payload Fields
recipe.created Fired when a recipe is created id, title, authorId
recipe.updated Fired when a recipe is updated id, title, authorId
recipe.published Fired when recipe visibility becomes public id, title, authorId
recipe.deleted Fired when a recipe is deleted id, title
meal_plan.updated Fired when a meal plan entry changes weekStart, day, mealType
shopping_list.completed Fired when shopping list marked complete id, name
comment.added Fired when a comment is added to your recipe commentId, recipeId, recipeTitle
{/* Section 2: Payload Format */}

Payload Format

Every webhook request is a POST with a JSON body in the following shape:

{`{
  "event": "recipe.created",
  "payload": { "id": "...", "title": "Pasta Carbonara", "authorId": "..." },
  "timestamp": "2024-01-15T10:30:00.000Z"
}`}
{/* Section 3: Signature Verification */}

Signature Verification

Every request includes an{" "} X-Epicure-Signature{" "} header containing an HMAC-SHA256 digest of the raw request body, signed with your webhook secret. Always verify this signature before processing the payload.

TypeScript / Node.js

{`import crypto from "crypto";

function verify(body: string, secret: string, signature: string): boolean {
  const expected = crypto.createHmac("sha256", secret).update(body).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}`}

Python

{`import hmac, hashlib

def verify(body: bytes, secret: str, signature: str) -> bool:
    expected = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(signature, expected)`}
{/* Section 4: Zapier Integration */}

Zapier Integration

  1. Go to zapier.com and create a new Zap.
  2. Choose Webhooks by Zapier as the trigger and select Catch Hook.
  3. Copy the webhook URL provided by Zapier.
  4. Go to Epicure Settings → Webhooks and add that URL.
  5. Test the trigger in Zapier to confirm it receives the payload.

Example workflows

  • New Recipe Published → Add row to Notion database
  • Shopping List Completed → Send Slack message to #groceries
  • Comment Added → Send email notification via Gmail
{/* Section 5: Make (Integromat) */}

Make (Integromat)

  1. Go to make.com and create a new scenario.
  2. Add an HTTP > Watch for Incoming Webhooks module as the trigger.
  3. Copy the generated webhook URL from the module settings.
  4. Go to Epicure Settings → Webhooks and paste that URL.
  5. Run the scenario and trigger a test event in Epicure to verify the connection.
  6. Add downstream modules (Notion, Slack, Gmail, etc.) to act on the incoming data.
); }