Skip to content

Hang up a voice call

View .md
POST

End an active voice call. The call must still be queued, ringing or in progress; a call that already ended answers 409. Not available with test-mode API keys.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • callIdstringrequired

    Voice call ID.

Responses

202Hang up accepted.
  • callobjectrequired
    15 properties
    • idstringrequired
    • directionstringrequired

      Whether the call was placed by Zavu (outbound) or received from a caller (inbound).

      One ofinboundoutbound
    • fromstringrequired

      Caller phone number in E.164 format. Your sender's number for outbound calls; the caller's number for inbound calls.

    • tostringrequired

      Callee phone number in E.164 format.

    • statusstringrequired

      Lifecycle status of a voice call. - queued: outbound call created, not yet dialing. - ringing: dialing (outbound) or received and ringing (inbound). - in_progress: answered, the agent is connected. - completed: ended after a conversation. - failed: could not be completed. - busy: the line was busy. - no_answer: rang but was not answered. - canceled: canceled before it was answered.

      One ofqueuedringingin_progresscompletedfailedbusyno_answercanceled
    • endReasonstringnullable

      Why the call ended (e.g. agent_ended, max_duration, transfer, hangup). Present once the call is no longer active.

    • answeredAtstring<date-time>nullable

      When the call was answered.

    • endedAtstring<date-time>nullable

      When the call ended.

    • durationSecondsintegernullable

      Billable talk time in seconds, measured from answer to hangup.

    • turnCountintegernullable

      Number of conversation turns exchanged during the call.

    • transcriptobject[]

      Ordered transcript of the call. Included when retrieving a single call; omitted from list responses.

      5 properties
      • seqintegerrequired

        Ordinal position of the turn within the call, starting at 0.

      • rolestringrequired

        Who produced the turn. tool records a tool call the agent made during the conversation.

        One ofuserassistanttool
      • textstringrequired

        Transcribed speech for user and assistant turns, or a JSON summary of the tool call for tool turns.

      • startedAtstring<date-time>nullable

        When the turn started.

      • endedAtstring<date-time>nullable

        When the turn ended.

    • costnumbernullable

      Total cost of the call in USD, combining the managed voice pipeline per-minute charge, telephony, and, on an agent that runs a premium model, that model's tokens. Available once the call has ended. Tokens are charged between 30 minutes and 24 hours after the call ends, so the figure can grow until then.

    • metadataobject

      Arbitrary metadata you attached when creating the call.

      1 properties
      • {key}string
    • createdAtstring<date-time>required
    • updatedAtstring<date-time>
400Hang up is not available with test-mode API keys.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
404Call not found.
  • codestringrequired
  • messagestringrequired
  • detailsobject
409The call is not active and cannot be hung up.
  • codestringrequired
  • messagestringrequired
  • detailsobject