localhost, you’ll need a tunneling service to expose your local server to the internet.
ngrok is the most popular tool for this purpose. It creates a secure tunnel from a public URL to your local machine.
Prerequisites
- A local webhook endpoint running (e.g., on port 3000)
- A DocIntell API key
Step 1: Install ngrok
Step 2: Create a Free ngrok Account
A free ngrok account gives you a random URL that changes each time you restart ngrok. For a stable URL, consider ngrok’s paid plans or use the ngrok free static domain feature.
Step 3: Start Your Local Server
First, make sure your webhook endpoint is running locally. Here’s a minimal example:Step 4: Start ngrok
In a new terminal, start ngrok pointing to your local server:https:// URL (e.g., https://abc123.ngrok-free.app) - this is your public webhook URL.
Step 5: Register Your ngrok URL with DocIntell
Create a webhook configuration using your ngrok URL:Step 6: Test the Integration
Upload a test document to trigger webhook events:Using ngrok’s Web Interface
ngrok provides a local web interface for inspecting webhook traffic. Open http://localhost:4040 in your browser to:- View all incoming requests
- Inspect request headers and body
- Replay requests for debugging
- See response details
Tips for Development
Use a Static Domain
If you have an ngrok account, you can claim a free static domain to avoid updating your webhook URL each time:Multiple Environments
For team development, each developer should:- Run their own ngrok tunnel
- Create their own webhook configuration in DocIntell
- Use test mode API keys (
dk_test_...)
Clean Up Test Webhooks
Remember to delete test webhook configurations when done:Alternatives to ngrok
While ngrok is the most popular option, other tunneling services include:| Service | Free Tier | Notes |
|---|---|---|
| ngrok | Yes (random URLs) | Most popular, great debugging UI |
| Cloudflare Tunnel | Yes | Requires Cloudflare account |
| localtunnel | Yes | Open source, simpler setup |
| Tailscale Funnel | Yes | Good if you already use Tailscale |
Troubleshooting
ngrok URL not working
ngrok URL not working
- Ensure ngrok is still running (check the terminal)
- Verify your local server is running on the correct port
- Check that you’re using the HTTPS URL, not HTTP
- Some corporate firewalls block ngrok - try a different network
Signature verification failing
Signature verification failing
- Make sure you updated
WEBHOOK_SECRETwith thesigning_secretfrom the webhook creation response - Verify you’re using the raw request body, not parsed JSON
- Check the ngrok web interface (localhost:4040) to see the exact payload being sent
Webhooks not arriving
Webhooks not arriving
- Confirm the webhook is registered:
GET /v1/webhooks - Check that
is_activeistrue - Verify you subscribed to the correct events
- Look at the ngrok web interface for incoming requests
ngrok session expired
ngrok session expired
Free ngrok sessions expire after a few hours. Simply restart ngrok and update your webhook URL:
Next Steps
Once your webhooks are working locally:- Deploy your webhook endpoint to production
- Learn about webhook security best practices
- Explore all webhook events