Skip to main content

Webhook Endpoint

Process emergency calls from ElevenLabs AI voice agents for access911.

Endpoint

Request

Headers

Body

The webhook receives a JSON payload from ElevenLabs with the following structure:

Request Fields

Data Collection Results

The data_collection_results object contains structured emergency metadata:

Response

Success Response

Error Response

HTTP Status Codes

Webhook Signature Verification

Optional webhook signature verification for security:

Signature Header Format

Verification Process

  1. Extract timestamp and signature from header
  2. Verify timestamp is within 30 minutes
  3. Calculate expected signature using webhook secret
  4. Compare signatures using constant-time comparison

Example Verification

Data Storage

DynamoDB Storage

Emergency calls are stored in DynamoDB with this structure:

S3 Storage

Full webhook payloads are stored in S3 for audit and analysis:

Error Handling

Common Errors

Error Response Format

Rate Limits

  • Request rate: 1000 requests per minute
  • Burst limit: 500 requests per minute
  • Timeout: 30 seconds per request

Security Considerations

Webhook Security

  • Use HTTPS: Always use HTTPS for webhook endpoints
  • Verify Signatures: Implement webhook signature verification
  • Validate Input: Validate all incoming data
  • Rate Limiting: Implement rate limiting to prevent abuse

Data Security

  • Encryption: Use encryption at rest and in transit
  • Access Control: Implement proper access controls
  • Audit Logging: Log all webhook processing activities
  • Data Retention: Implement appropriate data retention policies

Testing

Local Testing

Test webhook integration locally:

Webhook Validation

Validate webhook configuration:

Monitoring

Key Metrics

  • Webhook requests: Number of webhook requests received
  • Processing time: Time to process each webhook
  • Success rate: Percentage of successfully processed webhooks
  • Error rate: Number of failed webhook processing attempts

CloudWatch Metrics

Best Practices

Performance Optimization

  • Process Quickly: Process webhooks quickly to ensure real-time updates
  • Use Async Processing: Use asynchronous processing for non-critical operations
  • Implement Caching: Cache frequently accessed data
  • Optimize Database: Use batch operations and connection pooling

Error Handling

  • Implement Retry Logic: Retry failed operations with exponential backoff
  • Log Errors: Log all errors for debugging and monitoring
  • Handle Failures Gracefully: Don’t fail the entire webhook for non-critical errors
  • Monitor Error Rates: Track error rates and types

Security

  • Verify Signatures: Always verify webhook signatures in production
  • Validate Input: Validate all incoming data
  • Use HTTPS: Always use HTTPS for webhook endpoints
  • Implement Rate Limiting: Prevent abuse and DoS attacks

SDK Examples

Python

JavaScript

Production Use: Ensure proper security configuration and monitoring before deploying to production emergency response systems.