Documentation

Custom Webhooks

Webhooks as a Service
Reliable Delivery

Send custom HTTP payloads to any endpoint when events happen in your system. Laneful handles all the hard parts—retries, queueing, failure recovery, and delivery guarantees—so you don't have to.

Automatic Retries
Message Queueing
Signed Payloads
Zero infrastructure required

No queues, workers, or retry logic to build or maintain

Any HTTP endpoint

Send to your own servers, third-party APIs, or internal services

Webhooks as a Service
Managed Delivery

Overview

Custom Webhooks let you send structured HTTP payloads to any endpoint in response to events—without managing any of the underlying infrastructure yourself. Whether you're notifying an internal service, triggering a third-party workflow, or syncing data across systems, Laneful ensures your webhooks are delivered reliably.

What Laneful handles for you

  • • Durable message queueing that rides out endpoint outages of up to 24 hours
  • • Automatic retries with exponential backoff on failure
  • • HMAC signature signing for endpoint verification
  • • Built-in timeout and retry policies, with nothing to configure

The Challenges

Building reliable webhook delivery yourself sounds simple at first—just make an HTTP request. In practice, production-grade webhook infrastructure is surprisingly difficult to get right.

Transient failures and timeouts

Endpoints go down. Networks blip. Servers restart. A fire-and-forget HTTP request will silently fail whenever the target is unavailable, with no way to recover the lost event.

Retry logic is harder than it looks

Naive retries can overwhelm a recovering endpoint or cause duplicate processing. Proper exponential backoff, jitter, and idempotency handling require significant engineering effort.

Queueing and backpressure

During traffic spikes, in-process queues fill up and events are dropped. Durable queueing requires external infrastructure—message brokers, workers, and careful configuration—just to ensure events survive a process crash.

Observability and debugging

When a webhook isn't received, you need visibility into what was sent, what response came back, and what happened during each retry attempt. Without built-in logging, root cause analysis is a blind hunt.

Security and authenticity

Without payload signing, any party can POST to your webhook endpoint and inject fake events. Implementing and rotating HMAC secrets correctly is easy to get wrong.

Laneful covers everything

Every one of these problems is handled for you. You define the endpoint and the payload shape—Laneful ensures it gets there, even if it takes multiple attempts across hours.

How It Works

Webhook Apps and Endpoints

A Webhook App is a container that groups one or more webhook endpoints together. It typically represents a single customer or destination system that needs to receive webhook events—for example, one Webhook App per customer account in your platform.

Inside each Webhook App you configure webhook endpoints—the individual delivery targets. Each endpoint has:

  • • URL — the HTTPS address that will receive the HTTP POST for each event
  • • Signing secret — a per-endpoint HMAC secret used to sign every payload so the receiver can verify authenticity
  • • Batch mode — optionally group multiple events into a single request to reduce HTTP overhead for high-volume streams

The delivery pipeline

1

Event is triggered

Your application submits the event to the Ingest Events API. The event payload is persisted before any delivery is attempted.

2

Payload is signed and dispatched

Laneful signs the payload with your HMAC secret and sends an HTTP POST to your configured endpoint with the appropriate headers.

3

Response is evaluated

A 2xx response marks the delivery as successful. Any other status code, connection error, or timeout triggers the retry policy.

Example payload

Laneful sends a POST request to your endpoint with the event's payload as the JSON body, so you control its shape completely. In batch mode, the body is a JSON array of payloads:

POST https://your-service.example.com/hooks/laneful
Content-Type: application/json
X-Webhook-Signature: 5d41402abc4b2a76...

{
  "id": "evt_5f1c9a2e",
  "event": "order.completed",
  "timestamp": 1753502407,
  "data": {
    "order_id": "ord_8f2a1c",
    "customer_id": "cus_4b9d3e",
    "total": 9900,
    "currency": "usd"
  },
  "metadata": {
    "environment": "production",
    "source": "checkout-service"
  }
}

Retries & Queueing

When your endpoint is unavailable or returns an error, Laneful automatically retries delivery using exponential backoff with jitter. Events are held in a durable queue so they survive process restarts and traffic spikes without any work on your end.

Retry schedule

• Immediately, with two quick follow-ups within about 15 seconds
• Every 5–30 seconds during the first minute
• Every minute until 5 minutes
• Every 5 minutes until 15 minutes
• Every 15 minutes until 45 minutes
• Every 30 minutes until 2 hours
• Every hour until 6 hours
• Every 2 hours until 12 hours
• Every 4 hours until 24 hours

Times count from when the event was queued. Each retry makes up to three quick attempts, and intervals vary by ±20% so retries don't arrive in bursts. Even 4xx responses are retried. Laneful keeps retrying for 24 hours; after that, the event is no longer retried.

Durable queueing

