Stop Stream
Overview
The stop_stream action stops an active media stream. Use it when real-time processing should end before the call ends. Place it in the actions array returned by your answer_url. MiniVoice executes actions in order, so put stop_stream before the action that depends on its result and after any prompt or setup the caller should experience first.
Business Use Case
Use stop_stream when the real-time audio portion is complete, such as after an agent assist step ends or before transferring the caller to a third party.
JSON Example
{
"actions": [
{
"stop_stream": {
"stream_url": "wss://media.example.com/minivoice",
"track": "both"
}
}
]
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Must be stop_stream when using typed action format. |
| stream_url | string | No | Stream URL to stop when you want to target one stream. |
| track | string | No | inbound, outbound, or both. |
Execution Flow
- MiniVoice reaches stop_stream.
- It matches the stream by URL and track when provided.
- The media stream is stopped.
- The call continues with later actions when present.
Webhook Behaviour
No action-specific webhook is sent for stop_stream.
Success Example
A successful answer_url response includes the action in a valid actions array:
{
"actions": [
{
"stop_stream": {
"stream_url": "wss://media.example.com/minivoice",
"track": "both"
}
}
]
}
Your application should store the MiniVoice call ID from webhooks or API responses so you can correlate the action with the call.
Failure Behaviour
If no matching stream exists, stopping may have no visible effect. Keep stream_url values consistent between start_stream and stop_stream.
Expected Result
MiniVoice stops the matching stream while the call flow continues.
Testing
Start a stream, confirm your WebSocket receives media, then stop the stream and confirm media stops while the call continues. During testing, log every webhook payload and compare the call ID, action timing, and final call status with the behavior you expected.
Copy/Paste Examples
Real Request
Return this from your answer_url:
{
"actions": [
{
"stop_stream": {
"stream_url": "wss://media.example.com/minivoice",
"track": "both"
}
}
]
}
Real Response
A valid answer_url response is the JSON action payload itself. MiniVoice accepts the response when it contains an actions array:
{
"actions": [
{
"stop_stream": {
"stream_url": "wss://media.example.com/minivoice",
"track": "both"
}
}
]
}
Real Webhook Example
{
"event": "call.completed",
"created_at": "2026-05-29T12:10:00Z",
"call": {
"id": "call_123",
"customer_id": "cust_123",
"application_id": "app_123",
"status": "completed",
"direction": "inbound",
"from": "+15551230001",
"to": "+15551230002"
},
"variables": {},
"data": {}
}
Common Use Case
Use stop_stream when the real-time audio portion is complete, such as after an agent assist step ends or before transferring the caller to a third party.
Common Failure Case
{
"error": {
"code": "answer_url_error",
"message": "invalid action payload"
}
}
Invalid fields or malformed JSON cause MiniVoice to reject the answer_url payload. Log the exact response your server returned while testing.