*** id: 052950fb-c661-47df-b1c6-a6f46f240eb0 title: PromptAction slug: /ruby/reference/calling/actions/prompt description: >- The PromptAction object is returned when starting a prompt operation on a call. max-toc-depth: 3 ---------------- [call]: /docs/server-sdk/v2/ruby/reference/calling/call#prompt [relay-calling-promptresult]: /docs/server-sdk/v2/ruby/reference/calling/results/prompt [relay-calling-promptvolumeresult]: /docs/server-sdk/v2/ruby/reference/calling/results/prompt-volume [relay-calling-stopresult]: /docs/server-sdk/v2/ruby/reference/calling/results/stop # Relay::Calling::PromptAction This object returned from the asynchronous [`prompt!`][call] family of methods and is the handle for a prompt attempt that is currently active on a call. ## Properties | Property | Type | Description | | :---------- | :----------------------------------------------------------- | :--------------------------------------- | | `result` | [`Relay::Calling::PromptResult`][relay-calling-promptresult] | Final result of this prompt. | | `state` | String | Current state. | | `completed` | Boolean | Whether the prompt attempt has finished. | | `payload` | Hash | Payload sent to Relay to start prompt. | | `controlId` | String | UUID to identify the prompt. | ## Methods ### stop Stop the action immediately. **Parameters** None **Returns** [`Relay::Calling::StopResult`][relay-calling-stopresult] - A `StopResult` object with a `successful` property. ### volume Sets the volume for the prompt playback. Uses a value from -40dB to +40dB where 0 is original audio and -40 is muted. It follows the standard amplitude voltage gain factor: `10 pow (value / 20)`. **Parameters** | Parameter | Type | Required | Description | | :-------- | :------ | :------- | :------------- | | `setting` | Numeric | Yes | Volume setting | **Returns** [`Relay::Calling::PromptVolumeResult`][relay-calling-promptvolumeresult] - A `PromptVolumeResult` object with a `successful` property. **Examples** Play some prompt and change the volume ```ruby prompt_action = call.prompt_audio(initial_timeout: 10, digits_max: 3, digits_timeout: 5, url: 'https://cdn.signalwire.com/default-music/welcome.mp3') result = prompt_action.volume 20 puts "Volume change was successful" if result.successful ```