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 two methods for passing theX-Simulation-Result-Id to your agent, 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 passed in the WebSocket connect message.
Flow:
- Bluejay establishes a WebSocket connection and passes
X-Simulation-Result-Idin the connect message - 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
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.| Feature | Basic Telephony | SIP Integration |
|---|---|---|
| Setup Complexity | Simple phone number | SIP endpoint configuration |
| Tool Call Tracking | ❌ Not supported | ✅ Complete tracking |
| Custom Metadata | ❌ Not supported | ✅ Rich metadata support |
| Evaluations | Conversation-focused | ✅ Comprehensive insights |
| Integration Effort | Minimal | Moderate (one-time setup) |
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 execution timestamps so Bluejay can correlate tool calls with conversation moments
- 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.
Tool Calls
Pass tool calls for production call evaluations instead.