Webhook
For your developer: ThirdDraft sends each finished article as a signed JSON POST to an https endpoint you build, and your code publishes it.
On this page
What you need
A public https address that takes a POST: your site's own code, or a webhook trigger in Zapier, Make or n8n (in n8n, the Production URL). Copy instructions for your AI agent, on the form, copies this contract, without the secret, as one brief for a coding agent.
Connect it
- In ThirdDraft, open your website's Publishing page and choose Webhook (from Add a destination if the page already lists one).
- Enter the Endpoint URL, and a Name if you want one. Click Continue.
- Copy the Signing secret and set it on your server, for example as
THIRDDRAFT_SECRET. - Click Send test. Until a test gets through, the card reads Waiting for a test and nothing is sent.
The request
X-ThirdDraft-Event:article.ready, ortest.X-ThirdDraft-Delivery: the event's id, alsoidin the body. The same on every automatic retry, new when someone sends the article again. Ignore an id you've handled.X-ThirdDraft-Signature:t=<unix seconds>,v1=<signature>, the hex HMAC-SHA256 oft, a full stop and the raw body, keyed with your secret exactly as shown,whsec_included. Compare in constant time; refuse atmore than five minutes old.
import crypto from 'node:crypto';
// rawBody: the request body exactly as it arrived.
function isFromThirdDraft(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) <= 300;
return fresh && typeof parts.v1 === 'string' && parts.v1.length === expected.length
&& crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}The body
| Field | What it holds |
|---|---|
event, id, created_at, test | The event, its id, when it was made, true for a test |
site.id, site.domain | Your website |
article.id | Create or update your post by it |
article.title, slug, language | Title, suggested address, two-letter language code |
article.meta_title, meta_description, keyword | For search results, and the phrase it targets |
article.content_markdown, content_html | The text; the title and featured picture come separately |
article.featured_image, images | Pictures: id, sha256, url, alt |
article.images_expire_at | When picture addresses stop working |
article.word_count, planned_for, written_at | Length, calendar day, when written |
Picture addresses work for seven days: copy the pictures to your own storage before then. A test has the same shape, with "test": true and no real article. Answer it with success and keep nothing.
What to answer
- Any
2xxis taken. Answer with JSON holdingurl, the post's address once live: on your website's domain, a subdomain or its blog, it marks the article published. Anidis kept as your id for it. 3xx,401,403,404,405or410stops the webhook until a test gets through.- Any other
4xxturns that article away; the next ones still go. 408,425,429,5xx, or no answer within 30 seconds, is tried again with the same event id.
Updating earlier articles
When a new article goes live, we can add a link to it in up to three earlier articles and send each again to your endpoint. This is off until you turn it on, because your endpoint has to handle it:
- In every
2xxanswer, addmodified_at: when the post was last changed, in ISO 8601 ({"url": "https://…", "modified_at": "2026-11-18T09:30:00Z"}). Nothing is sent as an update before your endpoint has answered with it. - An update arrives as the event
article.updated, withupdate.if_modified_at: themodified_atyou last gave for that article. - Answer
412with{"refused": "gone"}where you have no post for thatarticle.id,{"refused": "not_live"}where it isn't live, and{"refused": "edited"}where it changed since that moment. Then nothing is changed. - Otherwise update the post's text, title and pictures, never its status, address or date, and answer
200with its newmodified_at.
Then turn on Update earlier articles here in the webhook's Edit. Copy instructions for your AI agent includes all of this. See Links to new articles.
Changing or removing it
- Edit changes the name and the Endpoint URL. A new address waits for a test.
- Roll secret makes a new secret. The old one stops at once; nothing is sent until a test with the new one gets through.
- Setup details shows the secret and the test again. Only the workspace owner and admins see the secret.
- Remove stops sending there.