Overview
When receiving webhooks from Inbound, it’s important to verify that requests are legitimate. Inbound includes a verification token in theX-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 averifyWebhook helper function that automatically fetches your endpoint configuration and compares the verification token:
- Next.js
- Express.js
- Manual Verification
app/api/webhook/route.ts
How Verification Works
- Verification Token: Each endpoint has a unique verification token stored in its configuration
- Header Transmission: Inbound sends this token in the
X-Webhook-Verification-Tokenheader with every webhook request - SDK Verification: The
verifyWebhookfunction fetches your endpoint config via the API and compares tokens - Security: If tokens don’t match, the request should be rejected
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
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