Overview
Webhooks allow you to receive real-time notifications when events occur in your Iqra AI account. Instead of polling the API, you can configure webhook endpoints to be notified instantly about call completions, conversation updates, and other important events.Webhook configuration is managed through the Iqra AI dashboard under Business Settings > Integrations.
How webhooks work
- Configure a webhook URL in your business integrations
- When an event occurs, Iqra AI sends an HTTP POST request to your URL
- Your server processes the event and responds with a 200 status code
- If delivery fails, Iqra AI retries with exponential backoff
Setting up webhooks
Create a webhook integration
- Navigate to your business in the Iqra AI dashboard
- Go to Settings > Integrations
- Click “Add Integration” and select “Webhook”
- Configure the following:
Set to
webhookA descriptive name for this webhook (e.g., “Production Event Handler”)
Your HTTPS endpoint URL that will receive webhook events
Array of event types to subscribe to (e.g.,
call.completed, conversation.ended)Optional signing secret to verify webhook authenticity
Configure event subscriptions
Select which events you want to receive:- call.initiated - Outbound call has been queued
- call.started - Call connection established
- call.completed - Call has ended
- call.failed - Call could not be completed
- conversation.started - Conversation session began
- conversation.message - New message in conversation
- conversation.ended - Conversation session completed
- agent.joined - AI agent joined conversation
- agent.left - AI agent left conversation
Webhook payload structure
All webhook events follow this structure:The type of event that occurred
Unique identifier for this event (for deduplication)
ISO 8601 timestamp when the event occurred
ID of the business this event relates to
Event-specific payload data
Event types and payloads
call.completed
Sent when an outbound call finishes:conversation.ended
Sent when a conversation session completes:conversation.message
Sent when a new message is added to a conversation:Securing webhooks
Verify signatures
If you configured a signing secret, each webhook includes a signature in theX-Iqra-Signature header:
Validate event IDs
Store processed event IDs to prevent duplicate processing:Responding to webhooks
Your endpoint should:- Respond quickly (within 5 seconds)
- Return HTTP 200 status code
- Process the event asynchronously if needed
Retry behavior
If webhook delivery fails (non-200 response or timeout):- First retry: after 1 minute
- Second retry: after 5 minutes
- Third retry: after 15 minutes
- Fourth retry: after 1 hour
- Fifth retry: after 6 hours
Testing webhooks
Use webhook testing tools
During development, use tools like:- webhook.site - Inspect webhook payloads
- ngrok - Expose local server for testing
- requestbin - Collect and examine webhooks
Trigger test events
You can trigger test events from the dashboard:- Go to Integrations > Your Webhook
- Click “Send Test Event”
- Select event type and review the payload
- Send to your endpoint
Best practices
Endpoint design
- Use HTTPS for security
- Implement signature verification
- Return 200 quickly, process asynchronously
- Handle duplicate events gracefully
- Log all webhook activity
Error handling
- Don’t fail on unknown event types (for forward compatibility)
- Validate payload structure before processing
- Store failed events for manual review
- Alert on repeated webhook failures
Performance
- Process webhooks in a queue
- Scale webhook handlers independently
- Monitor processing latency
- Set up dead letter queues for failures
Security
- Whitelist Iqra AI IP addresses if possible
- Verify webhook signatures
- Don’t expose sensitive data in logs
- Rotate signing secrets periodically
Monitoring webhooks
The Iqra AI dashboard provides webhook monitoring:- Delivery success/failure rates
- Recent webhook deliveries and responses
- Retry attempts and outcomes
- Event type distribution
Common issues
Webhooks not being received
- Verify your endpoint URL is correct and accessible
- Check that your server is responding with 200
- Ensure your firewall allows Iqra AI’s IP addresses
- Review webhook logs in the dashboard
Duplicate events
- This is normal due to retry logic
- Implement idempotency using EventId
- Store processed event IDs
Timeout errors
- Your endpoint must respond within 5 seconds
- Process events asynchronously
- Return 200 immediately