---
title: "Update Voice IVR Scenarios"
method: PUT
path: "/voice/ivr/1/scenarios/{id}"
tags: ["channels", "voice", "interactive-voice-response", "manage-ivr-scenarios"]
---

# Update Voice IVR Scenarios

`PUT /voice/ivr/1/scenarios/{id}`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/voice/ivr/1/scenarios/{id}`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`
  - API key in header `Authorization`
  - API key in header `Authorization`
  - HTTP basic

This method allows you to update a Voice IVR Scenario. Changes may take up to 10 minutes to apply.

## Path parameters

- `id` string, required

## Request body

- 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aUpdateScenarioRequest
  - `name` string, required: The name of IVR scenario.
  - `description` string: Description of IVR scenario.
  - `notifyUrl` string: The URL on your callback server on which the Delivery report will be sent.
  - `notifyContentType` string: Preferred Delivery report content type. Can be `application/json` or `application/xml`.
  - `record` boolean: Indicates if all calls using the scenario should be recorded.
  - `script` union[], required: Array of IVR actions defining scenario. NOTE: Answering Machine Detection, Call Recording and Speech Recognition (used for Capture action) are add-on features. To enable these add-ons, please contact our [sales](https://www.infobip.com/contact) organisation.
    - union
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCallApi: Call API Action performs an HTTP request to a client’s endpoint, and (if told to) processes the response data. If collectResponse is set, the system will attempt to parse the response from the server. Our platform needs to be able to make HTTP requests to the specified endpoint.
        - `request` string, required: The URL to target. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCallApiOptions, required
          - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', required: Http method
          - `headers` object: HTTP headers
          - `body` string, required: HTTP body. The parameter can be constructed using variables.
          - `collectResponse` boolean: If this field is set, the system will parse the response and save all its fields as variables inside scenario. For example, if the response is `{"letters": "abcd", "numbers": 12345}`, the system will store variables letters and numbers, with values `abcd` and `12345` respectively. Nested JSON and XML objects are also supported; nested fields are resolved with underscore notation. For example, if the response is `{"a": {"b": {"c": "xyz"}}}`, the system will store `a_b_c` with value `xyz`. The response cannot contain duplicate keys or predefined words. Check the example Call Api with response. Response that is parsed can only be in JSON or XML. Predefined words: from, to, startTime, answerTime and machineAnswered.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCapture: Capture action performs speech recognition of a specified duration. The recognized text can be used in other actions of the scenario. Speech capture will start after the beep tone.
        - `capture` string, required: Variable name. If speech recognition matches one of the specified keyPhrases, a variable with this name will be set to match the keyphrase. Otherwise, this variable will be an empty string. Together with this variable, an implicit variable that contains the full text of the captured speech will be created. The name of this variable is constructed by adding _Full suffix to the variable name.
        - `timeout` integer, required: Number of seconds used for capturing speech or digits failover. Minimum value is 1 and maximum value is 30. Can be overriden with speechOptions.maxSilence.
        - `beep` boolean: Flag indicating whether a beep sound should play at the start of capture.
        - `speechOptions` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSpeechOptions, required
          - `language` string, required: Language used in speech that needs to be captured. For full list of supported languages see [Supported languages](https://www.infobip.com/docs/voice-and-video/interactive-voice-response-ivr/supported-speech-languages).
          - `keyPhrases` string[]: Array of keyphrases used for matching capturing speech. If full captured text contains one of the specified phrases, that phrase will be set in variable specified in capture parameter. If keyphrases are not set or no matching is done, variable will be set to empty string. Every keyphrase can contain up to 5 words and number of keyphrases is not limited.
          - `maxSilence` integer: If used, this parameter defines the number of seconds of silence that will stop capturing. For example value of 3 defines that capturing stops as soon as 3 seconds of silence is detected or when timeout expires, whichever happens first. Minimum value is 1 and maximum value is 5. The value must be lower than the timeout value.
        - `dtmfOptions` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDtmfOptions
          - `maxInputLength` integer: Maximum acceptable number of digits. Capturing is stopped after this number of digits has been entered. If not set, maximum value will be used.
          - `mappedValues` object: Map of expected collected DTMF values with some real meaning. (Example: if you have multilingual IVR, and option for users to press 1 to enter "English" menu, you can define {"1":"English"}, so the reporting and analysis will be easier). When this option is defined additional variable is present in the scenario. If you set your capture action variable name to myVar, then you will get additional variable myVar_Meaning containing the mapped value for a collected DTMF. Keys can contain only digits and asterisks.
        - `sendToReports` 'ALWAYS' | 'MASKED' | 'NEVER': Choose if you want to show DTMF inputs in Voice reports and logs. Options are: ALWAYS (always send - default value), MASKED (send masked - xxxx will be shown in reports and logs), NEVER (don't send - DTMF inputs will not be shown in reports and logs).
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCollect: Collect action reads the DTMF input from the user’s phone and saves it into a variable. Saved variable can be used within the IVR in any other action that allows variable usage. (e.g. switch/case)
        - `collectInto` string, required: The name of the variable to set.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCollectOptions
          - `maxInputLength` integer: Maximum acceptable number of digits. Stops reading after maxdigits have been entered (without requiring the user to press '#' key).
          - `timeout` integer: Timeout in seconds for user to press both first DTMF and all other inter-digit DTMFs. Default value is 5. Max value is 30. The parameter can be constructed using variables.
          - `sendToReports` 'ALWAYS' | 'MASKED' | 'NEVER': Choose if you want to show DTMF inputs in Voice reports and logs. Options are: ALWAYS (always send - default value), MASKED (send masked - xxxx will be shown in reports and logs), NEVER (don't send - DTMF inputs will not be shown in reports and logs).
          - `mappedValues` object: Map of expected collected DTMF values with some real meaning. (Example: if you have multilingual IVR, and option for users to press 1 to enter "English" menu, you can define {"1":"English"}, so the reporting and analysis will be easier). When this option is defined additional variable is present in the scenario. If you set your collect action variable name to myVar, then you will get additional variable myVar_Meaning containing the mapped value for a collected DTMF. Mapped values can contain only numbers and multiple asterisk (*) symbols.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDial: Dial action performs a call redirection, joining the user's call with another destination. Dial must be the last action.
        - `dial` string, required: must be a valid E164 MSISDN; the parameter can be constructed using variables
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialOptions
          - `senderId` string: must be a valid E164 MSISDN; the parameter can be constructed using variables
          - `maxCallDuration` integer: If set, call transfer will be limited by maxCallDuration seconds, must be a positive number, no upper bound.
          - `customRingback` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCustomRingback: Custom ringback tones configuration. Allows specifying different audio files to play during ringing and when the call fails.
            - `ringingAudio` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAudioContent, required
              - …
            - `failedAudio` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAudioContent
              - …
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToMany: Dial to Many action performs a call redirection to multiple destinations, joining the user’s call only with the destination that answered the call first. After Dial to Many action the following actions are forbidden: Say, Collect, Dial, Dial to Many, Dial to Conversations, Play, Record and Play from Recording.
        - `dialToMany` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aNumbers[], required
          - `number` string, required: Must be a valid [E.164](https://en.wikipedia.org/wiki/E.164) number; the parameter can be constructed using variables
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToManyOptions, required
          - `parallel` boolean: Flag indicating that parallel (`true`), or sequential (`false`) Dial to Many will be executed.
          - `senderId` string: Must be a valid [E.164](https://en.wikipedia.org/wiki/E.164) number; the parameter can be constructed using variables
          - `maxCallDuration` integer: If set, call transfer will be limited by `maxCallDuration` seconds; must be a positive number, no upper bound.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToConversations: Dial to Conversations action performs a call redirection to the [Infobip Conversations platform](https://www.infobip.com/docs/conversations), joining the user’s call with an agent. Dial to Conversations must be the last action.
        - `dialToConversations` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToConversationsData, required
          - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToConversationsOptions, required
            - `tagIdentifierType` 'ID' | 'NAME': Defines which identifier will be provided in the tags field. Possible values are ID and NAME. If not provided, default value of NAME is used.
            - `tags` string[], required: An array of [conversation tag](https://www.infobip.com/docs/conversations/get-to-know-conversations#tags-templates-and-tags) names or ids that are assigned to this conversation for better categorization of the topics or customer intent. Value can be an array of tag names/ids, empty array, or null value.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aForEach: For-each action is a control statement that executes a block of code for each of the values within the supplied list. The Supplied list of values can be static or dynamic (defined as user variable).
        - `for-each` string, required: Variable name that will be used inside the loop to represent single value from supplied list of values.
        - `in` string, required: List of values that will be iterated over. Must be delimited with specified `delimiter`.
        - `delimiter` string: Delimiter for separating values in the list of values.
        - `do` object[], required: Array of actions to execute.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aGoTo: Go-To action is used to go back to some specified action that was already executed in the scenario and continue the execution from that point.
        - `goTo` integer, required: The actionId of an action to which to jump
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aGoToOptions
          - `goToLimit` integer: Maximum number of times goto can jump to specified action. Valid values are from 1 to 100.
          - `countVariable` string: Name of the variable which counts passes through goto action
      - 'hangup': Hangup action marks the end of the IVR flow execution, leading to the call actually being hung up.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aIfThenElse: If-Then-Else action provides simple branching based on a condition. If the condition evaluates to true, the then block is executed, otherwise the else block is executed. Only one of the blocks is required to be non-empty.
        - `if` string, required: The expression to evaluate
        - `then` object[]: The actions to execute if condition is evaluated to true.
        - `else` object[]: The actions to execute if condition is evaluated to false.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 'machineDetection': Machine Detection action detects answering machines at the beginning of the call. This action sets `machineAnswered` variable upon completion to `true` or `false`. Machine Detection introduces a delay of approximately 4s. This is the minimum time needed for machine detection. Machine Detection action has to be followed by a condition action that uses the value of `machineAnswered` for branching into the 'human answered' block and the 'answering machine answered' block. The 'answering machine' block can have a Say/Play/PlayFromRecording action or a Hangup action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAnsweringMachineDetection: This action detects answering machines at the beginning of a call. It allows for detailed configuration of actions to be executed at various stages of the detection process.
        - `answeringMachineDetection` boolean, required: Indicates whether machine detection should be performed.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAnsweringMachineDetectionOptions
          - `waitEndOfMessageDetection` 'ALWAYS' | 'NEVER' | 'ON_DETECTING': Indicates whether end of the message detection is enabled for the call. `ALWAYS` specifies that after detection of `MACHINE` the script will always wait for the end of the message before executing actions defined in `onMachineDetected`. `NEVER` specifies that after detection of `MACHINE` actions defined in `onMachineDetected` will be executed immediately. `ON_DETECTING` specifies that end of the message will be respected as long as actions in `onDetecting` are in progress, once these actions finish the script jumps to `onMachineDetected` section immediately.
          - `endOfMessageDetectionTimeout` integer: Specifies the timeout (in seconds) to wait for the end of the message after a machine is detected. If set, actions defined in `onMachineDetected` will be executed only after the end of the message is detected or the timeout is reached. If not set, `onMachineDetected` actions will be triggered immediately after machine detection. If the timeout is reached before the end of the message, actions defined in `onTimeout` will be executed instead.
        - `onDetecting` object[]: Array of actions to execute while detection is in progress. A maximum of two actions of specific types (`Play`, `Say`, `Collect`) can be defined.
        - `onMachineDetected` object[], required: Array of actions to execute when a machine is detected, or when the end of the message is reached if `endOfMessageDetectionTimeout` is set. Actions defined in `onDetecting` are interrupted before these actions begin. If you do not intend to continue the scenario after `onMachineDetected`, include a `Hangup` action at the end of this section to terminate the call.
        - `onTimeout` object[]: Array of actions to execute when a machine is detected and the `endOfMessageDetectionTimeout` is reached. If you do not intend to continue the scenario after `onTimeout`, include a `Hangup` action at the end of this section to terminate the call.
        - `onHumanDetected` object[]: Array of actions to execute when a human is detected. Actions defined in `onDetecting` are interrupted before these actions begin. To avoid this interruption, omit this section and define the remaining scenario after this action. If you do not intend to continue the scenario after `onHumanDetected`, include a `Hangup` action at the end of this section to terminate the call.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPause: Pause action pauses execution of the IVR scenario for the provided duration.
        - `pause` number, double, required: the amount to wait in seconds, from 0 (exclusive) to 5 (inclusive)
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlay: Play action performs playback of audio provided by the client’s URL. Supported formats of the provided file are aac, aiff, m4a, mp2, mp3, mp4 (audio only), ogg, wav and wma. Our platform needs to have permission to make GET and HEAD HTTP requests on the provided URL. Standard http ports (like 80, 8080, etc.) are advised.
        - `playFromUrl` string, required: Audio file URL. The parameter can be constructed using variables.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayOptions
          - `loopCount` integer: Number of times the file will be played.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayFromRecording: Play from Recording Action plays audio recorded from the current or some other call.
        - `playFromRecording` string, required: Identifier of the recorded file. The parameter can be constructed using variables.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayFromUpload: Play From Upload action performs playback of uploaded audio file. Not available in inbound IVR at the moment.
        - `playFromUpload` string, required: ID of uploaded file. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayFromUploadOptions
          - `loopCount` integer: Number of times the file will be played. Valid values are from 1 to 10.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayTty: Play TTY action converts the provided text into Baudot tones and plays the generated audio, enabling the message to be displayed on a connected TTY device. This action is designed to support IVR scenarios adapted for users with hearing impairments.
        - `playTty` string, required: Text that will be played in Baudot tones. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayTtyOptions
          - `loopCount` integer: Number of times the message will be played.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aRecord: Record action records a portion of the call. The recording starts at the moment where the Record action is added in the IVR.
        - `record` integer, required: The duration to record for in seconds; null for unlimited.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aRecordOptions
          - `escapeDigits` string: DTMF codes which should stop recording when input by the user.
          - `beep` boolean: Flag indicating a beep sound should be played at the start of the recording.
          - `maxSilence` integer: The amount of silence to wait for before stopping the recording.
          - `identifier` string: The identifier for the recording. Identified recordings can be reused in Play from Recording. The parameter can be constructed using variables.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aRepeatWhile: Repeat-While action is a control flow statement that repeatedly executes a block of code, as long as the boolean condition in the while field is true. Comparison is done using equal (==) or not equal (!=) operators. Make sure not to provide a condition that causes an infinite loop.
        - `repeat` object[], required: Array of actions to execute.
        - `while` string, required: The expression to evaluate.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSay: Say action converts provided text into an audio file which is played during the call based on the provided parameters. Message text can be up to 1400 characters long.
        - `say` string, required: Message text. SSML (_Speech Synthesis Markup Language_) is supported and can be used to fully customize pronunciation of the provided text. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSayOptions
          - `language` string: Must be defined for correct pronunciation. The parameter can be constructed using variables.
          - `voice` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aVoiceOptions
            - `name` string: Name of the voice in which the text would be synthesized. The parameter can be constructed using variables.
            - `gender` string: Gender in which the text would be synthesized. The parameter can be constructed using variables.
          - `speechRate` number, double: Must be within [0.5 - 2.0] range, default value is 1.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSendSms: Send SMS action creates and sends a text message from the scenario.
        - `sendSms` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSendSmsData, required
          - `text` string, required: The text of the message that will be sent.
          - `from` string, required: Represents sender ID and it can be alphanumeric or numeric; alphanumeric sender ID length should be between 3 and 11 characters; numeric sender ID length should be between 3 and 14 characters; the parameter can be constructed using variables
          - `to` string, required: Must be a valid E164 MSISDN; the parameter can be constructed using variables
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSetVariable: Set variable action makes it possible to set a variable defined inside the IVR scenario to a specified value.
        - `setVariable` string, required: Name of a variable.
        - `value` string, required: Value to which the variable should be set. The parameter can be constructed using variables.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSwitchCase: Switch-Case action takes a saved variable (obtained via either a Collect, Call API action or scenario parameters) and performs flow control based on it. It works similarly to the switch case block, using case-sensitive comparison.
        - `switch` string, required: Name of the variable whose value to inspect.
        - `case` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCaseObject, required
          - `__default` object[]: Array of actions to execute if none of the conditions above are met.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aWhileDo: While-Do action executes the do field block of code as long as a specified condition is true in the while field. As with Repeat-While, comparison is done using equal (==) or not equal (! =) operators. Make sure not to provide a condition that causes an infinite loop.
        - `while` string, required: The expression to evaluate.
        - `do` object[], required: Array of actions to execute if none of the conditions above are met.

## Response `200`

successful response

- 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aUpdateScenarioResponse
  - `createTime` string, date-time: Creation timestamp.
  - `description` string: Scenario description.
  - `id` string: Scenario key. It is used for launching IVR scenario.
  - `name` string: Scenario name.
  - `notifyUrl` string: The URL on the client's callback server on which the Delivery report will be sent.
  - `notifyContentType` string: Preferred Delivery report content type. Can be `application/json` or `application/xml`.
  - `record` boolean: Indicates if all calls using the scenario should be recorded.
  - `script` union[]: Array of IVR actions defining scenario. NOTE: Answering Machine Detection, Call Recording and Speech Recognition (used for Capture action) are add-on features. To enable these add-ons, please contact our [sales](https://www.infobip.com/contact) organisation.
    - union
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCallApi: Call API Action performs an HTTP request to a client’s endpoint, and (if told to) processes the response data. If collectResponse is set, the system will attempt to parse the response from the server. Our platform needs to be able to make HTTP requests to the specified endpoint.
        - `request` string, required: The URL to target. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCallApiOptions, required
          - `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', required: Http method
          - `headers` object: HTTP headers
          - `body` string, required: HTTP body. The parameter can be constructed using variables.
          - `collectResponse` boolean: If this field is set, the system will parse the response and save all its fields as variables inside scenario. For example, if the response is `{"letters": "abcd", "numbers": 12345}`, the system will store variables letters and numbers, with values `abcd` and `12345` respectively. Nested JSON and XML objects are also supported; nested fields are resolved with underscore notation. For example, if the response is `{"a": {"b": {"c": "xyz"}}}`, the system will store `a_b_c` with value `xyz`. The response cannot contain duplicate keys or predefined words. Check the example Call Api with response. Response that is parsed can only be in JSON or XML. Predefined words: from, to, startTime, answerTime and machineAnswered.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCapture: Capture action performs speech recognition of a specified duration. The recognized text can be used in other actions of the scenario. Speech capture will start after the beep tone.
        - `capture` string, required: Variable name. If speech recognition matches one of the specified keyPhrases, a variable with this name will be set to match the keyphrase. Otherwise, this variable will be an empty string. Together with this variable, an implicit variable that contains the full text of the captured speech will be created. The name of this variable is constructed by adding _Full suffix to the variable name.
        - `timeout` integer, required: Number of seconds used for capturing speech or digits failover. Minimum value is 1 and maximum value is 30. Can be overriden with speechOptions.maxSilence.
        - `beep` boolean: Flag indicating whether a beep sound should play at the start of capture.
        - `speechOptions` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSpeechOptions, required
          - `language` string, required: Language used in speech that needs to be captured. For full list of supported languages see [Supported languages](https://www.infobip.com/docs/voice-and-video/interactive-voice-response-ivr/supported-speech-languages).
          - `keyPhrases` string[]: Array of keyphrases used for matching capturing speech. If full captured text contains one of the specified phrases, that phrase will be set in variable specified in capture parameter. If keyphrases are not set or no matching is done, variable will be set to empty string. Every keyphrase can contain up to 5 words and number of keyphrases is not limited.
          - `maxSilence` integer: If used, this parameter defines the number of seconds of silence that will stop capturing. For example value of 3 defines that capturing stops as soon as 3 seconds of silence is detected or when timeout expires, whichever happens first. Minimum value is 1 and maximum value is 5. The value must be lower than the timeout value.
        - `dtmfOptions` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDtmfOptions
          - `maxInputLength` integer: Maximum acceptable number of digits. Capturing is stopped after this number of digits has been entered. If not set, maximum value will be used.
          - `mappedValues` object: Map of expected collected DTMF values with some real meaning. (Example: if you have multilingual IVR, and option for users to press 1 to enter "English" menu, you can define {"1":"English"}, so the reporting and analysis will be easier). When this option is defined additional variable is present in the scenario. If you set your capture action variable name to myVar, then you will get additional variable myVar_Meaning containing the mapped value for a collected DTMF. Keys can contain only digits and asterisks.
        - `sendToReports` 'ALWAYS' | 'MASKED' | 'NEVER': Choose if you want to show DTMF inputs in Voice reports and logs. Options are: ALWAYS (always send - default value), MASKED (send masked - xxxx will be shown in reports and logs), NEVER (don't send - DTMF inputs will not be shown in reports and logs).
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCollect: Collect action reads the DTMF input from the user’s phone and saves it into a variable. Saved variable can be used within the IVR in any other action that allows variable usage. (e.g. switch/case)
        - `collectInto` string, required: The name of the variable to set.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCollectOptions
          - `maxInputLength` integer: Maximum acceptable number of digits. Stops reading after maxdigits have been entered (without requiring the user to press '#' key).
          - `timeout` integer: Timeout in seconds for user to press both first DTMF and all other inter-digit DTMFs. Default value is 5. Max value is 30. The parameter can be constructed using variables.
          - `sendToReports` 'ALWAYS' | 'MASKED' | 'NEVER': Choose if you want to show DTMF inputs in Voice reports and logs. Options are: ALWAYS (always send - default value), MASKED (send masked - xxxx will be shown in reports and logs), NEVER (don't send - DTMF inputs will not be shown in reports and logs).
          - `mappedValues` object: Map of expected collected DTMF values with some real meaning. (Example: if you have multilingual IVR, and option for users to press 1 to enter "English" menu, you can define {"1":"English"}, so the reporting and analysis will be easier). When this option is defined additional variable is present in the scenario. If you set your collect action variable name to myVar, then you will get additional variable myVar_Meaning containing the mapped value for a collected DTMF. Mapped values can contain only numbers and multiple asterisk (*) symbols.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDial: Dial action performs a call redirection, joining the user's call with another destination. Dial must be the last action.
        - `dial` string, required: must be a valid E164 MSISDN; the parameter can be constructed using variables
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialOptions
          - `senderId` string: must be a valid E164 MSISDN; the parameter can be constructed using variables
          - `maxCallDuration` integer: If set, call transfer will be limited by maxCallDuration seconds, must be a positive number, no upper bound.
          - `customRingback` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCustomRingback: Custom ringback tones configuration. Allows specifying different audio files to play during ringing and when the call fails.
            - `ringingAudio` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAudioContent, required
              - …
            - `failedAudio` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAudioContent
              - …
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToMany: Dial to Many action performs a call redirection to multiple destinations, joining the user’s call only with the destination that answered the call first. After Dial to Many action the following actions are forbidden: Say, Collect, Dial, Dial to Many, Dial to Conversations, Play, Record and Play from Recording.
        - `dialToMany` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aNumbers[], required
          - `number` string, required: Must be a valid [E.164](https://en.wikipedia.org/wiki/E.164) number; the parameter can be constructed using variables
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToManyOptions, required
          - `parallel` boolean: Flag indicating that parallel (`true`), or sequential (`false`) Dial to Many will be executed.
          - `senderId` string: Must be a valid [E.164](https://en.wikipedia.org/wiki/E.164) number; the parameter can be constructed using variables
          - `maxCallDuration` integer: If set, call transfer will be limited by `maxCallDuration` seconds; must be a positive number, no upper bound.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToConversations: Dial to Conversations action performs a call redirection to the [Infobip Conversations platform](https://www.infobip.com/docs/conversations), joining the user’s call with an agent. Dial to Conversations must be the last action.
        - `dialToConversations` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToConversationsData, required
          - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aDialToConversationsOptions, required
            - `tagIdentifierType` 'ID' | 'NAME': Defines which identifier will be provided in the tags field. Possible values are ID and NAME. If not provided, default value of NAME is used.
            - `tags` string[], required: An array of [conversation tag](https://www.infobip.com/docs/conversations/get-to-know-conversations#tags-templates-and-tags) names or ids that are assigned to this conversation for better categorization of the topics or customer intent. Value can be an array of tag names/ids, empty array, or null value.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aForEach: For-each action is a control statement that executes a block of code for each of the values within the supplied list. The Supplied list of values can be static or dynamic (defined as user variable).
        - `for-each` string, required: Variable name that will be used inside the loop to represent single value from supplied list of values.
        - `in` string, required: List of values that will be iterated over. Must be delimited with specified `delimiter`.
        - `delimiter` string: Delimiter for separating values in the list of values.
        - `do` object[], required: Array of actions to execute.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aGoTo: Go-To action is used to go back to some specified action that was already executed in the scenario and continue the execution from that point.
        - `goTo` integer, required: The actionId of an action to which to jump
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aGoToOptions
          - `goToLimit` integer: Maximum number of times goto can jump to specified action. Valid values are from 1 to 100.
          - `countVariable` string: Name of the variable which counts passes through goto action
      - 'hangup': Hangup action marks the end of the IVR flow execution, leading to the call actually being hung up.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aIfThenElse: If-Then-Else action provides simple branching based on a condition. If the condition evaluates to true, the then block is executed, otherwise the else block is executed. Only one of the blocks is required to be non-empty.
        - `if` string, required: The expression to evaluate
        - `then` object[]: The actions to execute if condition is evaluated to true.
        - `else` object[]: The actions to execute if condition is evaluated to false.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 'machineDetection': Machine Detection action detects answering machines at the beginning of the call. This action sets `machineAnswered` variable upon completion to `true` or `false`. Machine Detection introduces a delay of approximately 4s. This is the minimum time needed for machine detection. Machine Detection action has to be followed by a condition action that uses the value of `machineAnswered` for branching into the 'human answered' block and the 'answering machine answered' block. The 'answering machine' block can have a Say/Play/PlayFromRecording action or a Hangup action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAnsweringMachineDetection: This action detects answering machines at the beginning of a call. It allows for detailed configuration of actions to be executed at various stages of the detection process.
        - `answeringMachineDetection` boolean, required: Indicates whether machine detection should be performed.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aAnsweringMachineDetectionOptions
          - `waitEndOfMessageDetection` 'ALWAYS' | 'NEVER' | 'ON_DETECTING': Indicates whether end of the message detection is enabled for the call. `ALWAYS` specifies that after detection of `MACHINE` the script will always wait for the end of the message before executing actions defined in `onMachineDetected`. `NEVER` specifies that after detection of `MACHINE` actions defined in `onMachineDetected` will be executed immediately. `ON_DETECTING` specifies that end of the message will be respected as long as actions in `onDetecting` are in progress, once these actions finish the script jumps to `onMachineDetected` section immediately.
          - `endOfMessageDetectionTimeout` integer: Specifies the timeout (in seconds) to wait for the end of the message after a machine is detected. If set, actions defined in `onMachineDetected` will be executed only after the end of the message is detected or the timeout is reached. If not set, `onMachineDetected` actions will be triggered immediately after machine detection. If the timeout is reached before the end of the message, actions defined in `onTimeout` will be executed instead.
        - `onDetecting` object[]: Array of actions to execute while detection is in progress. A maximum of two actions of specific types (`Play`, `Say`, `Collect`) can be defined.
        - `onMachineDetected` object[], required: Array of actions to execute when a machine is detected, or when the end of the message is reached if `endOfMessageDetectionTimeout` is set. Actions defined in `onDetecting` are interrupted before these actions begin. If you do not intend to continue the scenario after `onMachineDetected`, include a `Hangup` action at the end of this section to terminate the call.
        - `onTimeout` object[]: Array of actions to execute when a machine is detected and the `endOfMessageDetectionTimeout` is reached. If you do not intend to continue the scenario after `onTimeout`, include a `Hangup` action at the end of this section to terminate the call.
        - `onHumanDetected` object[]: Array of actions to execute when a human is detected. Actions defined in `onDetecting` are interrupted before these actions begin. To avoid this interruption, omit this section and define the remaining scenario after this action. If you do not intend to continue the scenario after `onHumanDetected`, include a `Hangup` action at the end of this section to terminate the call.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPause: Pause action pauses execution of the IVR scenario for the provided duration.
        - `pause` number, double, required: the amount to wait in seconds, from 0 (exclusive) to 5 (inclusive)
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlay: Play action performs playback of audio provided by the client’s URL. Supported formats of the provided file are aac, aiff, m4a, mp2, mp3, mp4 (audio only), ogg, wav and wma. Our platform needs to have permission to make GET and HEAD HTTP requests on the provided URL. Standard http ports (like 80, 8080, etc.) are advised.
        - `playFromUrl` string, required: Audio file URL. The parameter can be constructed using variables.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayOptions
          - `loopCount` integer: Number of times the file will be played.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayFromRecording: Play from Recording Action plays audio recorded from the current or some other call.
        - `playFromRecording` string, required: Identifier of the recorded file. The parameter can be constructed using variables.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayFromUpload: Play From Upload action performs playback of uploaded audio file. Not available in inbound IVR at the moment.
        - `playFromUpload` string, required: ID of uploaded file. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayFromUploadOptions
          - `loopCount` integer: Number of times the file will be played. Valid values are from 1 to 10.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayTty: Play TTY action converts the provided text into Baudot tones and plays the generated audio, enabling the message to be displayed on a connected TTY device. This action is designed to support IVR scenarios adapted for users with hearing impairments.
        - `playTty` string, required: Text that will be played in Baudot tones. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aPlayTtyOptions
          - `loopCount` integer: Number of times the message will be played.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aRecord: Record action records a portion of the call. The recording starts at the moment where the Record action is added in the IVR.
        - `record` integer, required: The duration to record for in seconds; null for unlimited.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aRecordOptions
          - `escapeDigits` string: DTMF codes which should stop recording when input by the user.
          - `beep` boolean: Flag indicating a beep sound should be played at the start of the recording.
          - `maxSilence` integer: The amount of silence to wait for before stopping the recording.
          - `identifier` string: The identifier for the recording. Identified recordings can be reused in Play from Recording. The parameter can be constructed using variables.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aRepeatWhile: Repeat-While action is a control flow statement that repeatedly executes a block of code, as long as the boolean condition in the while field is true. Comparison is done using equal (==) or not equal (!=) operators. Make sure not to provide a condition that causes an infinite loop.
        - `repeat` object[], required: Array of actions to execute.
        - `while` string, required: The expression to evaluate.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSay: Say action converts provided text into an audio file which is played during the call based on the provided parameters. Message text can be up to 1400 characters long.
        - `say` string, required: Message text. SSML (_Speech Synthesis Markup Language_) is supported and can be used to fully customize pronunciation of the provided text. The parameter can be constructed using variables.
        - `options` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSayOptions
          - `language` string: Must be defined for correct pronunciation. The parameter can be constructed using variables.
          - `voice` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aVoiceOptions
            - `name` string: Name of the voice in which the text would be synthesized. The parameter can be constructed using variables.
            - `gender` string: Gender in which the text would be synthesized. The parameter can be constructed using variables.
          - `speechRate` number, double: Must be within [0.5 - 2.0] range, default value is 1.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSendSms: Send SMS action creates and sends a text message from the scenario.
        - `sendSms` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSendSmsData, required
          - `text` string, required: The text of the message that will be sent.
          - `from` string, required: Represents sender ID and it can be alphanumeric or numeric; alphanumeric sender ID length should be between 3 and 11 characters; numeric sender ID length should be between 3 and 14 characters; the parameter can be constructed using variables
          - `to` string, required: Must be a valid E164 MSISDN; the parameter can be constructed using variables
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSetVariable: Set variable action makes it possible to set a variable defined inside the IVR scenario to a specified value.
        - `setVariable` string, required: Name of a variable.
        - `value` string, required: Value to which the variable should be set. The parameter can be constructed using variables.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aSwitchCase: Switch-Case action takes a saved variable (obtained via either a Collect, Call API action or scenario parameters) and performs flow control based on it. It works similarly to the switch case block, using case-sensitive comparison.
        - `switch` string, required: Name of the variable whose value to inspect.
        - `case` 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aCaseObject, required
          - `__default` object[]: Array of actions to execute if none of the conditions above are met.
        - `actionId` integer: User-defined ID of an action that can be used with go-to action.
      - 13d6cf838c63455fe28fcf6ab1b4447c03d816f87ce89525d3cd759ca08a7b1aWhileDo: While-Do action executes the do field block of code as long as a specified condition is true in the while field. As with Repeat-While, comparison is done using equal (==) or not equal (! =) operators. Make sure not to provide a condition that causes an infinite loop.
        - `while` string, required: The expression to evaluate.
        - `do` object[], required: Array of actions to execute if none of the conditions above are met.
  - `updateTime` string, date-time: Update timestamp.
  - `lastUsageDate` string, date: Last usage date. `null` for scenarios that are used last time before `2024-01-01`.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
