Overview
Pulse API provides webhooks for real-time notifications about your asynchronous document processing jobs. Configure webhook endpoints to receive automatic updates when extraction jobs complete, fail, or change status.Webhook event delivery is currently under development. The configuration portal is fully functional, but events are not yet being sent.
Why Use Webhooks?
Instead of continuously polling the/job/{job_id}
endpoint to check job status, webhooks will provide:
- Real-time updates - Get notified instantly when jobs complete
- Reduced API calls - No need for repeated polling requests
- Better scalability - Handle high volumes of concurrent extractions efficiently
- Automatic retries - Failed deliveries will be retried with exponential backoff
Setting Up Webhooks
Step 1: Get Your Portal Link
Use the/webhook
endpoint to generate your webhook configuration portal link:
Step 2: Configure in Portal
The webhook configuration portal allows you to:- Add Multiple Endpoints - Configure different URLs for different event types
- Set Authentication - Add headers or basic auth to your webhooks
- Filter Events - Choose which events to receive at each endpoint
- Test Endpoints - Send test events to verify your setup
- View Logs - See delivery attempts and debug failed webhooks
Step 3: Implement Your Webhook Handler
Create an endpoint in your application to receive webhook notifications:webhook_handler.py
Webhook Security
Each webhook request includes security headers for verification:Webhook Events (Coming Soon)
Once enabled, you’ll receive events for job status changes:Event Types
Event | Description |
---|---|
job.created | New async job created |
job.processing | Job started processing |
job.completed | Job completed successfully |
job.failed | Job failed with error |
job.cancelled | Job was cancelled |
Job Completed Event
Job Failed Event
Example Implementations
Express.js Webhook Handler
Complete Integration Example
Here’s a complete example integrating async extraction with webhook handling:complete_integration.py
Best Practices
1. Idempotent Processing
Design your webhook handlers to be idempotent, as webhooks may be delivered multiple times:2. Quick Response Times
Respond to webhooks quickly (within 5 seconds) to avoid timeouts:3. Error Handling
Implement comprehensive error handling:Testing Webhooks Locally
Use ngrok or similar tools to test webhooks during development:Troubleshooting
Common Issues
-
Webhook signature verification fails
- Ensure you’re using the correct webhook secret from the portal
- Check that you’re passing the raw request body for verification
- Verify headers are being passed correctly (case-sensitive)
-
Webhooks not being received
- Confirm your endpoint is publicly accessible
- Check the portal logs for delivery attempts
- Ensure your endpoint returns 2xx status codes
-
Replay attacks
- The 5-minute timestamp window prevents replay attacks
- Store and check event IDs to prevent duplicate processing