{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/callforme-tel/json-schema/callforme-tel-call-schema.json",
  "title": "Call",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/callforme-tel-openapi.yml#/components/schemas/Call",
  "type": "object",
  "properties": {
    "call_id": {
      "type": "string",
      "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "calling",
        "in_progress",
        "ended",
        "failed"
      ]
    },
    "to": {
      "type": "string",
      "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
    },
    "business_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "demo": {
      "type": "boolean"
    },
    "goal": {
      "type": "string",
      "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
    },
    "pending_question": {
      "type": [
        "string",
        "null"
      ],
      "description": "The business is waiting: answer within answer_within_seconds via POST /v1/calls/{id}/answer"
    },
    "pending_question_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "answer_within_seconds": {
      "type": [
        "integer",
        "null"
      ]
    },
    "answers": {
      "type": "array",
      "description": "One per question, in the order asked",
      "items": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
          },
          "answer": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "unanswered_questions": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
      }
    },
    "outcome": {
      "oneOf": [
        {
          "$ref": "#/$defs/Outcome"
        },
        {
          "type": "null"
        }
      ],
      "description": "Present once the call has ended and been analyzed"
    },
    "analysis_pending": {
      "type": "boolean"
    },
    "transcript": {
      "type": [
        "string",
        "null"
      ],
      "description": "Per ?transcript=none|new|full"
    },
    "transcript_cursor": {
      "type": "integer"
    },
    "transcript_lines": {
      "type": "integer"
    },
    "duration_seconds": {
      "type": [
        "integer",
        "null"
      ]
    },
    "cost": {
      "type": "string"
    },
    "ended_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "ended_reason_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "recording_url": {
      "type": "string",
      "description": "Audio of the whole call (ended calls, owner's key only)"
    },
    "listen_url": {
      "type": "string",
      "description": "Private page that plays the recording with the summary and transcript; give this to a person (ended calls, owner's key only)"
    },
    "created_at": {
      "type": "string",
      "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
    },
    "next": {
      "type": "string",
      "description": "What the agent should do next"
    }
  },
  "$defs": {
    "Outcome": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        },
        "type": {
          "type": "string",
          "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
        },
        "summary": {
          "type": "string",
          "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
        },
        "confirmation_number": {
          "type": [
            "string",
            "null"
          ]
        },
        "price_quoted": {
          "type": [
            "string",
            "null"
          ]
        },
        "booked_time": {
          "type": [
            "string",
            "null"
          ]
        },
        "appointment_time": {
          "type": [
            "string",
            "null"
          ]
        },
        "earliest_available": {
          "type": [
            "string",
            "null"
          ]
        },
        "next_steps": {
          "type": [
            "string",
            "null"
          ]
        },
        "business_needed": {
          "type": [
            "string",
            "null"
          ]
        },
        "unanswered_questions": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
          }
        },
        "deviations": {
          "type": "array",
          "items": {
            "type": "string",
            "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
          }
        },
        "reached_human": {
          "type": "boolean"
        },
        "reached_voicemail": {
          "type": "boolean"
        },
        "language_heard": {
          "type": [
            "string",
            "null"
          ]
        },
        "auto_redial": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "call_id": {
              "type": "string",
              "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
            },
            "language": {
              "type": "string",
              "description": "The answer or instruction, e.g. \"2019 Toyota RAV4\" or \"Yes, book 7:30\"."
            }
          }
        }
      }
    }
  }
}