{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sagaris/json-schema/sagaris-call-schema.json",
  "title": "Call",
  "description": "One call. `handled_by` is ai_receptionist when the AI receptionist took it.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sagaris-openapi.json#/components/schemas/Call",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "direction": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": [
        "string",
        "null"
      ]
    },
    "caller_phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "caller_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "called_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "contact_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "route_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "handled_by": {
      "type": "string",
      "enum": [
        "ai_receptionist",
        "human"
      ]
    },
    "ai_outcome": {
      "type": [
        "string",
        "null"
      ]
    },
    "handoff_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "answered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "ended_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "duration_seconds": {
      "type": [
        "integer",
        "null"
      ]
    },
    "ai_seconds": {
      "type": [
        "number",
        "null"
      ]
    },
    "recording_available": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "handled_by",
    "recording_available"
  ]
}