Skip to main content

Creating Webhooks

This guide walks you through creating a webhook to receive real-time notifications when API requests pass through your routes.

Prerequisites

Before creating a webhook, you’ll need:
  1. A KnoxCall account with at least one route
  2. An endpoint URL that can receive HTTP POST requests
  3. (Optional) Authentication credentials for your endpoint

Step 1: Navigate to Webhooks

  1. Open the KnoxCall admin dashboard
  2. Click Automation in the sidebar, then select Webhooks
  3. Click + Create Webhook

Step 2: Basic Configuration

Name and Description

Give your webhook a descriptive name:
Best practices:
  • Use descriptive names that explain the purpose
  • Include the destination in the name (e.g., “Slack”, “Zapier”, “Datadog”)
  • Add context in the description

Webhook URL

Enter the endpoint URL where KnoxCall will send webhook events:
Supported protocols:
  • https:// (recommended)
  • http:// (for development only)
Use HTTPS in production. HTTP endpoints may expose sensitive data in transit.

HTTP Method

Choose the HTTP method for webhook requests:

Step 3: Event Types

Select which events should trigger this webhook:

Request Lifecycle Events

Triggers when a request first arrives at KnoxCall, before forwarding to the backend.Use cases:
  • Real-time request monitoring
  • Request logging
  • Pre-flight webhooks
Triggers when the backend returns a 2xx response.Use cases:
  • Success tracking
  • Post-transaction webhooks
  • Analytics
Triggers when the backend returns a 3xx response.Use cases:
  • Redirect monitoring
  • SEO tracking
Triggers when the backend returns a 4xx response.Use cases:
  • Invalid request tracking
  • Authentication failure alerts
  • Rate limit notifications
Triggers when the backend returns a 5xx response.Use cases:
  • Error alerting (Slack, PagerDuty)
  • Incident management
  • Backend health monitoring
Triggers when the request times out before receiving a response.Use cases:
  • Timeout monitoring
  • Performance alerts
  • SLA tracking
Triggers on any non-2xx response (4xx, 5xx, or timeout).Use cases:
  • General error monitoring
  • Catch-all error handler
Triggers on every completed request, regardless of status.Use cases:
  • Comprehensive logging
  • Analytics
  • Audit trails
Example selection for error alerting:

Step 4: Route Filtering (Optional)

By default, webhooks trigger for all routes in your tenant. To limit to specific routes:
  1. Toggle on Route Filter
  2. Select the routes you want to monitor
Example:
Leave route filter empty to trigger for all routes. This is useful for logging or analytics webhooks.

Step 5: Authentication

Configure how KnoxCall authenticates with your webhook endpoint:

No Authentication

Use for endpoints that don’t require authentication (e.g., some Slack webhooks).

Bearer Token

KnoxCall sends:

Basic Authentication

KnoxCall sends:

Custom Header

KnoxCall sends:

HMAC Signature (Always Included)

Regardless of auth type, every webhook includes an HMAC signature:
Use this to verify the webhook came from KnoxCall.

Step 6: Payload Options

Control what data is included in the webhook payload:

Include Request Body

Default: Yes When enabled, includes the original request body:
Disable for:
  • Large payloads that would slow down delivery
  • Sensitive data you don’t want in logs

Include Response Body

Default: Yes When enabled, includes the backend response body:
Disable for:
  • Large response payloads
  • Sensitive response data

Include Headers

Default: No When enabled, includes request and response headers:
Sensitive headers (Authorization, API keys, cookies) are automatically redacted when included.

Include Status Code

Default: Yes When enabled, includes the HTTP status code:

Step 7: Retry Configuration

Configure how KnoxCall handles failed deliveries:

Retry on Failure

Default: Yes When enabled, KnoxCall retries failed webhook deliveries. Failure conditions:
  • Connection timeout
  • HTTP 5xx response from your endpoint
  • Network errors
HTTP 4xx responses are not retried, as they typically indicate a client error.

Max Retries

Default: 3 (Range: 0-5) Number of retry attempts after the initial failure. Retry schedule:

Timeout

Default: 30 seconds (Range: 1-60) How long to wait for a response from your webhook endpoint before timing out. Recommendations:
  • Slack/Zapier: 10-15 seconds
  • Custom endpoints: 30 seconds
  • Slow backends: Up to 60 seconds

Step 8: Custom Headers (Optional)

Add additional HTTP headers to webhook requests:
Use cases:
  • Identify the source of webhooks
  • Pass environment information
  • Custom routing in your endpoint

Step 9: Enable and Save

  1. Toggle Enabled to ON (default)
  2. Click Create Webhook
Your webhook is now active and will trigger on the configured events!

Testing Your Webhook

After creating, test your webhook:
  1. Click the Test button on the webhook detail page
  2. KnoxCall sends a test payload with event: webhook.test
  3. View the result:
    • Success: HTTP 2xx response
    • Failure: Error message and response details
Test payload example:

Example Configurations

Slack Error Alerts

Analytics Logging

Zapier Integration

Managing Your Signing Secret

Each webhook has a unique signing secret for HMAC verification:

View Secret

  1. Open webhook detail page
  2. Click Reveal Secret
  3. Copy the secret for use in your verification code

Regenerate Secret

  1. Open webhook detail page
  2. Click Regenerate Secret
  3. Copy the new secret immediately
  4. Update your verification code
Regenerating invalidates the old secret immediately. Make sure to update your verification code before regenerating.

Next Steps

Testing Webhooks

Verify your webhook configuration

Webhook Logs

Monitor webhook deliveries

Verifying Signatures

Secure your webhook endpoint

Webhooks Overview

Learn about webhook concepts

Statistics

  • Level: beginner
  • Time: 10 minutes

Tags

webhooks, configuration, setup, events, authentication