{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-call-detail-response-schema.json",
  "title": "CallDetailResponse",
  "description": "Full call detail — the canonical response for GET /calls/{call_id}.\n\nThis is the single source of truth for the call detail shape. The OpenAPI\nspec is generated from this model. The SDK TypeScript types are generated\nfrom the spec. The developer-console consumes SDK types directly.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-calls-api-openapi.yml#/components/schemas/CallDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "call_sid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Call Sid"
    },
    "workspace_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workspace Id"
    },
    "service_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Service Id"
    },
    "caller_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Caller Id",
      "x-phi": true
    },
    "phone_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone Number",
      "x-phi": true
    },
    "direction": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "inbound",
            "outbound",
            "playground",
            "simulated",
            "test"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Direction"
    },
    "status": {
      "type": "string",
      "title": "Status",
      "default": "completed"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "call_start_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Call Start Time"
    },
    "call_end_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Call End Time"
    },
    "call_duration_seconds": {
      "type": "number",
      "title": "Call Duration Seconds",
      "default": 0.0
    },
    "media_start_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Media Start Time"
    },
    "config": {
      "anyOf": [
        {
          "$ref": "#/$defs/ConversationConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "turns": {
      "items": {
        "$ref": "#/$defs/Turn"
      },
      "type": "array",
      "title": "Turns",
      "default": []
    },
    "states_visited": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "States Visited",
      "default": []
    },
    "final_state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Final State"
    },
    "triggered_behaviors": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Triggered Behaviors",
      "default": []
    },
    "completion_reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "completed",
            "abandoned",
            "escalated",
            "transferred",
            "timeout",
            "error",
            "voicemail",
            "no_answer",
            "caller_hangup",
            "forwarded",
            "terminal_state",
            "warm_transfer_completed",
            "no_inbound_audio",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Completion Reason"
    },
    "emotional_summary": {
      "anyOf": [
        {
          "$ref": "#/$defs/EmotionalSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "forwarding": {
      "anyOf": [
        {
          "$ref": "#/$defs/ForwardingDetails"
        },
        {
          "type": "null"
        }
      ]
    },
    "conference_sid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conference Sid"
    },
    "participants": {
      "items": {
        "$ref": "#/$defs/Participant"
      },
      "type": "array",
      "title": "Participants",
      "default": []
    },
    "barge_in_events": {
      "items": {
        "$ref": "#/$defs/BargeInEvent"
      },
      "type": "array",
      "title": "Barge In Events",
      "default": []
    },
    "recording_path": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recording Path"
    },
    "twilio_recording_sid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Twilio Recording Sid"
    },
    "twilio_recording_duration": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Twilio Recording Duration"
    },
    "has_recording": {
      "type": "boolean",
      "title": "Has Recording",
      "default": false
    },
    "timeline": {
      "anyOf": [
        {
          "$ref": "#/$defs/PlaybackTimeline"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified_transcript": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Verified Transcript"
    },
    "verified_words": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Verified Words"
    },
    "transcript_accuracy": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Transcript Accuracy"
    },
    "per_turn_accuracy": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Per Turn Accuracy"
    },
    "call_analysis": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Call Analysis"
    },
    "source": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "real",
            "simulation",
            "playground"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Source"
    },
    "run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Run Id"
    },
    "score": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Score"
    },
    "score_rationale": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Score Rationale"
    },
    "parent_session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Session Id"
    },
    "fork_turn_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fork Turn Index"
    },
    "escalation": {
      "anyOf": [
        {
          "$ref": "#/$defs/EscalationState"
        },
        {
          "type": "null"
        }
      ]
    },
    "safety": {
      "anyOf": [
        {
          "$ref": "#/$defs/SafetyState"
        },
        {
          "type": "null"
        }
      ]
    },
    "human_segments": {
      "items": {
        "$ref": "#/$defs/HumanSegment"
      },
      "type": "array",
      "title": "Human Segments",
      "default": []
    },
    "audit": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "quality_score": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Quality Score"
    },
    "conversation_summary": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conversation Summary"
    },
    "safety_summary": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Safety Summary"
    }
  },
  "type": "object",
  "required": [
    "id"
  ],
  "$defs": {
    "AuditSummary": {
      "properties": {
        "event_count": {
          "type": "integer",
          "title": "Event Count",
          "default": 0
        },
        "latest_event": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latest Event"
        }
      },
      "type": "object",
      "title": "AuditSummary"
    },
    "BargeInEvent": {
      "properties": {
        "type": {
          "const": "barge_in",
          "default": "barge_in",
          "title": "Type",
          "type": "string"
        },
        "interrupted_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Interrupted Text",
          "x-phi": true
        },
        "discarded_texts": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Discarded Texts",
          "x-phi": true
        },
        "interrupted_speaker_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Interrupted Speaker Id"
        },
        "interrupting_speaker_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Interrupting Speaker Id"
        },
        "total_barge_ins": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Total Barge Ins"
        }
      },
      "title": "BargeInEvent",
      "type": "object"
    },
    "ConceptMatch": {
      "properties": {
        "concept": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Concept"
        },
        "similarity": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Similarity"
        },
        "agent_action": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Action"
        },
        "agent_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Confidence"
        },
        "agent_reasoning": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Reasoning"
        },
        "at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "At"
        }
      },
      "type": "object",
      "title": "ConceptMatch"
    },
    "ConversationConfig": {
      "properties": {
        "agent_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Id"
        },
        "agent_version": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Version"
        },
        "agent_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Name"
        },
        "context_graph_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Context Graph Id"
        },
        "context_graph_version": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Context Graph Version"
        },
        "initial_state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Initial State"
        },
        "gpt_audio_model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gpt Audio Model"
        },
        "navigation_model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Navigation Model"
        }
      },
      "type": "object",
      "title": "ConversationConfig"
    },
    "EmotionalSummary": {
      "properties": {
        "dominant_emotion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dominant Emotion"
        },
        "average_valence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Average Valence"
        },
        "average_arousal": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Average Arousal"
        },
        "peak_negative_valence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Peak Negative Valence"
        },
        "peak_negative_emotion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Peak Negative Emotion"
        },
        "emotional_shifts": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Emotional Shifts"
        },
        "final_trend": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Final Trend"
        },
        "segment_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Segment Count"
        },
        "barge_in_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Barge In Count"
        },
        "compound_emotions": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Compound Emotions"
        }
      },
      "type": "object",
      "title": "EmotionalSummary"
    },
    "EscalationState": {
      "properties": {
        "status": {
          "type": "string",
          "title": "Status",
          "default": "none"
        },
        "escalation_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Escalation Id"
        },
        "requested_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Requested At"
        },
        "connected_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Connected At"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completed At"
        },
        "trigger": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trigger"
        },
        "trigger_source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trigger Source"
        },
        "concept": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Concept"
        },
        "similarity": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Similarity"
        },
        "agent_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Confidence"
        },
        "operator_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Operator Type"
        },
        "regulatory_basis": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Regulatory Basis"
        },
        "immediate": {
          "type": "boolean",
          "title": "Immediate",
          "default": false
        },
        "risk_score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Risk Score"
        },
        "operator_entity_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Operator Entity Id"
        },
        "wait_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Wait Seconds"
        },
        "handle_time_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Handle Time Seconds"
        },
        "human_segment_turn_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Human Segment Turn Count"
        }
      },
      "type": "object",
      "title": "EscalationState"
    },
    "ForwardingDetails": {
      "properties": {
        "forward_to": {
          "type": "string",
          "title": "Forward To",
          "x-phi": true
        },
        "should_disconnect": {
          "type": "boolean",
          "title": "Should Disconnect"
        },
        "warm_transfer": {
          "type": "boolean",
          "title": "Warm Transfer",
          "default": true
        },
        "forwarded_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Forwarded At"
        }
      },
      "type": "object",
      "required": [
        "forward_to",
        "should_disconnect"
      ],
      "title": "ForwardingDetails"
    },
    "HumanSegment": {
      "properties": {
        "speaker_role": {
          "type": "string",
          "title": "Speaker Role"
        },
        "transcript": {
          "type": "string",
          "title": "Transcript",
          "x-phi": true
        },
        "timestamp": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timestamp"
        }
      },
      "type": "object",
      "required": [
        "speaker_role",
        "transcript"
      ],
      "title": "HumanSegment"
    },
    "Participant": {
      "properties": {
        "participant_id": {
          "type": "string",
          "title": "Participant Id"
        },
        "role": {
          "type": "string",
          "enum": [
            "caller",
            "agent",
            "operator"
          ],
          "title": "Role"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Display Name"
        },
        "phone_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone Number",
          "x-phi": true
        },
        "joined_at": {
          "type": "string",
          "format": "date-time",
          "title": "Joined At"
        },
        "left_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Left At"
        }
      },
      "type": "object",
      "required": [
        "participant_id",
        "role",
        "joined_at"
      ],
      "title": "Participant"
    },
    "PlaybackTimeline": {
      "properties": {
        "turns": {
          "items": {
            "$ref": "#/$defs/TurnTimeline"
          },
          "type": "array",
          "title": "Turns"
        },
        "segments": {
          "items": {
            "$ref": "#/$defs/TimelineSegment"
          },
          "type": "array",
          "title": "Segments"
        },
        "duration_seconds": {
          "type": "number",
          "title": "Duration Seconds"
        },
        "timebase": {
          "anyOf": [
            {
              "$ref": "#/$defs/TimelineTimebase"
            },
            {
              "type": "null"
            }
          ],
          "description": "Canonical timebase shared by waveform, overlays, seek state, zoom, and scroll transforms."
        },
        "lanes": {
          "items": {
            "$ref": "#/$defs/TimelineLaneDefinition"
          },
          "type": "array",
          "title": "Lanes",
          "description": "Canonical actor/system lane model. Every segment lane_id resolves against this collection.",
          "default": []
        },
        "total_user_speech_seconds": {
          "type": "number",
          "title": "Total User Speech Seconds",
          "default": 0.0
        },
        "total_agent_speech_seconds": {
          "type": "number",
          "title": "Total Agent Speech Seconds",
          "default": 0.0
        },
        "total_silence_seconds": {
          "type": "number",
          "title": "Total Silence Seconds",
          "default": 0.0
        },
        "avg_processing_gap_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avg Processing Gap Ms"
        },
        "max_processing_gap_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Max Processing Gap Ms"
        },
        "avg_perceived_latency_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Avg Perceived Latency Ms"
        }
      },
      "type": "object",
      "required": [
        "turns",
        "segments",
        "duration_seconds"
      ],
      "title": "PlaybackTimeline"
    },
    "SafetyState": {
      "properties": {
        "peak_concern_level": {
          "type": "integer",
          "title": "Peak Concern Level",
          "default": 0
        },
        "concern_turn_count": {
          "type": "integer",
          "title": "Concern Turn Count",
          "default": 0
        },
        "trajectory": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory"
        },
        "triage_history": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Triage History",
          "default": []
        },
        "concept_matches": {
          "items": {
            "$ref": "#/$defs/ConceptMatch"
          },
          "type": "array",
          "title": "Concept Matches",
          "default": []
        }
      },
      "type": "object",
      "title": "SafetyState"
    },
    "StateTransition": {
      "properties": {
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Type"
        },
        "previous_state": {
          "type": "string",
          "title": "Previous State",
          "default": ""
        },
        "next_state": {
          "type": "string",
          "title": "Next State",
          "default": ""
        },
        "annotation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Annotation"
        },
        "nav_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nav Ms"
        },
        "from_state": {
          "type": "string",
          "title": "From State",
          "readOnly": true
        },
        "to_state": {
          "type": "string",
          "title": "To State",
          "readOnly": true
        }
      },
      "type": "object",
      "required": [
        "from_state",
        "to_state"
      ],
      "title": "StateTransition"
    },
    "TimelineActor": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "agent",
            "human",
            "operator",
            "system",
            "tool"
          ],
          "title": "Kind"
        },
        "role": {
          "type": "string",
          "enum": [
            "agent",
            "caller",
            "operator",
            "runtime",
            "state",
            "tool"
          ],
          "title": "Role"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "participant_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Participant Id"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "role",
        "label"
      ],
      "title": "TimelineActor"
    },
    "TimelineLaneDefinition": {
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 160,
          "minLength": 1,
          "title": "Id",
          "description": "Stable canonical lane id used by timeline visualizations. Segments attach via TimelineSegment.lane_id; consumers should not re-infer lanes from CSS or pixel positions."
        },
        "track": {
          "type": "string",
          "enum": [
            "agent",
            "caller",
            "operator",
            "system",
            "tool"
          ],
          "title": "Track",
          "description": "High-level actor-semantic track for styling and grouping."
        },
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Display label for the lane."
        },
        "order": {
          "type": "integer",
          "title": "Order",
          "description": "Stable vertical order within the timeline lane model."
        },
        "actor": {
          "anyOf": [
            {
              "$ref": "#/$defs/TimelineActor"
            },
            {
              "type": "null"
            }
          ],
          "description": "Actor represented by this lane when applicable."
        }
      },
      "type": "object",
      "required": [
        "id",
        "track",
        "label",
        "order"
      ],
      "title": "TimelineLaneDefinition"
    },
    "TimelineSegment": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "agent_speech",
            "barge_in",
            "caller_speech",
            "filler_hesitation",
            "filler_nav",
            "greeting",
            "interrupted_speech",
            "processing_gap",
            "silence",
            "silence_check",
            "state_transition",
            "tool_call"
          ],
          "title": "Type"
        },
        "lane": {
          "type": "string",
          "enum": [
            "agent",
            "caller",
            "events",
            "operator",
            "system",
            "tool"
          ],
          "title": "Lane"
        },
        "track": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "agent",
                "caller",
                "operator",
                "system",
                "tool"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Track",
          "description": "Actor-semantic display track for the segment. Inferred for legacy producers."
        },
        "lane_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 160,
              "minLength": 1
            },
            {
              "type": "null"
            }
          ],
          "title": "Lane Id",
          "description": "Canonical lane id. Must match PlaybackTimeline.lanes[].id after platform normalization."
        },
        "order": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Order",
          "description": "Canonical event order after platform time/lane normalization."
        },
        "actor": {
          "anyOf": [
            {
              "$ref": "#/$defs/TimelineActor"
            },
            {
              "type": "null"
            }
          ],
          "description": "Actor responsible for the segment. Inferred for legacy producers."
        },
        "start": {
          "type": "number",
          "title": "Start"
        },
        "end": {
          "type": "number",
          "title": "End"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "turn_index": {
          "type": "integer",
          "title": "Turn Index"
        },
        "stt_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stt Confidence"
        },
        "eot_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Eot Confidence"
        },
        "audio_window_start": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Window Start"
        },
        "audio_window_end": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Window End"
        },
        "engine_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Engine Ms"
        },
        "nav_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nav Ms"
        },
        "render_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Render Ms"
        },
        "audio_ttfb_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Ttfb Ms"
        },
        "e2e_ttfb_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "E2E Ttfb Ms"
        },
        "tool_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Name"
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Call Id"
        },
        "parent_call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Call Id"
        },
        "integration_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Integration Name"
        },
        "endpoint_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Endpoint Name"
        },
        "protocol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Protocol"
        },
        "succeeded": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Succeeded"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms"
        },
        "from_state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "From State"
        },
        "to_state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "To State"
        },
        "emotion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Emotion"
        },
        "valence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Valence"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State"
        }
      },
      "type": "object",
      "required": [
        "type",
        "lane",
        "start",
        "end",
        "label",
        "turn_index"
      ],
      "title": "TimelineSegment"
    },
    "TimelineTimebase": {
      "properties": {
        "unit": {
          "type": "string",
          "const": "seconds",
          "title": "Unit",
          "description": "Timeline offsets are always seconds.",
          "default": "seconds"
        },
        "origin": {
          "type": "string",
          "enum": [
            "media_start",
            "call_start",
            "synthetic"
          ],
          "title": "Origin",
          "description": "Zero point used for segment start/end offsets.",
          "default": "media_start"
        },
        "start": {
          "type": "number",
          "title": "Start",
          "description": "Visible/canonical timeline range start in seconds.",
          "default": 0.0
        },
        "end": {
          "type": "number",
          "title": "End",
          "description": "Visible/canonical timeline range end in seconds.",
          "default": 0.0
        }
      },
      "type": "object",
      "title": "TimelineTimebase"
    },
    "ToolCall": {
      "properties": {
        "tool_name": {
          "type": "string",
          "title": "Tool Name"
        },
        "call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Call Id"
        },
        "input": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Input"
        },
        "output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Output"
        },
        "output_truncated": {
          "type": "boolean",
          "title": "Output Truncated",
          "default": false
        },
        "output_original_length": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Output Original Length"
        },
        "output_truncated_to": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Output Truncated To"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms"
        },
        "succeeded": {
          "type": "boolean",
          "title": "Succeeded",
          "default": true
        },
        "error_message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Message"
        },
        "integration_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Integration Name"
        },
        "endpoint_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Endpoint Name"
        },
        "protocol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Protocol"
        }
      },
      "type": "object",
      "required": [
        "tool_name"
      ],
      "title": "ToolCall"
    },
    "Turn": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id"
        },
        "trigger": {
          "type": "string",
          "title": "Trigger",
          "default": ""
        },
        "user_transcript": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Transcript",
          "x-phi": true
        },
        "agent_transcript": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Transcript",
          "x-phi": true
        },
        "agent_action": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Action"
        },
        "interrupted": {
          "type": "boolean",
          "title": "Interrupted",
          "default": false
        },
        "filler_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filler Type"
        },
        "speaker_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Speaker Id"
        },
        "speaker_role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Speaker Role"
        },
        "emotion_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Emotion Label"
        },
        "emotion_valence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Emotion Valence"
        },
        "compound_emotions": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Compound Emotions"
        },
        "stt_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stt Confidence"
        },
        "eot_confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Eot Confidence"
        },
        "state": {
          "type": "string",
          "title": "State",
          "default": ""
        },
        "tool_calls": {
          "items": {
            "$ref": "#/$defs/ToolCall"
          },
          "type": "array",
          "title": "Tool Calls",
          "default": []
        },
        "state_transitions": {
          "items": {
            "$ref": "#/$defs/StateTransition"
          },
          "type": "array",
          "title": "State Transitions",
          "default": []
        },
        "inner_thoughts": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Inner Thoughts",
          "default": []
        },
        "timestamp": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timestamp"
        },
        "engine_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Engine Ms"
        },
        "user_speech_start_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Speech Start Ms"
        },
        "user_speech_end_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Speech End Ms"
        },
        "agent_speech_start_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Speech Start Ms"
        },
        "agent_speech_end_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Speech End Ms"
        },
        "audio_window_start_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Window Start Ms"
        },
        "audio_window_end_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Window End Ms"
        },
        "nav_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Nav Ms"
        },
        "render_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Render Ms"
        },
        "audio_ttfb_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Ttfb Ms"
        },
        "signal_kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Signal Kind"
        },
        "signal_source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Signal Source"
        },
        "state_before": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State Before"
        },
        "state_after": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State After"
        },
        "primary_effect_kind": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Primary Effect Kind"
        },
        "tool_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Name"
        },
        "tool_succeeded": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Succeeded"
        },
        "tool_ms": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Ms"
        },
        "modality": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Modality"
        },
        "empathy_tier": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Empathy Tier"
        },
        "decision_bearing": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Decision Bearing"
        }
      },
      "type": "object",
      "title": "Turn"
    },
    "TurnTimeline": {
      "properties": {
        "turn_index": {
          "type": "integer",
          "title": "Turn Index"
        },
        "seek_to": {
          "type": "number",
          "title": "Seek To"
        },
        "active_start": {
          "type": "number",
          "title": "Active Start"
        },
        "active_end": {
          "type": "number",
          "title": "Active End"
        }
      },
      "type": "object",
      "required": [
        "turn_index",
        "seek_to",
        "active_start",
        "active_end"
      ],
      "title": "TurnTimeline"
    }
  }
}