***

title: stop
slug: /reference/python/relay/actions/detect-action/stop
description: Stop detection immediately.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Stop detection immediately.

## **Returns**

`dict` -- Server acknowledgment.

## **Example**

```python {18}
from signalwire.relay import RelayClient

client = RelayClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
    contexts=["default"],
)

@client.on_call
async def handle_call(call):
    await call.answer()
    action = await call.detect(
        {"type": "machine", "params": {"initial_timeout": 5.0}}
    )

    # Stop detection early
    await action.stop()

client.run()
```