Every event is written to a durable store before dispatch. If your endpoint is down for hours, queued events keep retrying for up to 24 hours and are delivered once it recovers—with no work on your end.

Best practice: respond quickly, process asynchronously

Return a 200 status as soon as you receive the request and handle the payload in a background job. This prevents timeouts from triggering unnecessary retries and keeps your endpoint resilient under load.

Security

Verifying webhook signatures

Every delivery is signed with your webhook secret using HMAC-SHA256. The X-Webhook-Signature header holds the HMAC of the raw request body as 64 lowercase hex characters, with no prefix. Verify it over the exact bytes you received, before parsing the JSON, to confirm the request originated from Laneful:

const crypto = require('crypto');
const express = require('express');
const app = express();

function verifySignature(rawBody, signature, secret) {
  if (!secret || typeof signature !== 'string' || !/^[0-9a-f]{64}$/i.test(signature)) {
    return false;
  }
  const expected = crypto
    .createHmac('sha256', secret)
    .update(rawBody)
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature, 'hex'),
    Buffer.from(expected, 'hex')
  );
}

// express.raw keeps req.body as the exact bytes Laneful signed. Raise its
// 100 KB default limit to fit your largest payload or batch
app.post(
  '/hooks/laneful',
  express.raw({ type: 'application/json', limit: '5mb' }),
  (req, res) => {
    const signature = req.get('x-webhook-signature');
    if (!verifySignature(req.body, signature, process.env.WEBHOOK_SECRET)) {
      return res.status(401).send('Unauthorized');
    }

    // Safe to parse and process
    const payload = JSON.parse(req.body.toString('utf8'));
    res.status(200).send('OK');
  }
);

Security checklist

  • • Always verify the HMAC signature before processing
  • • Use HTTPS endpoints only
  • • Store webhook secrets in environment variables, not source code
  • • Include a unique ID in each payload you submit, so your endpoint can recognize and skip the rare duplicate delivery
  • • Apply rate limiting on your webhook endpoint as a safeguard

Getting Started

Set up your first custom webhook

1. Create a new webhook app

Workspace → Extra Services → Webhooks → Webhook Apps → Create Webhook App

2. Configure your endpoint

Open the app and click Create Webhook:

  • • Enter the HTTPS URL that will receive events
  • • Choose which event types should trigger this webhook: they are matched exactly against the type of each submitted event, and leaving them empty delivers all events
  • • Choose batch mode to receive several payloads per request as a JSON array

3. Copy your signing secret

After saving, copy the generated HMAC secret and add it to your endpoint as an environment variable. You'll use it to verify incoming requests.

4. Send a test event

Submit an event with the Ingest Events API (the app page also shows a ready-made curl example under Show curl example to send a webhook event) and check that your endpoint received it.

Ingest Events API

POST/v1/webhook/events

Submit one or more events for processing. The API accepts the request, durably queues the events, and returns immediately with an accepted status. Maximum 1000 events per request.

Sample Organization Endpoint

Below is a sample endpoint. After you register and create an organization, you'll get your unique endpoint:

https://your-endpoint.z1.send.laneful.net/v1/webhook/events

Replace your-endpoint.z1.send.laneful.net with your organization's endpoint, shown in the dashboard under Workspaces → Workspace Settings → API Keys (the same host as the send API). HTTPS only.

Authentication

Pass an API key created under Extra Services → Webhooks → API Keys as a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Request body

FieldTypeRequiredDescription
eventsarrayYesList of events to process. Cannot be empty. Maximum 1000 events.
events[].customer_idstringYesWebhook App ID, as a string.
events[].typestringYesEvent type, e.g. clicked, bounced, unsubscribed. Matched exactly against each endpoint's event types.
events[].payloadobjectYesJSON object describing the event, delivered as the request body to the matching endpoints.

Example: single event

curl -X POST https://your-endpoint.z1.send.laneful.net/v1/webhook/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "customer_id": "1234",
        "type": "clicked",
        "payload": {
          "email": "alice@example.com"
        }
      }
    ]
  }'

Example: batch of events

curl -X POST https://your-endpoint.z1.send.laneful.net/v1/webhook/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "customer_id": "1234",
        "type": "clicked",
        "payload": { "email": "alice@example.com" }
      },
      {
        "customer_id": "1234",
        "type": "bounced",
        "payload": { "email": "bob@example.com", "reason": "mailbox full" }
      },
      {
        "customer_id": "1234",
        "type": "unsubscribed",
        "payload": { "email": "carol@example.com" }
      }
    ]
  }'

Responses

200

Events accepted. Events whose customer_id or type match no endpoint are also accepted, then discarded.

{ "status": "accepted" }
400

Validation error

{ "error": "No events to process" }

Also Too many events to process (more than 1000 events).

401

Unauthorized

Invalid or missing API key, or the request IP isn't allowed for the key.