{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosvoice-com/json-schema/cosvoice-com-call-schema.json",
  "title": "Call",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosvoice-com-openapi.yml#/components/schemas/Call",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Call id."
    },
    "direction": {
      "type": "string",
      "enum": [
        "inbound",
        "outbound"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "ringing",
        "in-progress",
        "completed",
        "no-answer",
        "busy",
        "failed"
      ]
    },
    "to": {
      "type": "string",
      "description": "The other party, E.164."
    },
    "from": {
      "type": "string",
      "description": "The line's number, E.164."
    },
    "outcome": {
      "type": "string",
      "description": "One line: what happened."
    },
    "summary": {
      "type": "string",
      "description": "A short written account of the call."
    },
    "action_items": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "object",
      "additionalProperties": true,
      "description": "Details the line captured: names, amounts, dates, reference numbers."
    },
    "transcript": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "assistant",
              "caller"
            ]
          },
          "text": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "duration_seconds": {
      "type": "integer"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}