> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Whisper Prompts

## Manage whisper prompts for campaigns

A whisper prompt can be created from provided text or a professional prompt recordings can be assigned as whisper prompt.

### Create whisper prompt

**Example: create whisper prompt**

POST

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json`

Request Body

```json theme={null}
{
  "ivr_tree": {
    "record_calls": false,
    "whisper_prompt_text": "How are you today?",
    "root": {
      "node_type": "Connect",
      "destination_phone_number": "8056173768",
      "destination_country_code": ""
    }
  }
}
```

### Assign prompt recording as whisper prompt

**Example: assign prompt recording as whisper prompt**

POST

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json`

Request Body

```json theme={null}
{
  "ivr_tree": {
    "record_calls": false,
    "whisper_prompt_id_from_network": "rec34",
    "root": {
      "node_type": "Connect",
      "destination_phone_number": "8056173768",
      "destination_country_code": ""
    }
  }
}
```

### Retrieve whisper prompt for a campaign

**Example: retrieve whisper prompt for a campaign**

GET

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json`

Response (*complete response not shown*)

```json theme={null}
{
  "name": "Selling Shoes",
  "status": "Activated",
  "future_terms": {
    "ivr_tree": {
      "record_calls": false,
      "whisper_prompt_text": "How are you today?",
      "whisper_prompt_id_from_network": "rec34",
      "root": {
        "node_type": "Connect",
        "destination_phone_number": "8056173768",
        "destination_country_code": ""
      }
    }
  }
}
```

### Set Whisper Prompt Condition

A whisper prompt condition can be set for a campaign to determine whether or not to play the whisper prompt in a call. The prompt will only be played if the full condition is met.

To conditionally play whisper prompts during calls, set a whisper prompt using `"whisper_prompt_text"` or `"whisper_prompt_id_from_network"` field and set `"whisper_prompt_condition"` to the expression you want to evaluate.

POST

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json`

Example Request Body

```json theme={null}
{
  "ivr_tree": {
    "record_calls": false,
    "whisper_prompt_text": "You have reached our business during hours. Please wait while we connect you.",
    "whisper_prompt_condition": "during_hours and repeat",
    "root": {
      "node_type": "Connect",
      "destination_phone_number": "8056173768",
      "destination_country_code": ""
    }
  }
}
```

### Remove Whisper Prompt Condition

To remove whisper prompt condition set `"whisper_prompt_condition"` to empty string `""`.

POST

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>.json`

Example Request Body

```json theme={null}
{
  "ivr_tree": {
    "record_calls": false,
    "whisper_prompt_text": "Welcome to Invoca. Please wait while we connect you.",
    "whisper_prompt_condition": "",
    "root": {
      "node_type": "Connect",
      "destination_phone_number": "8056173768",
      "destination_country_code": ""
    }
  }
}
```

### Conditions

<table className="parameters docutils align-default"><thead><tr className="row-odd"><th className="head"><p>Condition</p></th><th className="head"><p>Details</p></th><th className="head"><p>Examples</p></th></tr></thead><tbody><tr className="row-even"><td><p>during\_hours</p></td><td><p>True if the caller is calling during the hours specified in the campaign.</p></td><td><p>during\_hours</p></td></tr><tr className="row-odd"><td><p>repeat</p></td><td><p>True if the caller has already called this campaign in the last N days (the interval N can be set on the campaign; the default is 30 days).</p></td><td><p>repeat</p></td></tr><tr className="row-even"><td><p>landline</p></td><td><p>True if the caller is calling from a landline phone.</p></td><td><p>landline</p></td></tr><tr className="row-odd"><td><p>mobile</p></td><td><p>True if the caller is calling from a mobile phone.</p></td><td><p>mobile</p></td></tr><tr className="row-even"><td><p>pressed\[key]</p></td><td><p>True if the caller pressed the key. Supported characters (case sensitive): \[1-9, a-z, W, N]. For a sub-menu keypress, join characters in their expected order with spaces (e.g. 1 1 2).</p></td><td><p>pressed\[3]</p></td></tr><tr className="row-odd"><td><p>custom\_data\[field\_partner\_name]</p></td><td><ul className="simple"><li><p>True if the custom data field value matches (=) the expected value</p></li><li><p>True if the custom data field value does not match (!=) the expected value</p></li><li><p>True if the custom data field value contains (contains) the expected value</p></li><li><p>True if the custom data field value is present (present)</p></li></ul></td><td><ul className="simple"><li><p>custom\_data\[product] = “Printer”</p></li><li><p>custom\_data\[product] != “Fax Machine”</p></li><li><p>custom\_data\[product] contains “Chair”</p></li><li><p>custom\_data\[product] present</p></li></ul></td></tr><tr className="row-even"><td><p>affiliate\_name</p></td><td><ul className="simple"><li><p>True if the affiliate name value matches (=) the expected value</p></li><li><p>True if the affiliate name value does not match (!=) the expected value</p></li><li><p>True if the affiliate name value contains (contains) the expected value</p></li><li><p>True if the affiliate name value is present (present)</p></li></ul></td><td><ul className="simple"><li><p>affiliate\_name = “Captain Crunch Publishing”</p></li><li><p>affiliate\_name != “Count Chocula Publishing”</p></li><li><p>affiliate\_name contains “Cocoa”</p></li><li><p>affiliate\_name present</p></li></ul></td></tr><tr className="row-odd"><td><p>media\_type</p></td><td><ul className="simple"><li><p>True if the media type for the promo number called matches (=) the expected value</p></li><li><p>True if the media type for the promo number called does not match (!=) the expected value</p></li><li><p>True if the media type for the promo number called contains (contains) the expected value</p></li><li><p>True if the media type for the promo number called is present (present)</p></li></ul></td><td><ul className="simple"><li><p>media\_type = “Online: Content / Review Site”</p></li><li><p>media\_type != “Online: Email”</p></li><li><p>media\_type contains “Online”</p></li><li><p>media\_type present</p></li></ul></td></tr><tr className="row-even"><td><p>promo\_number\_description</p></td><td><ul className="simple"><li><p>True if the description for the promo number called matches (=) the expected value</p></li><li><p>True if the description for the promo number called does not match (!=) the expected value</p></li><li><p>True if the description for the promo number called contains (contains) the expected value</p></li><li><p>True if the description for the promo number called is present (present)</p></li></ul></td><td><ul className="simple"><li><p>promo\_number\_description = “Very important number”</p></li><li><p>promo\_number\_description != “Old marketing number”</p></li><li><p>promo\_number\_description contains “New ad campaign”</p></li><li><p>promo\_number\_description present</p></li></ul></td></tr><tr className="row-odd"><td><p>and</p></td><td><p>Joins two conditions and is true if both conditions are true.</p></td><td><p>repeat and during\_hours</p></td></tr><tr className="row-even"><td><p>or</p></td><td><p>Joins two conditions and is true if either condition is true.</p></td><td><p>repeat or during\_hours</p></td></tr><tr className="row-odd"><td><p>not</p></td><td><p>Inverts the following condition.</p></td><td><p>not during\_hours</p></td></tr><tr className="row-even"><td><p>( )</p></td><td><p>Used for grouping.</p></td><td><p>mobile and (repeat or during\_hours)</p></td></tr></tbody></table>

Note that **and** is higher precedence than **or**. So if you use both in a condition like this:

```
mobile or repeat and during_hours
```

it is equivalent to this:

```
mobile or (repeat and during_hours)
```
