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)
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:
Enter your CloudTalk API Key as Username and API Secret as Password
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)
5. Paste the following script into the Function Script editor:
phoneJohn = phoneNumber;
agentId = "YOUR_VOICE_AGENT_ID";
jsonBody = '{"call_number":"' + phoneJohn + '","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;
Replace YOUR_VOICE_AGENT_ID with your actual VoiceAgent ID and XXXXXXXXX with your Base64-encoded credentials from the step above.
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.
6. Click Save Script, then Save.
Create the Automation Rule
Go to Setup > Automation > Workflow Rules
Click New Rule and select the same module you chose in Step 1
Set the trigger event, for example:
Contact created
Ticket status changed to Open
Optional: Add conditions to narrow which records trigger the call (e.g. phone field is not empty, specific department)
Under Actions, select Custom Function > CloudTalk VoiceAgent
Save and enable the rule
Test and verify
Create or update a record that meets your trigger conditions
Go to Setup > Automation > Workflow Rules, open your rule, and check the Logs
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!
💡 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
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 |
| Invalid or expired credentials | Regenerate the |
| Malformed phone number | Ensure the phone number is in E.164 format (e.g. |
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 — we’re here for you.
