Variables in Rounded are like in programming containers that allow you to store and manipulate data. In the context of voice agents, variables primarily serve two functions:

  • Provide the agent with contextual data.
  • Store data generated during the conversation.

Some variables are configured by default: the caller’s number, the called number, the date and time the call started, and the call ID.

Custom Variables

Step 1: Declaring variables in the “Variables” tab

Before assigning values, variables must be declared to be recognized by the voice agent.

1. Click on the black “Variables” button (highlighted in red in the screenshot below).

2. Select “Add a variable” (highlighted in red in the screenshot below).

3. Provide the following details:

  • Variable Name : Choose a clear and descriptive name (e.g., location_name, location_address, or location_hours).
  • Type : Specify the type of data to store (Boolean, String, Number, or Date).

Source: a searchable field that indicates where the stored data comes from. Three possible values:

  • API Call: originating from an API call.
  • CSV: when you initialize your variables at the start of a call from a CSV (see next section).
  • Extracted: if the data is extracted from the conversation. Learn more about variables to extract.

Step 2: Variable initialization block (“Call Context”)

Once the variables are declared, you can assign values to them using the Call Context block (highlighted in red in the screenshot). This block allows you to send contextual data to the agent before the call starts, using a CSV file or an API.

Variables from a CSV

You initialize variables from a CSV only for agents designed to conduct call campaigns.

This involves declaring variables that will be automatically retrieved from the CSV you upload to start a call campaign. To do this, press the ‘Add a variable’ button (circled in red on the screen below), then specify the variable associated with this data. To see how to launch a call campaign, see the Campaign section.

Variables from API Calls

Variables can be initialized from API requests executed before the start of each call. Each API request allows you to initialize several variables simultaneously. To assign values to variables based on API calls, you must fill in the following parameters in the following section (highlighted in red in the screen below):

  • HTTP Method: Select the appropriate HTTP method (GET, POST, PUT, DELETE) based on the action you want the API to perform.
  • Endpoint URL: Provide the full URL of the API endpoint that the tool will interact with. Ensure that the URL is correct and accessible.
  • Content Types: Specify the format of the data sent and expected from the API. Allowed content types include: JSON and URL parameters.
  • Headers: Define the necessary HTTP headers required by the API. Headers may include authentication tokens, content types, and other metadata.
  • API Parameters: Configure the parameters required by the API to execute the request. Parameters can be constants, variables, or tool parameters.
  • API Response Mapping: To populate variable values, map your API response to the variables. Associate a value with the API response by providing its path from the root of the response using JSONPath.

Once assigned, you can use a variable within {{ }} to make its value available to the agent.

Ensure that your webhook endpoint is secure and can handle the expected load of incoming events to prevent any data loss or service interruptions.