Webhook

Ricevi notifiche quando una nuova bozza è pronta — poi recupera l'articolo completo via API.

Configura URL webhook e secret in Integrazioni. Quando una bozza è pronta, inviamo article.ready con slug e suggerimenti di fetch. Il backend verifica HMAC e chiama GET /posts/{slug} per importare contentHtml.

Eventi

  • article.ready — Una bozza con controllo qualità è pronta — recupera l'HTML completo via API usando lo slug
  • webhook.test — Inviato quando chiami POST /api/v1/webhooks/test

Verifica firma

Inviamo X-GrowthDaily-Timestamp (secondi Unix) e X-GrowthDaily-Signature (HMAC-SHA256 hex di `{timestamp}.{rawBody}` con il tuo secret webhook).

Verifica della firma (Node.js)
import { createHmac, timingSafeEqual } from "crypto";

function verify(secret, rawBody, timestamp, signatureHex) {
  const expected = createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");
  const a = Buffer.from(expected, "utf8");
  const b = Buffer.from(signatureHex, "utf8");
  if (a.length !== b.length) return false;
  return timingSafeEqual(a, b);
}
Payload di article.ready
{
  "event": "article.ready",
  "siteId": "uuid",
  "postId": "uuid",
  "slug": "my-post",
  "title": "My post",
  "trustScore": 94,
  "qualityBand": "premium",
  "assuranceLabel": "High confidence",
  "language": "en",
  "sourcePostId": null,
  "status": "draft",
  "at": "2026-07-21T12:00:00.000Z",
  "fetch": {
    "path": "/api/v1/sites/{siteId}/posts/{slug}",
    "hint": "GET with Bearer token to import contentHtml"
  }
}

Dopo article.ready

Usa lo slug dal payload (o fetch.path) per chiamare GET /api/v1/sites/{siteId}/posts/{slug}. Importa contentHtml, seo e faqJsonLd nel CMS — pubblica secondo il tuo calendario.

Garanzie di consegna

Ogni evento viene inviato una sola volta con POST HTTP e timeout di 8 secondi. Non ripetiamo automaticamente le consegne fallite. Un webhook fallito non blocca nuove bozze. Ogni tentativo è in Integrazioni → Consegne recenti.

Handler idempotenti

Rispondi rapidamente con HTTP 2xx. Deduplica gli import con postId (o siteId + slug). Se perdi un evento, usa GET /posts con updatedAfter — vedi riferimento API.

Log consegne

Successo ed errore compaiono nel pannello integrazioni con stato HTTP e timestamp.