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

# Triggering a VoiceAgent Call from Kustomer

> Trigger CloudTalk VoiceAgent calls directly from Kustomer Workflows

> [!NOTE]
>
> You can automatically trigger a CloudTalk VoiceAgent call using Kustomer Workflows. This guide shows you how to set up the trigger, pass customer data into CloudTalk, and confirm the call was initiated

**User level:** Admin

***

## Before you start

You will need:

* A CloudTalk VoiceAgent already created (note the VoiceAgent ID)

* [CloudTalk API credentials](https://help.cloudtalk.io/en/articles/15272380-how-to-access-and-generate-your-cloudtalk-api-keys.md) (API Key and Secret)

* A Kustomer account with access to Workflows

* Customer records that include at least a phone number in E.164 format (for example, `+14155550100`)

## Set up the integration

### Generate the Authorization Header

CloudTalk uses Basic Authentication for API requests. To generate your encoded value:

1. Go to [https://www.debugbear.com/basic-auth-header-generator](https://www.debugbear.com/basic-auth-header-generator)

2. Enter your **CloudTalk API Key** and **CloudTalk API Secret** (found in your CloudTalk Company Settings).

3. Copy the generated header. It will look similar to: `Basic XXXXXXXXX`

You'll paste this value into the workflow action below.

### Create a Kustomer Workflow Trigger

1. In Kustomer, open **Settings > Workflows**.

2. Click **+ New Workflow**.

3. Choose a trigger type, for example:

   * Conversation created

   * Tag added to customer

   * Customer attribute updated

4. Add **Conditions** to control when the call fires, for example only when the customer's phone number is set.

![](https://mintcdn.com/cloudtalk/8FCfL6QWpEnHvO8c/images/help-center/articles/16063131/7fcc55ade706-image.png?fit=max\&auto=format\&n=8FCfL6QWpEnHvO8c\&q=85\&s=e9f64cf2515f205bb9254c04e1794010)

### Add the HTTP Request Action

After setting your trigger:

1. Click **+ Add Action > REST API: JSON**

2. Configure:

   * **Method:** POST

   * **URL:** `https://api.cloudtalk.io/v1/voice-agent/calls`

   * **Headers:**

   ```json theme={"system"}
   {
     "Authorization": "Basic YOUR_AUTHORIZATION_HEADER",
     "Content-Type": "application/json"
   }
   ```

   * **Body:**

   ```json theme={"system"}
   {
     "call_number": "#{{steps.1.phones.0.phone}}",
     "voice_agent_id": "YOUR_VOICE_AGENT_ID"
   }
   ```

3. Save and **Enable** the workflow

![](https://mintcdn.com/cloudtalk/8FCfL6QWpEnHvO8c/images/help-center/articles/16063131/1e9f0aedc5e8-image.png?fit=max\&auto=format\&n=8FCfL6QWpEnHvO8c\&q=85\&s=9fe5998b434d2399ae051fff20849ef6)

**This action:**

* Sends a POST request to the CloudTalk VoiceAgent API

* Passes the customer's phone number

* Triggers your VoiceAgent to place the call

> [!WARNING]
>
> `call_number` and `voice_agent_id` are the only required fields. You can optionally add `call_properties`, such as system prompt variables (data the VoiceAgent uses during the call) and output variables (data passed back to your endpoint after the call), depending on your VoiceAgent configuration. [Learn what to include](https://help.cloudtalk.io/en/articles/11401649-voiceagents-for-outbound-calls.md).

> [!TIP]
>
> The `#{{steps.1.phones.0.phone}}` value in the body is a reference to data from an earlier step in your workflow, in this case the customer's phone number. You can use the same step-reference syntax to insert other customer data into the request. Build these references in Kustomer's workflow editor so they match your workflow's steps.

### Test and Verify

1. Trigger the event on a test customer record that has a phone number.

2. Open **Settings > Workflows > \[Workflow Name] > Run history**.

3. Confirm in CloudTalk that the VoiceAgent call was initiated.

**You're all set!** 🚀 Your Kustomer workflow will now automatically trigger a CloudTalk VoiceAgent call whenever a customer meets your chosen conditions.

## Troubleshooting

* **401 Unauthorized**: recheck the Authorization header value.

* **400 Bad Request**: confirm the phone number is in E.164 format (for example, +14155550100).

* **Workflow not firing**: check the trigger settings and confirm your conditions pass for the test record.

***

Need help or have a question? Reach out through our [Support portal](https://support.cloudtalk.io/hc/en-us/requests/new?ticket_form_id=26305535257884). We're here for you.


## Related topics

- [Triggering a VoiceAgent Call from Freshdesk](https://help.cloudtalk.io/en/articles/15457387-triggering-a-voiceagent-call-from-freshdesk.md)
- [Triggering a VoiceAgent Call from Freshservice](https://help.cloudtalk.io/en/articles/15502021-triggering-a-voiceagent-call-from-freshservice.md)
- [Triggering a VoiceAgent Call from Pipedrive](https://help.cloudtalk.io/en/articles/15516233-triggering-a-voiceagent-call-from-pipedrive.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.