{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/voixcall-com/json-schema/voixcall-com-call-detail-schema.json",
  "title": "CallDetail",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/voixcall-com-openapi.yml#/components/schemas/CallDetail",
  "additionalProperties": false,
  "properties": {
    "answered_at": {
      "description": "Not recorded for app calls today: null.",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "cost": {
      "description": "The recorded charge, decimal string with two decimals; null unless status is completed.",
      "type": [
        "string",
        "null"
      ]
    },
    "cost_so_far": {
      "description": "Charge accrued so far, decimal string, only while status is active; null otherwise (including initiating and connecting). Counted from started_at, so it includes ring time until answered_at is recorded.",
      "type": [
        "string",
        "null"
      ]
    },
    "counterparty_name": {
      "description": "Name of the contact whose stored phone number exactly matches the other party (to_number outbound, from_number inbound); a contact saved in another format, such as with spaces, does not match. Requires contacts:read, else null.",
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "enum": [
        "USD"
      ],
      "type": "string"
    },
    "direction": {
      "enum": [
        "outbound",
        "inbound"
      ],
      "type": "string"
    },
    "duration_seconds": {
      "description": "Billable seconds once the call has ended.",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "ended_at": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "from_number": {
      "description": "E.164 caller ID used.",
      "type": "string"
    },
    "id": {
      "pattern": "^call_[0-9a-f]{32}$",
      "type": "string"
    },
    "is_recorded": {
      "type": "boolean"
    },
    "livemode": {
      "type": "boolean"
    },
    "max_duration_seconds": {
      "description": "Time limit the balance allowed when the call was set up, while status is active. Derived from the balance, so it needs credits:read; null without it. Not recorded for app-placed personal calls today, so null for them.",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "object": {
      "description": "Always \"call\".",
      "enum": [
        "call"
      ],
      "type": "string"
    },
    "origin": {
      "description": "Which surface placed the call.",
      "enum": [
        "app",
        "api",
        "mcp"
      ],
      "type": "string"
    },
    "placement": {
      "description": "How the call was set up: from the app or browser (webrtc), by ringing your phone first (callback), or received on your number (inbound).",
      "enum": [
        "webrtc",
        "callback",
        "inbound"
      ],
      "type": "string"
    },
    "rate_per_minute": {
      "description": "The per-minute rate fixed at call setup and charged for this call, decimal string with four decimals.",
      "pattern": "^[0-9]+\\.[0-9]{4}$",
      "type": "string"
    },
    "session": {
      "anyOf": [
        {
          "$ref": "#/$defs/CallSession"
        },
        {
          "type": "null"
        }
      ],
      "description": "Callback calls only; null for app and inbound calls."
    },
    "started_at": {
      "format": "date-time",
      "type": "string"
    },
    "status": {
      "description": "initiating, connecting, active, completed, failed, no-answer, busy, canceled; callback calls add ringing_you and ringing_them. New values may appear.",
      "type": "string"
    },
    "to_number": {
      "description": "E.164.",
      "type": "string"
    },
    "transcript": {
      "anyOf": [
        {
          "$ref": "#/$defs/Transcript"
        },
        {
          "type": "null"
        }
      ],
      "description": "The call's summary-level transcript (redacted, no utterances) with expand[]=transcript, when the call has one; null otherwise. Needs transcripts:read and the account setting \"Allow connected apps to read call summaries\" (Settings → Connected apps), else expand[]=transcript answers 403."
    },
    "transcript_status": {
      "description": "null when no transcript was requested.",
      "enum": [
        "pending",
        "processing",
        "completed",
        "failed",
        null
      ],
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "cost_so_far",
    "max_duration_seconds",
    "transcript",
    "id",
    "object",
    "livemode",
    "direction",
    "placement",
    "origin",
    "status",
    "to_number",
    "from_number",
    "counterparty_name",
    "started_at",
    "answered_at",
    "ended_at",
    "duration_seconds",
    "rate_per_minute",
    "currency",
    "cost",
    "is_recorded",
    "transcript_status",
    "session"
  ],
  "type": "object",
  "$defs": {
    "CallSession": {
      "additionalProperties": false,
      "properties": {
        "hangup_cause": {
          "type": [
            "string",
            "null"
          ]
        },
        "leg_a_status": {
          "type": "string"
        },
        "leg_b_status": {
          "type": "string"
        },
        "ring_number": {
          "description": "The verified number that was rung.",
          "type": "string"
        }
      },
      "required": [
        "ring_number",
        "leg_a_status",
        "leg_b_status",
        "hangup_cause"
      ],
      "type": "object"
    },
    "ReferenceNumber": {
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "label",
        "value"
      ],
      "type": "object"
    },
    "Transcript": {
      "additionalProperties": false,
      "properties": {
        "action_items": {
          "description": "Follow-ups from the call, redacted like summary.",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "call_id": {
          "pattern": "^call_[0-9a-f]{32}$",
          "type": "string"
        },
        "completed_at": {
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "duration_seconds": {
          "description": "Length of the transcribed recording.",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "id": {
          "pattern": "^tr_[0-9a-f]{32}$",
          "type": "string"
        },
        "language": {
          "description": "BCP 47 tag when detected.",
          "type": [
            "string",
            "null"
          ]
        },
        "livemode": {
          "type": "boolean"
        },
        "object": {
          "description": "Always \"transcript\".",
          "enum": [
            "transcript"
          ],
          "type": "string"
        },
        "reference_numbers": {
          "description": "Facts worth copying out of the call (case ids, dates, amounts), redacted like summary with label and value checked together. An entry whose value was a sensitive number stays in the list with the value [redacted], so you know one was mentioned; the full value is only in the VoixCall app.",
          "items": {
            "$ref": "#/$defs/ReferenceNumber"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "status": {
          "description": "pending and processing: being made. completed: summary available. failed: transcription failed (it can be requested again once it has stopped retrying). expired: removed by the transcript retention period; the summary and utterances are gone. New values may appear.",
          "enum": [
            "pending",
            "processing",
            "completed",
            "failed",
            "expired"
          ],
          "type": "string"
        },
        "summary": {
          "description": "AI summary of the call, redacted: when it holds six or more digits in all, or a word such as code, OTP, PIN, password, card or account, every number in it reads [redacted]; keypad entries always do. null until completed, and once expired.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "object",
        "livemode",
        "call_id",
        "status",
        "summary",
        "action_items",
        "reference_numbers",
        "language",
        "duration_seconds",
        "completed_at"
      ],
      "type": "object"
    }
  }
}