Help
Publish with a webhook
A webhook lets Kitto send each finished article straight to your own system. This page explains what we send, how to check that it really came from Kitto, and what to answer.
What it is
Instead of publishing to WordPress for you, Kitto can send the article to an address on your side. You choose the address. When an article is ready, we send one request to it with the text, the settings for search engines and the pictures. Your system saves the article and answers "got it".
How to connect it
- Open your site in Kitto and go to the publishing step of the setup.
- Choose Webhook.
- Enter the https address that should receive articles. Kitto sends a test request to it first (see endpoint.verify).
- Save the secret that Kitto shows you. It is shown only once, so please store it somewhere safe, for example in your server settings. If you lose it, you can connect again to get a new one.
- Press Send test to see what your address answers (see Send a test).
Using Zapier or Make? Pick Bearer token when you connect (see Bearer token) and follow the webhook recipes.
The address must start with https:// and use the standard port. Addresses with a username or password inside them, and addresses that point to private networks, are not accepted. Kitto does not follow redirects, so please enter the final address.
What we send
One POST request per event, with a JSON body and these headers:
| Header | Meaning |
|---|---|
| Content-Type | application/json; charset=utf-8 |
| X-Kitto-Event | The event name, for example article.published. |
| X-Kitto-Delivery | The delivery id. If we send the same delivery again, it has the same id, so you can ignore a duplicate. |
| X-Kitto-Signature | Proof that the request came from Kitto, see Check the signature. |
| Authorization | Only if you picked Bearer token: Bearer your-token, see Bearer token. |
| User-Agent | Kitto-Webhooks/1.0 (+https://kittoseo.com/crawler/) |
We never send cookies. The Authorization header comes only in Bearer token mode.
Events
| Event | When |
|---|---|
| endpoint.verify | When you connect, when you press the check button again, and when you press Send test. Please answer with a 2xx code, even if you have not set up the secret yet. From Send test it comes with "test": true and a sample article; please don't publish that one. |
| article.published | A new article. If article.status is publish, please publish it. If it is draft, the owner has not approved it yet, so keep it hidden. After approval you receive article.published again with status publish and the same article.id. |
| article.updated | One of two things. Either a new version of an article you already received (same article.id), or an update to a page that already exists on your site and that you never received from us. In the second case article.url is the address of that page, article.slug is null and article.id is our own id for this update. Please find the page by article.url and replace its title, text and description, keeping its address. If you do not know article.id, look the page up by article.url. |
| article.unpublished | Please take the article down. Only id, task_id and url are sent in article. |
The JSON body
The current api_version is 2026-10-15. We may add new fields later, so please ignore fields you do not know. Anything that would break your code gets a new api_version.
{
"api_version": "2026-10-15",
"event": "article.published",
"delivery_id": "dlv_0f1e2d3c4b5a69788796a5b4c3d2e1f0",
"created_at": "2026-10-15T12:00:00.000Z",
"site": { "id": "6f1c0c1e-0000-4000-8000-000000000000", "domain": "example.com" },
"article": {
"id": "a-stable-article-id",
"task_id": "9b2d7a40-0000-4000-8000-000000000000",
"status": "publish",
"title": "How to choose a coffee grinder",
"slug": "how-to-choose-a-coffee-grinder",
"meta_title": "How to choose a coffee grinder",
"meta_description": "A short guide to burr and blade grinders.",
"language": "en",
"html": "<p>...</p><figure><img src=\"cid:coffee-grinder-guide.jpg\" alt=\"...\"></figure>",
"markdown": "...",
"json_ld": "{...}",
"images": [
{
"role": "cover",
"position": null,
"mime": "image/jpeg",
"filename": "coffee-grinder-cover.jpg",
"alt": "...",
"caption": null,
"data_base64": "/9j/4AAQSkZJRg...",
"url": "https://app.kittoseo.com/m/v1.AbC...",
"width": 1200,
"height": 630,
"omitted": null
}
],
"canonical_url": null,
"url": null,
"target_query": "best coffee grinder"
}
}| Field | Meaning |
|---|---|
| api_version, event, delivery_id, created_at | The format version, the event name, the delivery id and the time in ISO 8601. |
| site.id, site.domain | Your site in Kitto. |
| article.id | A stable id of the article. It is your own id if you returned one earlier, otherwise ours. |
| article.task_id | The Kitto task id, or null. |
| article.status | publish or draft. |
| article.title, slug | The title and the suggested address part (slug may be null). |
| article.meta_title, meta_description | The title and description for search results (description may be null). |
| article.language | Language code such as en, or null. |
| article.html | The article as a safe HTML fragment, without html or body tags. Structured data (JSON-LD) is not inside it. |
| article.markdown | The same text as Markdown, or null. Please escape it as ordinary user text when you render it. |
| article.json_ld | Schema.org markup as a JSON string, or null. With several blocks it is a JSON array. |
| article.images | The picture files, see Pictures. |
| article.canonical_url, url | The canonical address and the page address. For a new article, url is the address you returned earlier. For an update to an existing page, url is the address of the page to update. Both may be null for a brand new article. |
| article.target_query | The search phrase the article is written for, or null. |
Pictures
Kitto has no file storage of its own, so the pictures arrive inside the request. Each item in article.images has:
role:coverorinline. The cover has no place in the html, use it as the featured image.position: the section number for inline pictures, null for the cover.mime,filename,alt,caption,width,height.data_base64: the file itself, encoded in base64.url: a private link to the same file, see Pictures as links.omitted: null,size_limit,files_offorexpired.
Please save each file on your side (your media library or CDN). Inline pictures appear in the html as <img src="cid:FILENAME"> and in the Markdown as . Replace cid:FILENAME with the address of your saved file that has the same filename.
When the whole request would be too large (about 3.5 MB of pictures), the heaviest inline pictures arrive without a file: data_base64 is null and omitted is size_limit. You can remove their figure from the html or keep the text without the picture. The cover is always included. The files are attached until the article has been delivered with status publish. In later events, such as article.updated, images may be empty, and the cid references point to the files you received before.
Pictures as links
Every picture also has a url on app.kittoseo.com. It works for 7 days from the moment we send the article, then answers 404. A link that was changed by hand answers 404 too. It is handy for Zapier and Make, which can fetch a file by its address. Please copy the file to your own storage within those 7 days; don't put our link into the article itself.
If you turn off Include image files when you connect, requests carry no base64: data_base64 is null, omitted is files_off, and you take each file from its url. This keeps requests small.
We keep each file for 7 days after the last request that carried its link, and never longer than 30 days. If a request is sent after that, for example a late retry, the picture still comes with its filename, alt and caption, but without a file or link, and omitted is expired. Please keep the copy you saved earlier.
Check the signature
Every request carries an X-Kitto-Signature header like this:
X-Kitto-Signature: t=1760529600,v1=3f2a...64 hex characters...To check it:
- Take
t(Unix time in seconds) and everyv1value from the header. - Compute HMAC-SHA256 with your whole secret as the key (the text starting with
kitto_whsec_, as is) over the messaget+ a dot + the raw request body. Write the result as lowercase hex. - Compare it with each v1 value in constant time. One match is enough.
- Reject the request if
tdiffers from your clock by more than 5 minutes (300 seconds). This stops someone from replaying an old request.
Use the raw body exactly as received. If you parse the JSON and write it back, the bytes change and the check fails.
Bearer token
Zapier and Make can't easily check a signature, but they can compare a header with a value you choose. So when you connect, you can pick Bearer token and enter your own token (16 to 512 characters: letters, digits and - . _ ~ + /, no spaces). Every request then also carries:
Authorization: Bearer your-tokenPlease compare the whole header with Bearer, a space and your token, and answer 401 if it differs. The signature stays in every request, so your code can check both. Kitto keeps the token encrypted and shows it only as dots. To change it, connect again with a new one. Step by step setups are in the webhook recipes.
Node.js
import crypto from "node:crypto";
import express from "express";
const SECRET = process.env.KITTO_WEBHOOK_SECRET; // starts with kitto_whsec_
const TOLERANCE_SEC = 300;
const app = express();
// Important: read the RAW body. The signature covers the exact bytes we sent.
app.post("/kitto", express.raw({ type: "application/json", limit: "8mb" }), (req, res) => {
const rawBody = req.body.toString("utf8");
const header = req.get("X-Kitto-Signature") || "";
let t = null;
const signatures = [];
for (const part of header.split(",")) {
const [key, value] = part.trim().split("=");
if (key === "t" && /^\d+$/.test(value || "")) t = Number(value);
if (key === "v1" && /^[0-9a-f]{64}$/.test(value || "")) signatures.push(value);
}
if (t === null || signatures.length === 0) return res.sendStatus(401);
if (Math.abs(Date.now() / 1000 - t) > TOLERANCE_SEC) return res.sendStatus(401);
const expected = crypto.createHmac("sha256", SECRET).update(t + "." + rawBody, "utf8").digest();
const ok = signatures.some((sig) => {
const actual = Buffer.from(sig, "hex");
return actual.length === expected.length && crypto.timingSafeEqual(actual, expected);
});
if (!ok) return res.sendStatus(401);
const event = JSON.parse(rawBody);
// Skip a delivery you have already handled: check req.get("X-Kitto-Delivery").
// ... save the article here ...
res.json({ url: "https://example.com/blog/my-article", id: "your-own-id" });
});
app.listen(3000);PHP
<?php
$secret = getenv('KITTO_WEBHOOK_SECRET'); // starts with kitto_whsec_
$tolerance = 300;
// Important: read the RAW body. The signature covers the exact bytes we sent.
$rawBody = file_get_contents('php://input');
$header = $_SERVER['HTTP_X_KITTO_SIGNATURE'] ?? '';
$t = null;
$signatures = [];
foreach (explode(',', $header) as $part) {
$pair = explode('=', trim($part), 2);
if (count($pair) !== 2) continue;
if ($pair[0] === 't' && ctype_digit($pair[1])) $t = (int) $pair[1];
if ($pair[0] === 'v1' && preg_match('/^[0-9a-f]{64}$/', $pair[1])) $signatures[] = $pair[1];
}
if ($t === null || count($signatures) === 0 || abs(time() - $t) > $tolerance) {
http_response_code(401);
exit;
}
$expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
$ok = false;
foreach ($signatures as $sig) {
if (hash_equals($expected, $sig)) $ok = true;
}
if (!$ok) {
http_response_code(401);
exit;
}
$event = json_decode($rawBody, true);
// Skip a delivery you have already handled: $_SERVER['HTTP_X_KITTO_DELIVERY'].
// ... save the article here ...
header('Content-Type: application/json');
echo json_encode(['url' => 'https://example.com/blog/my-article', 'id' => 'your-own-id']);Send a test
After you connect, the Send test button sends endpoint.verify with "test": true and a sample article to your address. Kitto then shows the answer code and the first 300 characters of your answer, so you can see a problem right away. The test doesn't change your connection and doesn't use a credit.
What to answer
| Your answer | What Kitto does |
|---|---|
| Any 2xx | The delivery counts as done. |
| 408, 429, 5xx, no answer in time | We try again, with the same X-Kitto-Delivery id. |
| 401 or 403 | We treat it as "the signature was not accepted". No retries. The connection will ask you to fix it. |
| Any other 4xx, or a redirect (3xx) | The delivery is refused and we do not retry. We never follow redirects. |
We wait up to 10 seconds for an answer, so please save the article quickly or put it in a queue and answer at once.
With a 2xx answer you may also return JSON in the body (we read up to 64 KB):
{ "url": "https://example.com/blog/my-article", "id": "your-own-id" }urlis the address of the published page. Kitto opens it to make sure the page is live.idis your own id for the article. We send it back asarticle.idin later events.
Both are optional. If the body is empty or is not this JSON, the delivery still counts.
When a credit is used
A credit is used once the article is delivered with status publish. If you return a url, Kitto first checks that the page is live. If you return no url, the successful delivery itself is the confirmation. A draft (status draft) does not use a credit, because the owner has not approved it yet.
Need a hand?
Ready setups for Zapier, Make, Next.js and PHP are in the webhook recipes. Please write to us and we will gladly look at your first delivery with you. You can also read how to connect WordPress instead.