Agent Number

POST /voice/hangup

End an active voice call

Description

Disconnect a live call by `call_id`. Returns once the hangup is dispatched to the phone; the presence WS will emit an `ended` event when the carrier confirms teardown. Equivalent to the MCP `hangup_call` tool.

Authentication

Bearer required. Send Authorization: Bearer <token>.

Code samples

Pick your runtime. Every sample is in the page source — switching tabs is for your eyes.

curl https://agentnumber.really.com/voice/hangup \
  --request POST \
  --header 'Authorization: Bearer <your-token>' \
  --header 'content-type: application/json' \
  --data '{
  "call_id": "call_example_0000000000000000000000"
}'

Request body

FieldTypeDescription
call_id required string Server-assigned call id from `/voice/dial` or a presence ringing event.
Example: call_example_0000000000000000000000

Example body

{
  "call_id": "call_example_0000000000000000000000"
}

Responses

200 Hangup dispatched.

{
  "call_id": "call_example_0000000000000000000000",
  "device_id": "device_example_a",
  "status": "hangup_sent"
}

400 Body parse error (`invalid_json`) or missing/invalid `call_id` field (`invalid_request`).

{
  "error": "invalid_request",
  "message": "call_id must be a non-empty string"
}

401 Missing, invalid, revoked, or expired bearer token.

{
  "error": "unauthorized"
}

404 `call_id` doesn't exist or has already ended.

{
  "error": "call_not_found",
  "call_id": "call_example_0000000000000000000000"
}

502 Hangup dispatched to the Mac phone-node but the phone didn't acknowledge.

{
  "error": "phone_node_error",
  "call_id": "call_example_0000000000000000000000",
  "message": "phone_node returned non-2xx"
}