Create a scenario

Create Scenario Endpoint:

This resource describes a scenario identified by a unique ID, with creation and update timestamps. It includes settings such as name, sticky channel behavior with a specified TTL, and PSD2 compliance status. Additionally, it defines PIN options with a specified TTL, security measures including rate limiting based on IP and destination number, and block scores for fraud detection. The scenario also lists communication channels such as SMS, Viber, voice, and flashcall, each with their respective configurations like sender information, message content, and timing for the next event.

URL: baseURL/scenario

Method: POST

Headers:

Content-Type: application/json
principalId:{accountID}

Request Body:

This command sends a POST request to BaseURL/scenario with the specified JSON payload, including headers for content type and principal ID.

curl --location 'baseURL/scenario' \
--header 'Content-Type: application/json' \
--header 'principalId: 1' \
--data-raw '{
    "settings": {
        "name": "string",
        "sticky_channel": false,
        "psd2_compliant": false
    },
    "pin_options": {
        "ttl": 320
    },
    "security": {
        "rate_limiting": {
            "ip": false,
            "destination_number": false,
            "interval": 3,
            "max_attempts": 3
        },
        "block_scores": []
    },
    "channels": [
        {
            "channel": "sms",
            "from": "Verify",
            "message": "Your PIN is @@pin",
            "flash": false,
            "transcode": true,
            "order": 1,
            "next_event_in": 37
        }
    ]
}'

Response Body:

{
  "scenario_id": "7280ecaa-a132-4908-8f26-c1ecbe138d98",
  "created_date": "2020-09-04T06:58:35Z",
  "updated_date": "2020-09-04T06:58:35Z",
  "settings": {
    "name": "string",
    "sticky_channel": true,
    "sticky_channel_ttl": 7
  },
  "pin_options": {
    "ttl": 320
  },
  "security": {
    "rate_limiting": {
      "ip": true,
      "destination_number": true,
      "interval": 3,
      "max_attempts": 3
    },
    "block_scores": [
      "high risk"
    ]
  },
  "channels": [
    {
      "flash": false,
      "transcode": true,
      "from": "Verify",
      "message": "Your PIN is @@pin",
      "channel": "sms",
      "next_event_in": 37,
      "order": 1
    },
    {
      "sender_info_tracking_id": "0094d198-4dd2-4fb5-b451-d46aca191b27",
      "message": "Dear customer your ACME inc PIN is @@pin",
      "channel": "viber",
      "next_event_in": 43,
      "order": 2
    },
    {
      "from": "ACME INC",
      "dtmf_required": true,
      "repeat": 3,
      "language": "en_US",
      "gender": "female",
      "next_event_in": 60,
      "message": "Dear customer your ACME inc PIN is @@pin",
      "channel": "voice",
      "order": 3
    },
    {
      "channel": "flashcall",
      "next_event_in": 30,
      "order": 5
    }
  ]
}

Where:

Parameter NameDescriptionValidationsDefault ValuesRequired
settingsAn object representing various general settings for the scenario document--yes
nameThe name of the scenarioString - Max chars 60-yes
sticky_channelA boolean value indicating whether this scenario will use the stickiness featureObject-no
sticky_channel_ttlThe time to keep track of the last used channel (days)booleanFALSEno
psd2_compliantPSD2 is the 2nd Payment Services Directive established by the European Banking Authority (EBA). This directive is designed to drive payment innovation and data security by reducing competitive barriers, mandating new security processes and encouraging standardized technology.booleanFALSEno
pin_optionsAn object representing various settings for the PIN CodeObject-no
ttlThe time frame that the PIN code is valid for verification (seconds)int10yes
securityAn object representing various security settingsObject-yes
rate_limitingAn object representing various rate-limiting settingsObject-yes
ipIndicates if rate-limiting applies for an IPbooleanTRUEyes
destinationIndicates if rate-limiting applies for a destination addressbooleanTRUEyes
intervalThe intervals for rate-limiting to apply (minutes)intTRUEyes
max_attemptsMaximum attempts allowed per IP and/or destinationintTRUEyes
block_scoresAn array representing which fraud score results will be automatically blocked for verificationobjectFALSEyes
array_valuesThe values to blockstring - Allowed values: high risk, moderate risk, low risk-True if block_scores array exists
channelsAn array of objects representing the channels used for verificationObject-yes
channelThe name of the channelAccepts: sms, viber, voice, flashcall-One of 4 values is required
fromThe sender of the message (SMS channel)numeric string (max length 16) or alphanumeric string (max length 11)Verifyyes if SMS channel is used
messageThe body of the message (SMS channel)String - must contain @@pin argument once and only onceYour PIN is @@pinyes
flashIndicates if the SMS is a flash SMS (SMS channel)BooleanFALSEno
transcodeIndicates if the message body will be transcoded (SMS channel)BooleanFALSEno
orderDefines the priority orderNumeric1yes
next_event_inTime for the next event in secondsNumeric - min 20 max 60 for all channels except voice (min 60 max 120)30no
sender_info_tracking_idThe ID of the registered Viber Sender (Viber channel)string-yes if Viber channel is used
messageThe body of the message (Viber channel)String - must contain @@pin argument once and only once-yes if Viber channel is used
orderDefines the priority orderNumeric2yes
next_event_inTime for the next event in secondsNumeric - min 20 max 6030no
fromThe sender of the message (voice channel)StringVerifyyes if voice channel is used
messageThe body of the message (voice channel)String - must contain @@pin argument once and only onceYour PIN is @@pinyes if voice channel is used
languageThe language for the message (voice channel)String - Language of the voice message - VALUES: "en-US", "de-DE", "fr-FR", "it-IT", "pt-BR", "es-ES", "es-LA", "en-GB", "el-GR", "bg-BG", "pl-PL", "hu-HU", "sv-SE", "ru-RU"en-USyes if voice channel is used
genderThe gender of the voice (voice channel)String - Gender of the voice - VALUES: "male", "female"maleyes if voice channel is used
repeatNumber of repetitions of the message (voice channel)int1no
dtmf_requiredIndicates whether to start playing the message after a tone is pressed (voice channel)booleanFALSEno