Skip to main content

Overview

When receiving webhooks from Inbound, it’s important to verify that requests are legitimate. Inbound includes a verification token in the X-Webhook-Verification-Token header for each webhook request.

Webhook Verification

Every webhook request includes security headers that allow you to verify the request authenticity:

Using the SDK Verification Helper

The SDK provides a verifyWebhook helper function that automatically fetches your endpoint configuration and compares the verification token:
app/api/webhook/route.ts

How Verification Works

  1. Verification Token: Each endpoint has a unique verification token stored in its configuration
  2. Header Transmission: Inbound sends this token in the X-Webhook-Verification-Token header with every webhook request
  3. SDK Verification: The verifyWebhook function fetches your endpoint config via the API and compares tokens
  4. Security: If tokens don’t match, the request should be rejected
Always verify webhook requests in production to prevent unauthorized access to your endpoints.
The verification token is automatically generated when you create an endpoint. You can view it in your endpoint configuration via the API.

Manual Verification (Without SDK)

If you’re not using the SDK, you can manually verify webhooks by fetching the endpoint configuration:

Getting Your Verification Token

You can retrieve the verification token for your endpoint via the API:

Best Practices

Always Verify in Production

Never skip webhook verification in production environments. Unverified webhooks can expose your application to security risks.

Handle Verification Failures

Always return appropriate error responses when verification fails:

Store API Keys Securely

Never hardcode API keys or commit them to version control:
  • Use environment variables
  • Use secrets management services in production
  • Rotate API keys regularly

Next Steps

Webhook Structure

Learn about webhook payload structure and types

API Reference

View endpoint API documentation

Error Codes

Understand authentication and verification errors

SDK Documentation

Learn more about webhook handling in the SDK