Skip to main content

Triggering a VoiceAgent Call from Kustomer

Trigger CloudTalk VoiceAgent calls directly from Kustomer Workflows

V
Written by Valeriia Volobrinskaia

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 (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. Enter your CloudTalk API Key and CloudTalk API Secret (found in your CloudTalk Company Settings).

  2. 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.

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:

    {
    "Authorization": "Basic YOUR_AUTHORIZATION_HEADER",
    "Content-Type": "application/json"
    }
    • Body:

    {
    "call_number": "{{steps.1.phones.0.phone}}",
    "voice_agent_id": "YOUR_VOICE_AGENT_ID"
    }

  3. Save and Enable the workflow

This action:

  • Sends a POST request to the CloudTalk VoiceAgent API

  • Passes the customer's phone number

  • Triggers your VoiceAgent to place the call

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.

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. We're here for you.

Did this answer your question?