View on GitHub

Technical Writing Portfolio

Samples in software, SaaS B2B, APIs, and applied Artificial Intelligence.

Integrations · APIs · Webhooks (EN)

Webhooks: Design, Security, and Recommended Patterns for a SaaS That Takes Integrations Seriously

Webhooks are deceptively simple. If your SaaS exposes webhooks, you are designing an external contract.

On paper, they’re just HTTP callbacks: “something happened, here’s the payload.” In practice, poorly designed webhooks create brittle integrations and support tickets that never quite die.

What webhooks are

A webhook is an event-driven push mechanism. Your system sends an HTTP request to a customer-defined endpoint when a specific event occurs.

Key implications:

They are not APIs. They invert control. And that inversion is where most problems start.

Designing webhook events

A common mistake is to model webhook events around internal actions:

user_created, invoice_generated, subscription_updated

Instead, the payload must represent facts, not instructions.

Good webhook payloads:

Example:

{
  "event": "subscription.updated",
  "occurred_at": "2026-01-25T14:32:10Z",
  "data": {
    "subscription_id": "sub_123",
    "status": "active",
    "previous_status": "trialing"
  }
}

Avoid payloads that imply what the consumer should do. That is in consumers’ hands.

Version your webhook schema

Webhook consumers often process events automatically. Breaking changes are costly.

Recommended practices:

Consumers won’t just update. That’s not in your control, so better not to assume it.

Delivery guarantees

You cannot guarantee delivery -networks fail, endpoints go down. What you actually can guarantee:

Best practices:

And document it explicitly: ambiguity here causes integration bugs that are painful to debug.

Idempotency

Because retries exist, you should expect duplicate events.

Include:

Consumers should be able to ignore duplicates safely. And your documentation should say this clearly.

If your webhook system doesn’t generate duplicates, consumers should not rely on that.

Security

Webhooks are an attack surface because you send data to arbitrary endpoints. That is risky by definition.

Minimum security baseline:

Example flow:

  1. You compute a signature from the payload + secret
  2. You send it in a header
  3. The consumer verifies it before processing

This will protect against:

IP allowlists alone are not sufficient.

Response time

Webhook endpoints should:

From the sender’s perspective, a slow endpoint is indistinguishable from a failing one. From the receiver’s perspective, blocking logic increases failure risk.

So asynchronous handling on both sides keeps the system resilient.

Observability

Consumers will open support tickets if they cannot see:

So provide:

It will reduce support load and build trust.

Documentation

The integration is the product. Reduce integration time by documenting:

Final note

Webhooks are a long-term contract with external systems you do not control.

Design them as if you’ll have to support them for years — because you will.