Skip to main content

Overview

Webhooks allow UserTrace to send real-time notifications about simulation events to your systems. They’re also used to trigger outbound agents (like voice agents that initiate calls) when simulations start.

Webhook Types

1. Event Notifications

Get notified when simulations start, complete, or encounter issues.

2. Outbound Agent Triggers

Receive triggers to initiate outbound calls, messages, or other agent-initiated actions.

Webhook Configuration

Configure webhook endpoints in the UserTrace dashboard under Settings > Webhooks. Required Settings:
  • Endpoint URL: Your HTTPS webhook receiver
  • Events: Which events to receive
  • Secret: For webhook signature verification
  • Timeout: Maximum response time (default: 30 seconds)

Event Webhooks

Simulation Started

Sent when a new simulation begins.

Simulation Completed

Sent when a simulation finishes successfully.

Simulation Failed

Sent when a simulation encounters an error.

Outbound Agent Triggers

Voice Agent Call Trigger

Trigger your voice agent to initiate an outbound call.

WhatsApp Outbound Message

Trigger your WhatsApp agent to send the first message.

Webhook Security

Signature Verification

UserTrace signs all webhook payloads using HMAC-SHA256. Verify signatures to ensure webhook authenticity. Signature Header:
Verification Example (Python):
Verification Example (Node.js):

Webhook Response Format

Your webhook endpoint should respond with appropriate status codes:

Success Response

Outbound Trigger Acknowledgment

Error Response

Retry Policy

UserTrace implements exponential backoff for failed webhook deliveries:
  1. Initial attempt: Immediate delivery
  2. Retry 1: After 30 seconds
  3. Retry 2: After 2 minutes
  4. Retry 3: After 8 minutes
  5. Retry 4: After 32 minutes
  6. Final attempt: After 2 hours
Webhooks are considered failed after 5 unsuccessful delivery attempts.

Best Practices

  1. Verify Signatures: Always verify webhook signatures for security
  2. Respond Quickly: Return HTTP 200 within 30 seconds
  3. Handle Duplicates: Implement idempotency using simulation_id
  4. Log Events: Log all webhook events for debugging
  5. Async Processing: Process webhooks asynchronously for complex operations
  6. Monitor Failures: Set up alerts for webhook delivery failures
Testing Webhooks: Use tools like ngrok or webhook.site to test webhook integration during development.