DEV Community

Cover image for Receiving SaaS webhooks on EventBridge without writing an API
Sascha Mirow-Stanitzok
Sascha Mirow-Stanitzok

Posted on Originally published at sascha-ms.de

Receiving SaaS webhooks on EventBridge without writing an API

Every SaaS integration I have built in the last few years started with the same small project: an API Gateway endpoint, a Lambda function that loads a secret, recomputes an HMAC, compares it in constant time, checks a timestamp and finally forwards the payload with PutEvents. Then tests for the crypto part, and sooner or later a plan for rotating the secret. None of it is business logic, and the subtle bugs love to hide in exactly that signature check.

Since November 20, 2026, Amazon EventBridge can take that whole front part off your plate. The second-generation custom event bus can now receive webhooks directly. I tried it end to end with AWS CDK and TypeScript and wrote up the full walkthrough in EventBridge webhook events: webhooks without your own API. Here is the short version of what I learned.

What EventBridge now does for you

When you create a webhook source on a custom event bus (the AWS::EventsV2::… resources), EventBridge gives you three things: a stable HTTPS URL that belongs only to that source, a secret stored in Secrets Manager in your own account, and the event source that connects both to your bus. You paste URL and secret into the provider's dashboard, and every accepted request shows up on the bus as an event for your subscribers.

Verification is configuration, not code. You can choose HMAC signatures, a static token in a header or HTTP basic auth. The method is fixed once the source exists. If your provider supports the open Standard Webhooks format (webhook-id, webhook-timestamp, webhook-signature), EventBridge checks it out of the box and rejects requests whose timestamp is more than 300 seconds off. Rotation is built in as well: RotateWebhookCredentials keeps the old secret valid for 15 minutes while you update the provider.

There is no extra charge for the feature itself. A webhook counts like any other event ingested into the custom event bus.

The trap I expect most people to fall into

Webhook events do not have the familiar envelope with source, detail-type and detail. The event data is simply the request body as the provider sent it. If you write your subscriber filter out of habit against detail, nothing fails loudly. The filter just never matches, and the subscriber looks broken.

// Matches nothing for webhook events
{ "detail": { "type": ["payment.succeeded"] } }

// Matches the raw body
{ "type": ["payment.succeeded", "payment.refunded"] }
Enter fullscreen mode Exit fullscreen mode

Two related surprises: a Lambda subscriber receives a batch (an array) by default, so reading event.type directly gives you undefined. And a 403 despite a correct signature is usually the IAM role of the webhook source lacking read access to the secret, or a sender with a skewed clock.

Deduplication is not idempotency

EventBridge can drop duplicates, but only based on content (a hash of body plus copied headers) and only within a five-minute window. A provider retry after ten minutes, or a subscriber retry after a Lambda error, will reach your code. Ordering is not guaranteed either, so a refund can arrive before the payment it refers to.

In my example, a fictional bike rental processing payment webhooks, the consumer therefore stays responsible for correctness: a DynamoDB transaction writes a one-time marker per event ID together with the new payment status, and a condition on the event timestamp makes sure an older event never overwrites newer state. Invalid events are logged instead of thrown, because a thrown error would retry the whole batch.

When I would still build my own API

The new feature has clear limits. EventBridge only accepts valid JSON up to 1 MB and only answers with status codes. If your provider sends form data, expects a custom response body or needs a handshake during setup, API Gateway remains the way to go. Static tokens and basic auth also do not protect against tampered bodies or replays, so I would pick HMAC with a timestamp wherever the provider allows it, and treat the webhook URL itself like a credential.

For new integrations with JSON and HMAC, though, this is where I will start from now on.

What the full article covers

  • A complete AWS CDK stack in TypeScript with bus, webhook source, IAM role, DynamoDB table, Lambda subscriber and dead-letter queue, including a workaround for the missing L1 construct
  • The idempotent Lambda consumer with DynamoDB transactions and tests using the built-in Node.js test runner
  • A small Standard Webhooks signing script to send test webhooks and see deduplication and 403 responses in action
  • The webhook source as a resource in the Serverless Framework, security options, emergency shutdown and a FAQ

Read the full walkthrough on my site: EventBridge webhook events: webhooks without your own API

πŸ“– This is the condensed version. The full article on sascha-ms.de goes deeper – with all code samples, diagrams and a short knowledge check.


πŸ‘‰ Next step: Need a schedule in EventBridge? My EventBridge cron helper builds and explains the expression for you.

πŸ“¬ Stay updated: New articles on serverless, AI and leading tech teams via RSS, browser push or the weekly newsletter (in German).

Originally published on sascha-ms.de. More articles on serverless, AI in everyday development and leading tech teams: sascha-ms.de/en

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.