curl -X DELETE https://api.60db.ai/agents/stream-calls/CALL_ID \
-H "Authorization: Bearer your-api-key"
Agents
End Stream Call
End a running stream call, or a call placed through the media WebSocket, from your server.
DELETE
/
agents
/
stream-calls
/
{callId}
curl -X DELETE https://api.60db.ai/agents/stream-calls/CALL_ID \
-H "Authorization: Bearer your-api-key"
End a call that is running over a WebSocket: a call from Start stream call or one placed by a client that dialled the agent’s media WebSocket. Use it to stop a call because of credits, a time limit or a user action.
60db sends
The call is trimmed above; see Get call for every field.
Unlike Hang up browser call, a finished call is an error (
{"event":"stop"} to the call runtime. If the client’s start message carried a stream id (a Twilio-style or telephony media platform), the client also gets that platform’s end-call command (see Agent Stream WebSocket). The runtime then reports ended and closes the socket. The response returns at once with status ending. The final state, duration and cost arrive with the call.completed event, or through Get call.
Request
Headers
Path
Response
200 OK{
"success": true,
"data": {
"call": { "id": "6b1f0c52-4d7e-4b8a-9d3e-2a1c8e7f0a11", "direction": "stream", "status": "in_progress" },
"status": "ending"
}
}
Errors
| Status | Code | Meaning |
|---|---|---|
| 403 | POLICY_DENY | No active plan, or the API key lacks the agents scope |
| 404 | CALL_NOT_FOUND | No stream call with this ID in your workspace |
| 409 | CALL_NOT_RUNNING | The call has already ended |
| 409 | CALL_NOT_CONNECTED | The call is running, but its socket is not held by the server that got this request. Retry, or close the socket from your side |
409), not a normal answer.
Example
curl -X DELETE https://api.60db.ai/agents/stream-calls/CALL_ID \
-H "Authorization: Bearer your-api-key"