kitful.aiDocs

Integrations

Connect a webhook

Send finished articles to a custom HTTPS endpoint and verify signed requests.

On this page

Use a webhook when another system should receive finished articles and no built-in destination fits the workflow.

Connect a webhook

You need an active paid plan and a public HTTPS endpoint. The URL can't include a custom port or a username and password, and the endpoint must answer directly: a redirect fails the test. You can also add a shared secret for signed requests.

  1. Open Integrations.
  2. Click Add on Webhook.
  3. Enter Integration Name, Webhook URL, and an optional Secret.
  4. Optionally click Test. Kitful sends a sample article payload and reports the endpoint's HTTP result.
  5. Click Save.

Request format

Kitful sends a POST request with Content-Type: application/json.

{
  "id": "01EXAMPLEARTICLE",
  "title": "How to plan a CRM migration",
  "slug": "plan-a-crm-migration",
  "html": "<h2>Plan the migration</h2><p>...</p>",
  "excerpt": "A practical migration plan for growing teams.",
  "metaTitle": "How to Plan a CRM Migration",
  "metaDescription": "Prepare data, people, and timing for a safer CRM move.",
  "featuredImage": {
    "url": "https://cdn.example.com/crm-migration.webp",
    "alt": "CRM migration planning board"
  },
  "tags": ["crm", "operations"],
  "publishedAt": "2026-07-20T09:00:00.000Z"
}

Fields that are not set can be empty or null. Treat the article ID as an opaque identifier.

Verify a signed request

When a secret is set, each request includes:

X-Kitful-Signature: sha256={hex_signature}

The value is an HMAC-SHA256 signature of the raw JSON body using your secret.

import crypto from 'node:crypto';

function isValidKitfulRequest(rawBody, secret, signature) {
  const digest = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return signature === `sha256=${digest}`;
}

Verify the signature before parsing or acting on the payload. Compare signatures in constant time when your runtime provides that option.

Test requests use the same payload shape and signature, plus this header:

X-Kitful-Test: true

Do not create or publish an article when this header is present.

Publish through the webhook

Choose the webhook from an article's Publish dialog, a scheduled slot, or campaign settings. The receiving endpoint must return a successful status only after it accepts the article.

You can answer with JSON such as {"postId": "123", "url": "https://example.com/blog/plan-a-crm-migration"}. Returning the post's public url lets Kitful recognize the post as its own later, for example in Optimize.

Receive an update

Kitful sends one update event to the same endpoint when you apply an improvement from Optimize, and when you remove or swap a product in a published article. Find your stored post by slug and replace only the fields present in the payload. Fields that are absent are unchanged on purpose: leave them as they are.

{
  "event": "update",
  "slug": "plan-a-crm-migration",
  "articleId": "01EXAMPLEARTICLE",
  "url": "https://example.com/blog/plan-a-crm-migration",
  "operationId": "refresh:01EXAMPLERUN",
  "isReplay": false,
  "title": "How to Plan a CRM Migration in 5 Steps",
  "metaDescription": "Prepare data, people, and timing for a safer CRM move.",
  "html": "<h2>Plan the migration</h2><p>...</p>"
}

articleId is the id from the publish request, and it is present only for posts Kitful wrote. Updates can also arrive for posts on your site that Kitful did not write. isReplay is true when Kitful sends an operationId again after an earlier answer was lost.

Answer with HTTP 200 and {"ok": true} after the post is saved. For the same operationId, return the original result without writing again. Other answers:

  • 404 means you don't hold that post. Nothing is written, and the improvement stays a draft so the user can pick another site.
  • 5xx, 408, 429, or a timeout leaves the result unknown. Applying again sends the same operationId.
  • Anything else, or an operationId in your answer that doesn't match, is shown as a failed update.

Troubleshoot webhooks

  • For 401 or 403 responses, check the receiving service's authentication and shared secret.
  • For a 404 response, check the exact endpoint path.
  • For another non-success response, inspect the receiving service logs, fix the endpoint, and publish again.