Call Commands

Hang up the call.

Expected Webhooks:

  • call.hangup
  • call.recording.saved
post/calls/{call_control_id}/actions/hangup

Request

  • Base URL
    https://api.telnyx.com/v2
  • URL
    https://api.telnyx.com/v2/calls/{call_control_id}/actions/hangup
  • Auth
    HTTP bearer

Path parameters

call_control_idstring required

Unique identifier and token for controlling the call

Request body

client_statestring

Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.

command_idstring

Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.

reasonstring

Text for the SIP Reason header (RFC 3326) sent when cancelling an unanswered outbound leg. The SIP CANCEL carries Reason: SIP;cause=200;text="<reason>"; phones such as Poly and Yealink use it to suppress the missed-call entry for a call answered elsewhere. Has no effect on an answered leg or an inbound leg. A hangup sent before the leg's call.initiated webhook still hangs up the leg, but without the Reason header. Must not contain ", \, control characters, or characters outside the Basic Multilingual Plane (such as emoji); invalid values are rejected with a 422.

Example request

{
  "client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
  "command_id": "891510ac-f3e4-11e8-af5b-de00688a4901"
}

Response

Successful response upon making a call control command.

Example response

{
  "data": {
    "result": "ok"
  }
}

Changes