# Outbound calls

This guide will walk you through the process of configuring your Voice platform to utilize the FlowBuilder application for initiating outbound phone calls.

# Requirements

To initiate outbound calls from FlowBuilder, you will need the following:

* A valid <<glossary:CLI>> of a number that you own
* A complete FlowBuilder flow
* A tool to make POST requests to the [Voice API](https://developers.cm.com/voice/reference/post_voiceapi-v2-flowbuilder)
* A valid [Voice API key](https://developers.cm.com/voice/reference/authentication-1)

> 📘 Note
>
> Before starting this process, ensure you have saved your flow to ensure it's up to date and ready for use.

This guide uses the free [Postman](https://www.postman.com/) tool to make requests to the Voice API. However, any tool capable of making HTTP POST requests will suffice.

# Finding your call flow ID

Each call flow created in the Voice FlowBuilder is assigned a unique identifier in <<glossary:UUID>> format. This call flow ID is used to initiate the outbound call with the correct flow. To find the call flow ID of the flow you want to use, open the [FlowBuilder application](https://www.cm.com/app/voice-flowbuilder/) and click on the desired flow.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/7594d7c-image.png",
        null,
        ""
      ],
      "align": "center",
      "border": true
    }
  ]
}
[/block]

On the page that opens, you can find your call flow ID in the following location.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/dc87926-Screenshot_2024-06-18_at_12.45.45.png",
        null,
        "Callflow detail page with the callflow ID location marked."
      ],
      "align": "center",
      "border": true,
      "caption": "Callflow detail page with the call flow ID location marked."
    }
  ]
}
[/block]

# Flow variables

To enable hyper-personalized and customizable outbound calls, we have added the option to pass [Flow variables](https://developers.cm.com/voice/docs/flow-variables) to your flow when initiating an outbound call. To get an overview of all the variables that can be passed in, open the call flow detail page:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/6a35989-Screenshot_2024-06-18_at_11.17.34.png",
        null,
        "Callflow detail page that shows a number of flow variables"
      ],
      "align": "center",
      "border": true,
      "caption": "Callflow detail page that shows a number of flow variables"
    }
  ]
}
[/block]

All the variables shown in **green** are variables that are both *created* and *consumed* within your flow. The variables shown in **blue** are variables that are *created* in your flow but are not used. Finally, the variables shown in **yellow** are variables that are *consumed* but not *created* in your flow. These variables are prime candidates to supply to outbound calls via the Voice API. We will discuss how to supply these variables further down in this article.

> 🚧 Important note
>
> When you supply a variable that is *also* created within your flow (e.g., **dtmf\_input** in the image above), the value passed via the Voice API will be overwritten during runtime.

# Making the request

To make the request, open the Postman application and click on the plus icon to create a new request.

![](https://files.readme.io/23ab715-image.png)

Set the request URL to `https://api.cm.com/voiceapi/v2/FlowBuilder`, and ensure the request method is set to **POST**.

![](https://files.readme.io/3c04c8c-image.png)

Next, open the **Headers** tab and add the `X-CM-PRODUCTTOKEN` header, with your API key as the value. For more information on where to find your API key, please refer to the [Authentication](https://developers.cm.com/voice/docs/authentication-1) article.

![](https://files.readme.io/6b28f66-image.png)

Next, open the **Body** tab. In the request body, we will supply the required information for the Voice API to create the outbound call. For a detailed description of the parameters in the request body, please refer to the "FlowBuilder Outbound" section in the [Voice API documentation](https://developers.cm.com/voice/docs/post_voiceapi-v2-flowbuilder).

Ensure your request body type is set to **raw** and **JSON**. Paste the JSON value below into Postman, and fill in the **`callflow-id`** and **`flow-variables`** with the data you collected earlier.

```json
{
  "callee": "00316xxxxxxxx",
  "caller": "003176xxxxxxx",
  "callflow-id": "00000000-0000-0000-0000-000000000000",
  "flow-variables": {
    "firstName": "John",
    "lastName": "Doe"
  }
}
```

![](https://files.readme.io/defe738-image.png)

Once you've verified all the data is correct, you can initiate the outbound call by clicking the **Send** button. After doing so, you'll receive an HTTP response similar to the following, indicating that the call has been placed successfully. After a few moments, the phone number specified in the **callee** field should receive the phone call.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/7afe96d-Screenshot_2024-06-18_at_11.35.49.png",
        "",
        ""
      ],
      "align": "center"
    }
  ]
}
[/block]