Webhooks vs. API: a webhook pushes, an API waits to be asked
An API only returns data when your app asks for it. A webhook sends your app a request the moment content changes. No polling loop needed. Draftbase supports both. Read through the delivery API. React through webhooks. You're never stuck choosing one over the other.
- Entry published
- Webhook queued
- Delivered (200 OK)
Webhooks vs. APIs: what's the difference
An API is pull-based. Your app decides when to ask. It sends a request and gets back the current state. Nothing arrives until you ask for it.
Say you want to know about a change the instant it happens. You have to keep asking. That's called polling. Polling works, but it has a cost. Every poll that finds no change is a wasted request. The delay before you notice a real change is always at least as long as your poll gap.
A webhook flips the direction. The CMS tells your app the instant something changes. Not the other way around. You register a URL and a set of events you care about. Draftbase sends a request to that URL the moment a matching event fires. No interval to tune. No idle loop to run.
Webhooks don't replace the API. They remove the need to poll for writes. You still need an API for reads. A webhook only tells you that something changed. It doesn't hand you the full state of your system. For that, you go back to the API.
Here's a real example. Say you cache a rendered blog post at the edge. Without webhooks, you have two options. Set a short cache time and poll for fresh data. Or accept stale content until the cache expires on its own. With a webhook on entry.published, you clear that one cache entry the moment the edit goes live. No guesswork, no wasted polling.
How Draftbase implements webhooks
Webhook dispatch runs after a write already succeeded. Not as part of it. When an entry is created, updated, or changes status, Draftbase checks which webhooks are subscribed. It matches on environment and template. Then it sends each match a signed request. If a subscriber is slow or offline, the write itself is unaffected. Dispatch runs off to the side. Failures get logged, not shown to the editor.
Nine entry events
Subscribe to entry.created, entry.updated, entry.status_changed, entry.published, entry.unpublished, entry.archived, entry.deleted, entry.rolled_back, or entry.tags_updated.
HMAC-signed deliveries
Every payload is signed with createHmac using a per-webhook secret, so your endpoint can verify it actually came from Draftbase.
Backoff retries with a delivery log
Delivery runs off your publish flow entirely, so a slow endpoint never delays it. A failed delivery retries up to 10 times over 7 days. Every attempt shows up in a delivery log you can check and retry by hand.
CRUD-managed subscriptions
Webhooks are created, updated, and deleted through their own management endpoints, kept separate from the read-only delivery API.
This split mirrors the same design as the rest of Draftbase. Write and read are separate surfaces. Wiring up a webhook never touches your read path. Revoking a webhook never affects your delivery API keys.
A webhook can also scope itself to one environment or one template. That matters once a project has more than one team publishing content. A Slack webhook for marketing doesn't need to fire on every product update too.
Every delivery carries an event ID, an event name, and a timestamp. Your endpoint can use the event ID to skip a repeat. That matters if a retry lands after the first attempt already worked, but timed out before Draftbase saw the reply.
Entry payloads can include the before-and-after values for the change. Not just a bare notice. That's a setting per webhook. Turn it on if your endpoint needs the actual diff. Leave it off to keep the payload small.
Webhooks vs. API polling
The table below lines up three setups on the same four points. Polling the API on a timer. A generic CMS's webhooks. And Draftbase's. The gap between polling and webhooks is the biggest jump. The gap between a generic webhook and a Draftbase one is mostly about defaults.
| Approach | Polling the API | Generic CMS webhooks | Draftbase webhooks |
|---|---|---|---|
| Latency | Delay = poll interval | Near-instant | Near-instant |
| Server load | Constant requests, mostly empty | One request per real change | One signed request per real change |
| Payload authenticity | N/A | Varies by vendor | HMAC-signed, verifiable |
| Setup | Cron job + diffing logic | Webhook URL + event picker | Webhook URL + event picker, same pattern |
The setup row hides how much the real work changes. A polling script has to fetch, check against the last known state, and store that state somewhere. A webhook keeps no state on your side. Draftbase already knows what changed. It tells you directly. You don't have to work it out yourself.
The server-load row also grows at scale in a way the table can't show. A poll gap that's fine for one app becomes real load once ten apps poll the same API on their own clock. Most polls find nothing new, most of the time. A webhook only fires when there's something to say. That cost doesn't grow the same way as the number of listeners grows.
When to use webhooks vs. the delivery API
Use the delivery API for reads. When a page loads, pull the current state directly. That's what the API is for. It's the only source that gives a full, correct snapshot at that exact moment. A webhook is a point-in-time event, not a live view.
Use webhooks to react to change. Common cases: clear a cache, update search, post a Slack alert, or kick off a build. In every one of those cases, you don't need the full entry on every event. You just need to know something changed.
Most real setups use both together, not just one. A typical setup pulls state on render through the delivery API. And reacts to change in the background through a webhook. Neither one alone covers both jobs well.
A site rebuild is the clearest case of this. The build pulls every entry it needs through the delivery API. That's a read. It wants one full, correct snapshot. What triggers the build is a webhook on entry.published. It fires the build the moment an editor ships a change. Not a rebuild on a fixed timer.
Why the push model is winning
API-first design is now the default for how teams build. Not the exception. 83.2% of teams now call themselves API-first. That's up from 74% in 2024. (Source) That shift makes webhooks a default choice, not a bolt-on.
The webhook side of that shift is well underway too. Especially at big firms running many linked systems. 78% of Fortune 500 firms now run setups where webhooks are a main pattern. That's up from about 51% in 2021. (Source) Here, that means an API for reads and webhooks for change alerts, running side by side. Neither one replaces the other.
Draftbase's webhooks follow that same pattern by default. The delivery API and the webhook stream are built as one system. Not two products stitched together after the fact.
Neither stat is specific to content tools. Both describe patterns broadly. But the trend fits here too. Teams now expect a content tool to notify them of change. Not make them build a polling layer just to stay in sync.
Vendor lock-in here is low. A webhook is a plain signed request. Switching CMS vendors later doesn't mean rewriting your core logic — only the URL you register and the header you check.
Try Draftbase webhooks
Publish an entry, watch a signed delivery fire, and wire it into your own endpoint. No polling loop to write, no diffing logic to maintain — just an HTTP request when something actually changes.
Frequently asked questions
What's the difference between a webhook and an API?
An API is pull-based. Your app sends a request and waits for a response, on your own schedule. A webhook is push-based — the CMS sends your app a request the moment something changes, with no polling required. You get the update as it happens instead of finding it on your next scheduled check. The two aren't competitors — a webhook still arrives as an HTTP request, it's just the CMS initiating it instead of you.
Are Draftbase webhook payloads signed?
Yes. Each delivery is HMAC-signed with SHA-256 using Node's createHmac and a secret unique to that webhook. Your endpoint can recompute the signature from the raw body and compare it, which confirms the payload came from Draftbase and wasn't altered in transit. The signature travels in a request header alongside the event ID and event name, so verification doesn't require parsing the body first.
What events can trigger a webhook?
Nine entry-level events: entry.created, entry.updated, entry.status_changed, entry.published, entry.unpublished, entry.archived, entry.deleted, entry.rolled_back, and entry.tags_updated. Each webhook subscribes to the specific events it cares about, and can optionally scope to one environment or one template, so a single subscription doesn’t have to fire on every event across every project.
How many times does Draftbase retry a failed webhook delivery?
Up to 10 attempts per event, backing off over a span of 7 days — a timeout, a non-2xx response, or a connection error all count as a failed attempt and schedule the next one. Each attempt gets a 10-second timeout. Every attempt is recorded in a per-webhook delivery log in your dashboard, so you can see what failed and why, and manually retry a delivery immediately instead of waiting for the next scheduled attempt.
Do I still need the delivery API if I use webhooks?
Yes. Webhooks tell you something changed — they are not a data store, and a payload is a snapshot of one event, not a live view of your content. Use the delivery API to pull the current published state when a page renders, and webhooks to react to changes as they happen. Most integrations end up using both, not one instead of the other.