***

title: CollectAction
slug: /reference/python/relay/actions/collect-action
description: Action handle for a play-and-collect operation.
max-toc-depth: 3
---------------------

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

[call-play-and-collect]: /docs/server-sdks/reference/python/relay/call/play-and-collect

[base-action-interface]: /docs/server-sdks/reference/python/relay/actions

[stop]: /docs/server-sdks/reference/python/relay/actions/collect-action/stop

[volume]: /docs/server-sdks/reference/python/relay/actions/collect-action/volume

[startinputtimers]: /docs/server-sdks/reference/python/relay/actions/collect-action/start-input-timers

Returned from [`call.play_and_collect()`][call-play-and-collect].
Tracks a combined play-and-collect operation where a prompt is played and user
input (digits or speech) is collected. Terminal states: `finished`, `error`,
`no_input`, `no_match`.

<Note>
  `CollectAction` only resolves on collect events. Play events sharing the same
  `control_id` are ignored, so `await action.wait()` returns only when input
  collection completes.
</Note>

Inherits all properties and methods from the
[base Action interface][base-action-interface] (`control_id`,
`is_done`, `completed`, `result`, `wait()`).

## **Properties**

No additional properties beyond the [base Action interface][base-action-interface].

## **Methods**

<CardGroup cols={3}>
  <Card title="stop" href="/docs/server-sdks/reference/python/relay/actions/collect-action/stop">
    Stop the play-and-collect operation.
  </Card>

  <Card title="volume" href="/docs/server-sdks/reference/python/relay/actions/collect-action/volume">
    Adjust the prompt playback volume during a play-and-collect operation.
  </Card>

  <Card title="start_input_timers" href="/docs/server-sdks/reference/python/relay/actions/collect-action/start-input-timers">
    Manually start the initial\_timeout timer on an active collect.
  </Card>
</CardGroup>

## **Example**

```python {13}
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.play_and_collect(
        media=[{"type": "tts", "text": "Press 1 for sales, 2 for support."}],
        collect={"digits": {"max": 1, "digit_timeout": 5.0}},
    )

    event = await action.wait()
    result = event.params.get("result", {})
    digit = result.get("digits", "")
    print(f"User pressed: {digit}")

client.run()
```