> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Actions > Action classes returned from call control methods. [play]: /docs/server-sdks/reference/typescript/relay/call/play [record]: /docs/server-sdks/reference/typescript/relay/call/record [detect]: /docs/server-sdks/reference/typescript/relay/call/detect [call]: /docs/server-sdks/reference/typescript/relay/call [relayevent]: /docs/server-sdks/reference/typescript/relay/events [play-action]: /docs/server-sdks/reference/typescript/relay/actions/play-action [record-action]: /docs/server-sdks/reference/typescript/relay/actions/record-action [collect-action]: /docs/server-sdks/reference/typescript/relay/actions/collect-action [detect-action]: /docs/server-sdks/reference/typescript/relay/actions/detect-action [standalone-collect-action]: /docs/server-sdks/reference/typescript/relay/actions/standalone-collect-action [fax-action]: /docs/server-sdks/reference/typescript/relay/actions/fax-action [tap-action]: /docs/server-sdks/reference/typescript/relay/actions/tap-action [stream-action]: /docs/server-sdks/reference/typescript/relay/actions/stream-action [pay-action]: /docs/server-sdks/reference/typescript/relay/actions/pay-action [transcribe-action]: /docs/server-sdks/reference/typescript/relay/actions/transcribe-action [ai-action]: /docs/server-sdks/reference/typescript/relay/actions/ai-action [ref-playaction]: /docs/server-sdks/reference/typescript/relay/actions/play-action Action objects are returned from call control methods like [`play()`][play], [`record()`][record], and [`detect()`][detect]. They provide a common interface for tracking and controlling in-progress operations on a [`Call`][call]. All action classes extend a shared base that provides `isDone`, `completed`, `result`, `controlId`, and the `wait()` method. Specific action types add methods relevant to their operation (e.g., `pause()` and `resume()` on [`PlayAction`][ref-playaction]). ```typescript {11} import { RelayClient } from '@signalwire/sdk'; const client = new RelayClient({ project: process.env.SIGNALWIRE_PROJECT_ID!, token: process.env.SIGNALWIRE_API_TOKEN!, contexts: ['default'] }); client.onCall(async (call) => { await call.answer(); const playAction = await call.play([{ type: 'tts', text: 'Hello!' }]); // Control the in-progress operation await playAction.pause(); await playAction.resume(); // Wait for completion const event = await playAction.wait(); }); await client.run(); ``` ## **Action (Base Interface)** All action classes share these properties and methods. ### **Properties** **`controlId`** `string` Unique identifier for this operation, used to correlate commands and events. --- **`isDone`** `boolean` `true` if the underlying promise has resolved (the operation has reached a terminal state). --- **`completed`** `boolean` `true` once the action has finished and the terminal event has been processed. --- **`result`** `RelayEvent | null` The terminal [`RelayEvent`][relayevent] for this action, or `null` if the action has not yet completed. --- ### **Methods** #### wait Await the action's completion and return the terminal event. **`timeout`** `number | undefined` Maximum seconds to wait (matches Python SDK convention). `undefined` waits indefinitely. Throws an `Error` if exceeded. --- ## **Subclasses** #### [PlayAction](/docs/server-sdks/reference/typescript/relay/actions/play-action) Tracks audio playback. Supports pause, resume, volume, and stop. #### [RecordAction](/docs/server-sdks/reference/typescript/relay/actions/record-action) Tracks recording. Supports pause, resume, and stop. #### [CollectAction](/docs/server-sdks/reference/typescript/relay/actions/collect-action) Tracks play-and-collect. Supports stop, volume, and input timers. #### [DetectAction](/docs/server-sdks/reference/typescript/relay/actions/detect-action) Tracks detection (answering machine, fax, digits). Stop only. #### [StandaloneCollectAction](/docs/server-sdks/reference/typescript/relay/actions/standalone-collect-action) Tracks standalone input collection. Stop and input timers. #### [FaxAction](/docs/server-sdks/reference/typescript/relay/actions/fax-action) Tracks fax send/receive. Stop only. #### [TapAction](/docs/server-sdks/reference/typescript/relay/actions/tap-action) Tracks media interception. Stop only. #### [StreamAction](/docs/server-sdks/reference/typescript/relay/actions/stream-action) Tracks audio streaming to WebSocket. Stop only. #### [PayAction](/docs/server-sdks/reference/typescript/relay/actions/pay-action) Tracks payment collection. Stop only. #### [AIAction](/docs/server-sdks/reference/typescript/relay/actions/ai-action) Tracks an AI agent session. Stop only. > Action classes returned from call control methods. ## Docs - [AIAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/ai-action.md): Action handle for an active AI agent session. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/ai-action/stop.md): Stop the AI agent session. - [CollectAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/collect-action.md): Action handle for a play-and-collect operation. - [startInputTimers](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/collect-action/start-input-timers.md): Manually start the initial_timeout timer on an active collect. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/collect-action/stop.md): Stop the play-and-collect operation. - [volume](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/collect-action/volume.md): Adjust the prompt playback volume during a play-and-collect operation. - [DetectAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/detect-action.md): Action handle for an active detection operation. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/detect-action/stop.md): Stop detection immediately. - [FaxAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/fax-action.md): Action handle for an active fax send or receive operation. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/fax-action/stop.md): Stop the fax operation. - [PayAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/pay-action.md): Action handle for an active payment collection operation. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/pay-action/stop.md): Stop payment collection. - [PlayAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/play-action.md): Action handle for an active audio playback operation. - [pause](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/play-action/pause.md): Pause audio playback. - [resume](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/play-action/resume.md): Resume paused audio playback. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/play-action/stop.md): Stop audio playback immediately. - [volume](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/play-action/volume.md): Adjust audio playback volume. - [RecordAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/record-action.md): Action handle for an active recording operation. - [pause](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/record-action/pause.md): Pause an active recording. - [resume](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/record-action/resume.md): Resume a paused recording. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/record-action/stop.md): Stop recording immediately. - [StandaloneCollectAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/standalone-collect-action.md): Action handle for a standalone input collection operation. - [startInputTimers](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/standalone-collect-action/start-input-timers.md): Manually start the initial_timeout timer on an active collect. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/standalone-collect-action/stop.md): Stop the collect operation. - [StreamAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/stream-action.md): Action handle for an active audio stream operation. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/stream-action/stop.md): Stop audio streaming. - [TapAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/tap-action.md): Action handle for an active media tap operation. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/tap-action/stop.md): Stop media interception. - [TranscribeAction](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/transcribe-action.md): Action handle for an active transcription operation. - [stop](https://signalwire.com/docs/server-sdks/reference/typescript/relay/actions/transcribe-action/stop.md): Stop transcription.