> ## 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 Zoho Desk

> Automate VoiceAgent calls directly from Zoho Desk workflows

> [!NOTE]
>
> You can automatically trigger a CloudTalk VoiceAgent call directly from Zoho Desk Automation Rules. This guide shows you how to create a custom function, connect it to a workflow rule, and verify that calls are being initiated correctly.

**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) — found in **Company Settings > Integrations > API** ([How to access and generate your CloudTalk API keys](https://help.cloudtalk.io/en/articles/15272380-how-to-access-and-generate-your-cloudtalk-api-keys.md))

* A Zoho Desk account with access to Automation

* Contact records with phone numbers

## 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** as Username and **API Secret** as Password

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

You will use this value in the Custom Function script below.

## Set up the integration

### Create the Custom Function

1\. Go to **Setup > Developer Space > Custom Functions**

2\. Click **New Function**

3\. Configure the function:

* **Function Name:** CloudTalk VoiceAgent

* **Module:** Select the module that will trigger the call (e.g. Contacts, Tickets)

4\. Under **Argument Mapping**, add:

* **Argument Name:** `phoneNumber` > **Select Field:** Contact Phone (or the relevant phone field for your module)

![](https://mintcdn.com/cloudtalk/akDGinDOBsihWn_p/images/help-center/articles/15442851/f7b454104051-screenshot-2026-06-08-at-15-17-51.png?fit=max\&auto=format\&n=akDGinDOBsihWn_p\&q=85\&s=cfc3d5d04d921cb621be8e03dc85ae6f)

5\. Paste the following script into the **Function Script** editor:

```
phoneVal = phoneNumber;
agentId = "YOUR_VOICE_AGENT_ID";
jsonBody = '{"call_number":"' + phoneVal + '","voice_agent_id":"' + agentId + '"}';

headers = Map();
headers.put("Authorization","Basic XXXXXXXXX");
headers.put("Content-Type","application/json");

response = invokeurl
[
    url: "https://api.cloudtalk.io/v1/voice-agent/calls"
    type: POST
    parameters: jsonBody
    headers: headers
];

info response;
```

![](https://mintcdn.com/cloudtalk/akDGinDOBsihWn_p/images/help-center/articles/15442851/bfcf2a7d44d3-screenshot-2026-06-08-at-15-18-12.png?fit=max\&auto=format\&n=akDGinDOBsihWn_p\&q=85\&s=1beb14b5d1aa22ae780946174f885432)

Replace `YOUR_VOICE_AGENT_ID` with your actual VoiceAgent ID and `XXXXXXXXX` with your Base64-encoded credentials from the step above.

> [!TIP]
>
> `call_number` and `voice_agent_id` are the only mandatory fields. You can optionally pass additional `call_properties` such as system prompt variables or output variables, depending on your VoiceAgent configuration. [Learn what to include](https://help.cloudtalk.io/en/articles/11401649-voiceagents-for-outbound-calls.md).

6\. Click **Save Script**, then **Save.**

### Create the Automation Rule

1. Go to **Setup > Automation > Workflow Rules**

2. Click **New Rule** and select the same module you chose in Step 1

   ![](https://mintcdn.com/cloudtalk/akDGinDOBsihWn_p/images/help-center/articles/15442851/f2490da4deee-screenshot-2026-06-08-at-15-17-27.png?fit=max\&auto=format\&n=akDGinDOBsihWn_p\&q=85\&s=a833428c1a45abed512a500c62a44f1c)

3\. Set the trigger event, for example:

* Contact created

* Ticket status changed to Open

4**. Optional:** Add conditions to narrow which records trigger the call (e.g. phone field is not empty, specific department)

5\. Under **Actions**, select **Custom Function > CloudTalk VoiceAgent**

![](https://mintcdn.com/cloudtalk/akDGinDOBsihWn_p/images/help-center/articles/15442851/3474f1a58059-screenshot-2026-06-08-at-15-17-38.png?fit=max\&auto=format\&n=akDGinDOBsihWn_p\&q=85\&s=1eefb6c3c83bb50c99b88ccc67e177bf)

6\. Save and enable the rule

### Test and verify

1. Create or update a record that meets your trigger conditions

2. Go to **Setup > Automation > Workflow Rules**, open your rule, and check the **Logs**

3. Confirm in CloudTalk that the VoiceAgent call was initiated

**You're all set!** 🚀 Your setup is complete and ready to start triggering VoiceAgent calls with ease. Let the automation begin!

> [!NOTE]
>
> 💡 **API Limits to Keep in Mind**
>
> *To avoid failures or throttling, make sure your Zoho Desk automation handles call distribution carefully. Use delays or scheduling logic where needed, as the standard API rate limit (60 requests per minute) applies to the VoiceAgent endpoint.*

## Troubleshooting

> [!WARNING]
>
> Before digging into specific errors, check that your Automation Rule is enabled and that a test record actually meets the trigger conditions.

| **Error** | **Likely cause** | **Fix** |
| - | - | - |
| `401 Unauthorized` | Invalid or expired credentials | Regenerate the `Authorization` header and update it in your Custom Function |
| `400 Bad Request` | Malformed phone number | Ensure the phone number is in E.164 format (e.g. `+1234567890`) |
| Rule not firing | Rule is disabled or trigger conditions do not match | Verify the rule is active and that the record meets all conditions |

***

*Need help or have a question?* Just 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 Zoho CRM](https://help.cloudtalk.io/en/articles/15516182-triggering-a-voiceagent-call-from-zoho-crm.md)
- [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 Zendesk](https://help.cloudtalk.io/en/articles/15934846-triggering-a-voiceagent-call-from-zendesk.md)


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