The
/v1/update-simulation-result endpoint also accepts trace_ids for linking OpenTelemetry traces to simulation results. See Traces for details.How It Works
During a simulation, Bluejay provides a uniqueX-Simulation-Result-Id for each conversation. Your agent must extract this ID, track its tool calls and metadata during the call, and then send that data back to Bluejay post-call via the /v1/update-simulation-result endpoint.
Integration Methods
Bluejay supports three methods for tool call tracking, depending on your infrastructure.SIP Integration (Recommended for Phone Systems)
Best for: traditional phone systems (PSTN), VoIP providers, and telephony infrastructure. When Bluejay initiates calls via SIP, it injects custom headers includingX-Simulation-Result-Id directly into the SIP INVITE message.
Flow:
- Bluejay sends a SIP INVITE with custom headers to your agent
- Your agent must extract
X-Simulation-Result-Idfrom the SIP headers - During the call, your agent must log every tool call and relevant metadata
- After the call ends, you must send the collected data to
/v1/update-simulation-result
WebSocket Integration
Best for: modern web-based agents and non-phone-based systems. WebSocket integration using the CHIRP protocol provides real-time, bidirectional communication. TheX-Simulation-Result-Id is sent as an HTTP header on the WebSocket upgrade request.
Flow:
- Bluejay opens the WebSocket connection with
X-Simulation-Result-Idas a header on the upgrade request - Real-time CHIRP message exchange during the conversation
- Your agent must log tool calls and metadata throughout the session
- After the call ends, you must send the collected data to
/v1/update-simulation-result
LiveKit Integration
Best for: agents built on the LiveKit Agents framework. Bluejay joins the LiveKit room alongside your agent. When your agent invokes a tool, publish a data packet to a configured topic and Bluejay ingests it automatically — no post-call API call needed. Flow:- Set the LiveKit Customer Tool Topic in your Agent Connection settings
- Publish a JSON packet to that topic whenever your agent calls a tool
- Bluejay ingests packets in real time and persists them when the call ends
Why SIP for Phone-Based Agents?
If your agent runs through traditional phone systems (PSTN), basic telephony integration does not support tool call enrichment. To unlock tool call and metadata tracking for phone-based agents, you need SIP.
Compatible phone systems: traditional PBX, VoIP providers (Twilio, RingCentral, Telnyx, etc.), and any SIP-based platform.
Step-by-Step Guide
1. Choose Your Integration Method
- Phone-based agents → follow the SIP Integration Guide
- Web-based agents → follow the WebSocket Integration Guide
2. Track Tool Calls in Your Agent
Implement tool call tracking wherever your agent invokes external tools, APIs, or business logic during a call:3. Send Data to Bluejay
After the call ends, use theX-Simulation-Result-Id to call the /v1/update-simulation-result endpoint with the tool calls, events, and metadata you collected.
Endpoint: POST /v1/update-simulation-result
Headers:
X-API-Key: <your-api-key>Content-Type: application/json
Use Cases
Multi-Agent Orchestration
Track tool calls across agent handoffs and escalation workflows:Financial Services
Monitor critical financial operations with audit trails:E-commerce & Order Management
Track customer service interactions with order processing systems:Best Practices
- Capture everything — track all external interactions, including failed calls, for complete visibility
- Include timing — record
start_offset_ms(milliseconds from call start) so Bluejay can place each tool call at the right moment in the transcript - Log errors — failed tool calls and error details are just as valuable as successes for debugging agent behavior
- Store parameters — input parameters enable reproducibility analysis across simulation runs
- Process async, send post-call — handle tracking asynchronously during the call, then batch-send to
/v1/update-simulation-resultafter the call ends
Next Steps
Update Simulation Result API
Full endpoint reference for enriching simulation results.
SIP Integration
Set up SIP connectivity for phone-based agents.
WebSocket Integration
Connect web-based agents via CHIRP protocol.
Traces
Link OpenTelemetry traces to simulation results.
Tool Calls
Pass tool calls for production conversation evaluations instead.