> ## Documentation Index
> Fetch the complete documentation index at: https://docs.60db.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# End Stream Call

> End a running stream call, or a call placed through the media WebSocket, from your server.

End a call that is running over a WebSocket: a call from [Start stream call](https://docs.60db.ai/api-reference/agents/start-stream-call.md) or one placed by a client that dialled the agent's [media WebSocket](https://docs.60db.ai/websocket-api/agent-media-socket). Use it to stop a call because of credits, a time limit or a user action.

60db sends `{"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](https://docs.60db.ai/websocket-api/agent-stream.md#end-call-command)). 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](https://docs.60db.ai/api-reference/agents/get-call.md).

## Request

### Headers

**Authorization** `string` *required*

Bearer token with your API key (scope `agents`)

### Path

**callId** `string` *required*

The call `id` (UUID) of a stream or media WebSocket call

## Response

**200 OK**

```json theme={null}
{
  "success": true,
  "data": {
    "call": { "id": "6b1f0c52-4d7e-4b8a-9d3e-2a1c8e7f0a11", "direction": "stream", "status": "in_progress" },
    "status": "ending"
  }
}
```

The call is trimmed above; see [Get call](https://docs.60db.ai/api-reference/agents/get-call.md) for every field.

## 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 |

Unlike [Hang up browser call](https://docs.60db.ai/api-reference/agents/hang-up-web-call.md), a finished call is an error (`409`), not a normal answer.

## Example

```bash cURL theme={null}
curl -X DELETE https://api.60db.ai/agents/stream-calls/CALL_ID \
  -H "Authorization: Bearer your-api-key"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.