Webhook vs API: When to Use Each (and How They Actually Work Together)
April 28, 2026
Webhooks and APIs are not alternatives — they're complementary patterns that solve different problems. APIs let your application request data when it needs it. Webhooks let an external system notify your application when something has changed. Most production integrations use both. The actual architectural decision isn't "webhook or API?" — it's "when should change detection live in my application versus somewhere else?"
This guide covers what each pattern does, when each is the right fit, and what changes when you build event-driven features on APIs that don't natively support webhooks.
Key takeaways
- APIs are pull-based: your application requests data when it needs it. Webhooks are push-based: an external system sends data to your application when something changes.
- Webhooks reduce API call volume and latency for change-driven features, but only ~11% of SaaS APIs natively support them. The rest require polling or a virtual webhook layer.
- "Webhook vs API" is rarely a binary choice. Most production integrations use APIs for reads, mutations, and backfills, and webhooks for change-driven events.
- Polling is the default fallback when webhooks aren't available — but polling becomes a system at scale: schedulers, checkpoints, retry logic, rate-limit coordination, and reconciliation jobs.
- Virtual webhooks centralize change detection in the integration layer, giving applications a webhook interface for APIs that don't natively support webhooks — without your application owning polling infrastructure.
What is the difference between a webhook and an API?
An API (specifically REST APIs in this context) is a pull-based pattern. Your application sends a request to an endpoint when it wants data; the endpoint returns a response. The application controls when reads happen, what data is requested, and how often. Every read is initiated by your application.
A webhook is a push-based pattern. An external system sends an HTTP request to a URL your application has registered, when a specific event occurs. The application doesn't request data — it receives data (or a notification) when something changes upstream.
The simplest way to think about it: APIs answer "what's the current state?" Webhooks answer "what just changed?"
Both use HTTP. Both transmit structured data (typically JSON). The architectural difference is the direction of initiation: who calls whom, and when.
How does an API call work?
A typical REST API call:
- Your application sends an HTTP request (
GET,POST,PUT,DELETE) to an endpoint - The remote system processes the request
- The remote system returns a response (typically JSON, with a status code)
- Your application processes the response
Examples:
GET https://api.example.com/v1/customers/12345
Returns the current state of customer 12345.
POST https://api.example.com/v1/invoices
{ "customer_id": "12345", "amount": 1000 }
Creates a new invoice and returns the created record.
API calls are synchronous in nature: the application waits for the response before continuing. They're appropriate when the application knows what it wants and when it wants it.
How does a webhook work?
Webhooks operate on a subscription model. Your application registers a URL with the upstream system, telling it which events to notify you about. When one of those events occurs, the upstream system sends an HTTP POST to your registered URL with information about the change.
The basic flow:
- Your application creates a webhook endpoint that accepts
POSTrequests - You register that endpoint with the upstream system (via a developer dashboard or API), specifying which events to subscribe to
- When a target event occurs, the upstream system sends a
POSTto your endpoint with payload data - Your application processes the payload and responds with a
200 OKto acknowledge receipt - If your endpoint doesn't respond (or returns an error), the upstream system typically retries with backoff
Webhooks are asynchronous from your application's perspective: events arrive when they happen, not when you ask for them. This is what makes them useful for change-driven features.
When should you use an API call?
API calls are the right pattern when:
- Your application needs current state right now. "What's this customer's account balance?" "What invoices are open?" These are read operations driven by user action or business logic — your application has the question, the API has the answer.
- Your application is creating or modifying data. Creating a new record, updating an existing one, or triggering an action upstream. Mutations almost always happen via API calls.
- You're doing initial backfill or historical extraction. When integrating with a new customer's data for the first time, you typically need to load existing records — that's a paginated API read, not an event stream.
- Data freshness isn't time-critical. If your application can tolerate data being a few minutes or hours stale, scheduled API reads (polling) may be sufficient and simpler than event subscription.
- The upstream system doesn't support webhooks for the data you need. Most SaaS APIs only support webhooks for a subset of objects. If the data you need isn't webhook-eligible, API polling is the only option.
When should you use a webhook?
Webhooks are the right pattern when:
- Your application needs to react to changes as they happen. Real-time dashboards, notifications, AI agent triggers, automated downstream integrations — anything where the speed of reaction matters more than the convenience of pulling.
- You want to reduce wasted API calls. Polling for changes that haven't happened consumes API quota and infrastructure resources. Webhooks fire only when something actually changes.
- You need event semantics, not state queries. "A new order was placed" is fundamentally an event. "What orders exist?" is a state query. Webhooks express events directly; API polling has to reconstruct events from state diffs.
- You're building features that scale with change frequency, not customer count. Polling cost scales with
customers × polling frequency. Webhook cost scales with actual event volume. For low-change-frequency datasets, webhooks dramatically reduce API usage.
Why webhook vs API isn't actually a binary choice
In practice, very few real integrations use only one pattern. Here's a typical production architecture:
- Initial sync (API): when a new customer connects, your application reads their existing records via paginated API calls
- Ongoing reads (API): when a user opens a dashboard or runs a report, your application fetches current state via API
- Mutations (API): when a user creates, updates, or deletes data, your application writes via API
- Change events (webhook): when records change upstream, the upstream system pushes events to your webhook endpoint
- Reconciliation (API): periodically, your application runs full or partial syncs via API to catch any events missed due to webhook delivery failures
The decision isn't webhook or API. It's which pattern is right for which job.
What happens when an API doesn't support webhooks?
This is the operational reality most integration teams hit: only about 11% of SaaS APIs natively support webhooks. The other 89% give you reads but no events.
When the API you need doesn't support webhooks, you have three options:
1. Build polling infrastructure
Schedule API reads at an interval, detect changes by comparing against your last-seen state, and trigger your downstream logic when changes are detected. This is the standard fallback.
What this requires you to build and maintain:
- Schedulers across tenants and integrations
- Checkpoint storage (cursors, timestamps, version IDs)
- Pagination handling
- Deduplication logic
- Retry and backoff for transient failures
- Rate-limit coordination across customers
- Reconciliation jobs for missed updates
For a single integration with one customer, this is tractable. For a B2B SaaS supporting multiple integrations across many customers, polling becomes infrastructure your team owns and maintains. For more on the operational reality of polling at scale, see our breakdown of polling vs. webhooks.
2. Use a sync-based notification system
Some integration platforms periodically sync data into their own database, then send a webhook notification to your application after the sync completes. The webhook signals that something changed; your application then queries the platform's stored copy to get the actual data.
This pattern has trade-offs: it depends on the platform storing customer records, the data your application receives is bounded by the sync schedule (potentially hours stale), and most events still require a follow-up API call to retrieve the changed data. We cover this distinction in detail in What are virtual webhooks? How they differ from sync-based webhooks.
3. Use virtual webhooks
Virtual webhooks centralize change detection in the integration layer rather than in your application or in a sync database. The integration layer polls the source API on a configurable interval, detects changes using timestamps or cursors, and delivers webhook events directly to your application — often with the changed data included in the event payload.
From your application's perspective, native and virtual webhooks behave the same: subscribe once, receive events, no polling logic in your code. The polling still exists, but it's handled inside the integration layer rather than your application.
How does Unified handle webhook vs API integration?
Unified.to provides both interfaces — REST APIs for reads, mutations, and backfills, and a unified webhook interface for change events.
REST API
Standard REST endpoints across 27 integration categories. Read records, create new ones, update existing ones, all through one normalized data model regardless of the underlying integration:
GET https://api.unified.to/crm/contact/{connection_id}?limit=50
POST https://api.unified.to/accounting/invoice/{connection_id}
GET https://api.unified.to/hris/employee/{connection_id}/{employee_id}
The same endpoint structure works across CRM, accounting, HRIS, ATS, and other categories — only the connection_id and resource type change.
Webhooks (native and virtual)
Unified provides a single webhook interface across all integrations:
- When the underlying integration supports native webhooks, Unified subscribes to them and delivers events through Unified's standardized payload format
- When the underlying integration doesn't support native webhooks, Unified runs change detection at a configurable polling interval (as frequent as every minute on paid plans) and delivers events through the same webhook interface
Your application code is identical for native and virtual webhooks. The integration-specific implementation details are handled in the integration layer. For details on how Unified's webhooks work and the payload format, see the webhooks documentation.
What about sync-based competitors?
Some unified API platforms use a sync-based notification model: data is cached in the platform's database on a schedule, and webhook events fire after the sync completes. This pattern is fundamentally different from Unified's change-detection model. We cover the architectural distinction in What are virtual webhooks? How they differ from sync-based webhooks.
When to use the API vs the webhook with Unified
The same decision logic applies as with any integration:
| Use case | Use the API | Use webhooks |
|---|---|---|
| Initial backfill of existing records | ✓ | (Unified webhooks support include_all=true for backfill via webhook flow) |
| User-initiated reads (dashboards, reports) | ✓ | |
| Creating, updating, deleting records | ✓ | |
| Reacting to upstream changes in real time | ✓ | |
| Triggering AI agent operations on data changes | ✓ | |
| Reducing API call volume for change-driven features | ✓ | |
| Building event-driven features without polling infrastructure | ✓ | |
| For a deeper look at how event delivery models scale across polling, native webhooks, and virtual webhooks, see which event delivery model scales. |
Frequently asked questions
What is the main difference between a webhook and an API?
APIs are pull-based: your application requests data. Webhooks are push-based: an external system sends data to your application when something changes. APIs answer "what's the current state?"; webhooks answer "what just changed?"
Can a webhook replace an API?
No. Webhooks notify your application about events but don't replace the need to read current state, create new records, or update existing ones. Most production integrations use APIs for reads and mutations, and webhooks for change events.
Are webhooks faster than API polling?
For change-driven features, yes. With fixed-interval polling, the expected delay before your application sees an event is about half the polling interval, with worst case being one full interval — polling at one-minute intervals gives you roughly 30 seconds of expected delay. Webhooks deliver events when they happen rather than on a schedule, so a healthy system typically delivers within seconds. Real-world webhook latency varies based on the upstream system's queuing, batching, and retry behavior — under load or incident conditions, delivery can stretch to minutes.
What if the API I'm integrating with doesn't support webhooks?
You have three options: build polling infrastructure in your application, use a sync-based platform that emits notifications after batch syncs, or use a virtual webhook layer that centralizes change detection in the integration layer and delivers events through a webhook interface.
Are webhooks reliable?
Reliability depends on the upstream system's retry behavior, and policies vary widely across vendors. Stripe retries failed webhook deliveries with exponential backoff for up to roughly three days in production. HubSpot retries up to about 10 times over roughly 24 hours, with some workflow webhooks stretching to about three days. Slack retries only a few times over minutes and tags retry attempts with x-slack-retry-num headers. Other implementations don't retry on 4xx errors at all. The only safe approach is to read each upstream system's published retry policy and design your webhook handler to be idempotent — assume you'll see the same event more than once.
How does Unified handle webhook retries?
Unified retries failed webhook deliveries up to three times per event using a Fibonacci backoff schedule, so the time between attempts grows in a controlled pattern. Retries trigger on non-success responses, timeouts, and network errors. In practice, this means a single event gets several spaced-out delivery attempts before being marked as permanently failed. Your webhook handler should still be idempotent — treat retries as the same event rather than duplicates.
Do webhooks reduce API costs?
For change-driven integrations, yes. Polling makes API calls regardless of whether data has changed; webhooks fire only when something actually changes. For low-frequency datasets, this can reduce API usage by orders of magnitude. We worked through the math in unlock real-time data with virtual webhooks.
What's the difference between a virtual webhook and a sync-based webhook?
Virtual webhooks detect changes directly from the source API and deliver events through a webhook interface — no data stored at rest. Sync-based webhooks fire after a scheduled sync writes data to the platform's database, and typically only signal that something changed (your application then queries the stored data separately). The architectural distinction matters for latency, compliance scope, and how much follow-up logic your application needs.
Final thoughts
The "webhook vs API" question is really a question about where change detection lives. APIs put the logic in your application: you decide when to read, what to read, and how to detect what's new. Webhooks move that logic upstream: the source system tells you when something has changed, and you react.
For B2B SaaS products integrating with multiple third-party APIs, the practical reality is that you'll use both — APIs for reads, mutations, and backfills, webhooks for change events. The harder decision is what to do for the 89% of APIs that don't natively support webhooks. Building polling infrastructure works at small scale and becomes operational overhead as you grow. A virtual webhook layer collapses that overhead into a single event interface across every integration.
Unified.to provides REST APIs and webhooks (both native and virtual) across 440+ integrations and 27 categories through a single normalized data model. Start a free trial or book a demo to see how event-driven integration architecture works in practice.