Skip to main content
The error event is triggered when critical errors occur during call processing, specifically when Large Language Model (LLM) or Speech-to-Text (STT) services fail.
Error events indicate technical failures that may cause conversation interruptions or call termination. These require immediate attention for maintaining service quality.

When It’s Triggered

This event is sent when:
  • LLM Errors: Language model API failures, timeouts, or service unavailability
  • STT Errors: Speech-to-text conversion failures or transcription service issues
  • Authentication Issues: API key problems or authorization failures
  • Quota Exceeded: Service limits reached for LLM or STT providers
  • Network Errors: Connectivity issues affecting external service calls

Error Categories

LLM Errors

  • Provider API downtime or maintenance
  • Rate limiting exceeded
  • Model capacity limitations
  • Invalid API keys or expired tokens
  • Malformed requests or unsupported parameters
  • Content filtering or safety violations

STT Errors

  • Audio quality too poor for transcription
  • Unsupported audio format or codec
  • Service provider outages
  • Network connectivity issues
  • Authentication or quota problems
  • Language detection failures

Event Structure

Key Fields

Call Object

The call object contains comprehensive information about the call session.

Assistant Object

The assistant object contains the configuration and settings of the assistant handling the call.
In some webhook events, the assistant object may be truncated for brevity. The full assistant configuration is typically included in status-update events.

Key Subobjects

  • assistantAnalysis: Contains settings for summary generation, success evaluation, and structured data extraction
  • assistantServer: The webhook configuration that triggered this event
  • config.speech: STT/TTS vendor settings, voice configuration, and language options

Messages Object

The messages array contains the conversation history between the user and assistant.
Each conversation-update event includes all messages from the start of the call up to that point, not just the latest message. This ensures that if any individual event is missed, you still have the complete conversation context.

Message Structure

Message Metrics

Each message includes detailed performance metrics:

Timeline Metrics

  • totalElapsedTimeMs: Total time since call start
  • offsetFromPreviousTurnMs: Time gap from previous message

Audio Metrics

  • totalAudioReceivedMs: Total audio duration received
  • audioDelayPerTurnMs: Audio processing delay for this turn
  • delayedPacketsPerTurnCount: Count of delayed network packets

Speech-to-Text (STT) Metrics

  • timestampMs: When transcription was completed
  • startOffsetMs/endOffsetMs: Audio segment boundaries
  • confidence: Transcription confidence score (0.0 to 1.0)
  • vadMs: Voice activity detection duration

Text-to-Speech (TTS) Metrics

  • audioDurationMs: Duration of generated audio
  • generationTimeMs: Time to generate audio
  • queueLatencyMs: Processing queue delay
  • isCachePlaying: Whether audio was served from cache

LLM Metrics

  • responseLatencyMs: Time for LLM to generate response
  • queueLatencyMs: Processing queue delay

Message Types

  • Welcome Messages: Have messageId starting with “welcome-”
  • User Messages: Have messageId starting with “user-”
  • Assistant Messages: Have complex messageId with user reference and timestamp

Example Payloads

Error Handling Strategies

Automatic Retry Logic

Provider Failover

Graceful Degradation

Real-time Alerting

Error Analysis and Monitoring

Error Rate Tracking

Root Cause Analysis

Error Prevention

Proactive Monitoring

Configuration Optimization

Error Recovery Testing

User Communication

When errors occur, transparent communication improves user experience:

Related Events

Error events may be preceded by hang events if processing delays occur before the error

Error Event Examples

This document contains examples of different types of error webhook events.

LLM Rate Limit Error

STT Audio Quality Error