Skip to main content

Webhooks Overview

Webhooks let you send real-time notifications to external services whenever requests pass through your KnoxCall routes. Use them to trigger workflows, update databases, send alerts, or integrate with third-party services.

What Are Webhooks?

Webhooks are outbound HTTP requests that KnoxCall sends to your specified endpoint when certain events occur. How it works:
Example use case:

Event Types

KnoxCall supports 8 event types that follow a Stripe-like naming convention:
Combine event types: You can subscribe a single webhook to multiple event types. For example, subscribe to both request.success and request.server_error to track all outcomes.

Webhook Payload

When an event occurs, KnoxCall sends a JSON payload to your endpoint:

Payload Configuration

Control what’s included in your webhook payload:
Sensitive data: When including headers, sensitive headers like Authorization, X-API-Key, and Cookie are automatically redacted for security.

Authentication Methods

Secure your webhook endpoints with multiple authentication options:

Bearer Token

Basic Auth

Custom Header

HMAC Signature

Every webhook includes an HMAC-SHA256 signature for verification:
Verify the signature on your server:

Headers Sent

KnoxCall includes these headers with every webhook request: Plus any custom headers you configure.

Route Filtering

Limit webhooks to specific routes: All routes (default):
Specific routes:
Use case: Create separate webhooks for different integrations:
  • payment-webhook: Only payment-related routes → Slack #payments
  • auth-webhook: Only authentication routes → Security monitoring tool

Retry Logic

When a webhook delivery fails, KnoxCall can automatically retry: Configuration:
  • Retry on Failure: Enable/disable retries
  • Max Retries: 0-5 attempts (default: 3)
Backoff schedule:
Success criteria: HTTP 2xx response
Webhooks are dispatched asynchronously (fire-and-forget). They don’t block or slow down the proxied request.

Webhook Logs

Track all webhook executions in the webhook logs: What’s logged:
  • Execution timestamp
  • Event type
  • HTTP method and URL
  • Sent headers and body
  • Response status and body
  • Response time (ms)
  • Success/failure status
  • Error messages (if failed)
  • Retry count
  • Linked request ID
Filter logs by:
  • Webhook ID
  • Success/failure status
  • Event type
  • Date range
  • Request ID (to correlate with API logs)

Common Use Cases

1. Error Alerting (Slack)

2. Analytics/Logging

3. Workflow Automation (Zapier)

4. Security Monitoring

5. Real-time Dashboards

Performance Considerations

  • Non-blocking: Webhooks are dispatched asynchronously
  • Parallel dispatch: Multiple webhooks for the same event run in parallel
  • Timeout: Configurable timeout (1-60 seconds, default: 30)
  • No impact on latency: Webhook failures don’t affect the proxied request

Next Steps

Creating Webhooks

Step-by-step webhook setup guide

Testing Webhooks

How to test your webhook configuration

Webhook Logs

Viewing and debugging webhook executions

API Logs

Correlate webhooks with API requests

Statistics

  • Level: intermediate
  • Time: 8 minutes

Tags

webhooks, notifications, events, integrations, slack, zapier