Calls

Calls will be returned to each active webhook recipient URL as a webhook event.

export type APICall = {
  call_id: string,
  agent_id: string,
  outcome: string,
  outcome_sentiment: "positive" | "negative" | "neutral",
  outcome_justification: string,
  status: CallStatuses,
  appointment_date: string, // the timezone-aware ISO 8601 date string, eg "2030-07-15T14:00:00.000-07:00" (luxon DateTime formatting)
  summary: string,
  started_at: string, // the call start time in UTC ISO 8601 format, eg "2024-04-27T23:52:10.000Z"
  ended_at: string, // call end time in UTC ISO 8601 format
  call_length: string, // call duration in minutes, eg 0.5 
  recording_wav: string,
  transcript: string,
  ehr: "healthie" | "none", // the EHR workflow this call was run on

  // any variables will be at the top level
}

Variables

Strings

“string” type variables represent a single string, eg "patient_first_name": "John"
“string[]” type variables represent a series of strings, eg "physicians": ["Physician One", "Physician Two", ...]

Numbers

“number” type variables represent a single number, eg "cost": 5
“number[]” types variables represent a series of numbers, eg "costs": [1, 2, 3.5, ...]

Dates

“date” type variables represent a single date, eg "appointment_date": "2030-07-15T14:00:00.000-07:00" (luxon DateTime formatting)
“date[]” type variables represent a series of dates, eg "available_dates": ["2030-07-15T14:00:00.000-07:00", "2030-07-16T14:00:00.000-07:00"]

Phone Numbers

“phone_number” type variables represent a single phone number, eg "phone_number": "+11994816785" (E.164 formatting)
“phone_number[]” type variables represent a series of phone numbers, eg "phone_numbers[]": ["+11994816785", "+15673643554"]

Special Variables

patient_phone_number and live_transfer_number will not be injected into the prompt but instead be used for call mechanics, which is why they are their own distinct types.

The following are also applicable:

  • patient_first_name: reserved type for patient’s first name
  • patient_last_name: reserved type for the patient’s last name
  • preferred_contact_method: reserved type for the patient’s preferred contact method
  • preferred_language: reserved type for the patient’s preferred language
  • email: reserved type for patient’s email

Variable Errors

Type failures will collect all issues and return them as the error message, eg: Invalid input: Received "+17223820171" but declared type is date[], Received "2030-07-15T14:00:00.000-07:00" but declared type is phone_number[]

Call Statuses

enum CallStatuses {
  calling = "calling",
  complete = "complete",
  error = "error",
  voicemail = "voicemail"
}

Webhook Payloads

type WebhookPayload = {
  type: "call",
  data: Call
}