{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cekura-ai/json-schema/cekura-ai-call-log-detail-schema.json",
  "title": "CallLogDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cekura-ai-observability-api-openapi.yml#/components/schemas/CallLogDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "duration": {
      "type": "string",
      "readOnly": true,
      "description": "Call duration in minutes in MM:SS format.\nExample: `01:10`"
    },
    "voice_recording_url": {
      "type": "string",
      "readOnly": true,
      "description": "URL to access the voice recording.\nExample: `\"https://storage.example.com/recordings/call_123_20240315.mp3\"`"
    },
    "critical_categories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CallLogCriticalCategories"
      },
      "readOnly": true,
      "description": "Critical categories from call evaluation"
    },
    "transcript_object": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CallLogTranscriptObject"
      },
      "readOnly": true,
      "description": "Structured transcript data with timestamps.\nExample: \n```json\n[\n    {\n        \"role\": \"Testing Agent\",\n        \"content\": \"Hello\",\n        \"start_time\": 1.2,\n        \"end_time\": 1.8\n    },\n    {\n        \"role\": \"Main Agent\",\n        \"content\": \"Hello, how can I help you today?\",\n        \"start_time\": 1.8,\n        \"end_time\": 2.5\n    }\n]`"
    },
    "status": {
      "enum": [
        "success",
        "failure",
        "reviewed_success",
        "reviewed_failure"
      ],
      "type": "string",
      "description": "* `success` - Success\n* `failure` - Failure\n* `reviewed_success` - Reviewed Success\n* `reviewed_failure` - Reviewed Failure",
      "x-spec-enum-id": "a5dfbbcee6f2a6ce"
    },
    "agent_id": {
      "type": "string",
      "description": "Agent ID.\nExample: `2142`"
    },
    "agent_name": {
      "type": "string",
      "readOnly": true,
      "description": "Agent name"
    },
    "agent_version": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {},
      "readOnly": true,
      "description": "The agent version (history record) that was live when this call was ingested, or null."
    },
    "evaluation": {
      "allOf": [
        {
          "$ref": "#/$defs/Evaluation"
        }
      ],
      "readOnly": true,
      "description": "Evaluation results for the call.\nExample: \n```json\n{\n    \"metrics\": [\n        {\n            \"id\": 35,\n            \"name\": \"Instruction Follow\",\n            \"type\": \"binary\",\n            \"score\": 0,\n            \"explanation\": [\"Agent failed to follow the opening script\", \"Missed key product information\"],\n            \"vocera_defined_metric_code\": \"5dedc41b\",\n            \"function_name\": \"check_critical_deviations\",\n            \"extra\": {\n                \"categories\": [\n                    {\n                        \"category_id\": 5,\n                        \"category\": \"Script Adherence Issue\",\n                        \"deviation\": \"Agent deviated from required script\",\n                        \"priority\": \"critical\"\n                    }\n                ]\n            }\n        },\n        {\n            \"id\": 18,\n            \"name\": \"Customer Satisfaction\",\n            \"type\": \"binary\",\n            \"score\": 5,\n            \"explanation\": [\"Customer expressed satisfaction with service\"]\n        }\n    ]\n}\n```"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "readOnly": true,
      "description": "Additional call metadata.\nExample: \n```json\n{\n    \"ended_reason\": \"customer-ended-call\",\n    \"ringing_duration\": 3.941,\n    \"call_type\": \"inbound\"\n}\n```"
    },
    "dynamic_variables": {
      "type": "object",
      "additionalProperties": {},
      "readOnly": true,
      "description": "Dynamic Variables used in the call.\nExample: \n```json\n{\n    \"customer_name\": \"John Doe\",\n    \"order_id\": \"ORD-12345\",\n    \"product_type\": \"premium\"\n}\n```"
    },
    "testing_channel_index": {
      "type": [
        "integer",
        "null"
      ],
      "readOnly": true,
      "description": "The channel index of the testing agent in the audio recording"
    },
    "waveform": {
      "type": "object",
      "additionalProperties": {},
      "readOnly": true,
      "description": "Amplitude envelope of the recording, one array of values per audio channel, so a waveform can be drawn without downloading the audio. Null for recordings processed before peaks were stored."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "When the call occurred.\nExample: `2024-03-15T10:15:45Z`"
    },
    "success": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the call was successful.\nExample: `true` or `false`"
    },
    "is_reviewed": {
      "type": "boolean",
      "description": "Whether the call has been reviewed.\nExample: `true` or `false`"
    },
    "feedback": {
      "type": "string",
      "description": "Feedback about the call.\nExample: `\"Great Call\"`"
    },
    "rubric": {
      "oneOf": [
        {},
        {
          "type": "null"
        }
      ],
      "description": "\nDetailed rubric evaluation data\nExample:\n```json\n[\n    {\n        \"metric_id\": 100,\n        \"metric_name\": \"Call Quality\",\n        \"value\": 5,\n        \"explanation\": [\"The response was accurate\"],\n        \"passed\": true,\n        \"conditions\": \"score gte 5\",\n        \"expected_conditions\": {\"operator\": \"and\", \"conditions\": [{\"field\": \"score\", \"op\": \"gte\", \"value\": 5}]}\n    }\n]\n```\n"
    },
    "transcript": {
      "type": "string",
      "description": "Full text transcript of the call.\nExample: \n```text\n[00:01] Testing Agent: Hello. \n[00:02] Main Agent: Hello, how can I help you today?\n[00:03] Testing Agent: Well, I mean, sure. What time exactly are we talking about here\n[00:04] Main Agent: 6 PM.\n[00:05] Testing Agent: Great. I'll book that for you. Just a sec.\n[00:06] Main Agent: Okay.\n```\n"
    },
    "call_ended_reason": {
      "type": "string",
      "description": "Reason why the call ended.\nExample: \n- `\"customer-ended-call\"`\n- `\"agent-ended-call\"`\n",
      "maxLength": 100
    },
    "dropoff_point": {
      "type": "string",
      "description": "Point in conversation where user disengaged.\nExample: `\"end of conversation as no queries remaining\"`",
      "maxLength": 1000
    },
    "topic": {
      "type": "string",
      "description": "Topic of the call.\nExample: \n- `\"product_inquiry\"`\n- `\"technical_support\"`\n",
      "maxLength": 1000
    },
    "customer_number": {
      "type": "string",
      "description": "Customer's phone number or identifier.\nExample: \n- `\"+1234567890\"`\n- `\"customer_abc123\"`\n",
      "maxLength": 100
    },
    "user_generated_transcript": {
      "oneOf": [
        {},
        {
          "type": "null"
        }
      ],
      "description": "Manually created or corrected transcript data.\nExample: \n```json\n[\n    {\n        \"role\": \"Testing Agent\",\n        \"content\": \"I need help with my order\",\n        \"timestamp\": \"00:15\"\n    }\n]`"
    },
    "error_message": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "When this record was created.\nExample: `2024-03-15T10:30:45Z`"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "When this record was last updated.\nExample: `2024-03-15T10:35:11Z`"
    },
    "call_id": {
      "type": "string",
      "description": "Unique identifier for the call.\nExample: \n- `\"call_abc123xyz\"`\n- `\"stereo_audio_session_456\"`",
      "maxLength": 100
    },
    "trace_id": {
      "type": "string",
      "description": "OpenTelemetry trace ID (32-char hex). Set when OTel tracing is enabled.",
      "maxLength": 32
    },
    "is_log_present": {
      "type": "boolean",
      "description": "Whether provider execution logs are stored for this call."
    },
    "agent": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Agent ID"
    },
    "project": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Project ID (denormalized from agent for query performance)"
    }
  },
  "required": [
    "call_id"
  ],
  "$defs": {
    "CallLogCriticalCategories": {
      "type": "object",
      "properties": {
        "category_id": {
          "type": "integer",
          "description": "Category ID"
        },
        "category": {
          "type": "string",
          "description": "Category name"
        },
        "deviation": {
          "type": "number",
          "format": "double",
          "description": "Deviation"
        },
        "wrongly_marked": {
          "type": "boolean",
          "description": "Whether the category was wrongly marked"
        },
        "feedback": {
          "type": "string",
          "description": "Feedback"
        },
        "priority": {
          "enum": [
            "critical",
            "non-critical",
            "not_a_bug"
          ],
          "type": "string",
          "x-spec-enum-id": "6b5f38576e0a1903",
          "description": "Priority\n\n* `critical` - Critical\n* `non-critical` - Non Critical\n* `not_a_bug` - Not A Bug"
        }
      },
      "required": [
        "category",
        "category_id",
        "deviation",
        "feedback",
        "priority",
        "wrongly_marked"
      ]
    },
    "CallLogListSerializerMetricsWithExplanation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Metric ID"
        },
        "name": {
          "type": "string",
          "description": "Metric name"
        },
        "type": {
          "type": "string",
          "description": "Metric type"
        },
        "score": {
          "type": "number",
          "format": "double",
          "description": "Evaluated metric score, Present if metrictype is not enum"
        },
        "enum": {
          "type": "string",
          "description": "Metric enum, Present if type is enum"
        },
        "value": {
          "type": "string",
          "description": "Evaluated metric value, Present if metric type is enum"
        },
        "explanation": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "Explanation of the metric"
          }
        },
        "extra": {
          "type": "object",
          "additionalProperties": {},
          "description": "Evaluated metric extra data"
        }
      },
      "required": [
        "enum",
        "explanation",
        "extra",
        "id",
        "name",
        "score",
        "type",
        "value"
      ]
    },
    "CallLogTranscriptObject": {
      "type": "object",
      "properties": {
        "role": {
          "type": "string",
          "description": "Role of the message"
        },
        "content": {
          "type": "string",
          "description": "Content of the message"
        },
        "timestamp": {
          "type": "number",
          "format": "double",
          "description": "Timestamp of the message"
        }
      },
      "required": [
        "content",
        "role",
        "timestamp"
      ]
    },
    "Evaluation": {
      "type": "object",
      "properties": {
        "metrics": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CallLogListSerializerMetricsWithExplanation"
          }
        }
      },
      "required": [
        "metrics"
      ]
    }
  }
}