- Connect your agent to any external API
- Configure authentication (Bearer, Basic, API Key)
- Define parameters the agent collects from callers
- Test and debug tool execution
How Custom Actions Work
Custom Actions let your AI agents integrate with external systems during conversations. Your agents can retrieve customer data, update CRM records, check inventory, create tickets, and execute business logic — all in real time while talking to customers. How it works:- Configure the API endpoint - Set up HTTP method, URL, authentication, headers, and request body
- Define variables - Specify what information the agent needs to collect before calling the API
- Agent uses it - During conversation, agent collects the variables and calls your API
- API responds - Your system returns data that the agent uses to continue the conversation
Custom Actions execute synchronously during conversations. For operations that do not need immediate responses, such as logging, analytics, or post-call processing, use Webhooks instead.
Example Flow
Create a Custom API Action
Configure basic info
- Name: Descriptive name (e.g., “Lookup Order Status”)
- Description: When to use this tool (10-200 characters). This helps the AI decide when to invoke it.
Configure the endpoint
Select the HTTP method and enter the endpoint URL. See Endpoint Configuration below.
Add headers and body
Configure custom headers, query parameters, and the request body on the Parameters tab.
Endpoint Configuration
HTTP Method
| Method | Use Case |
|---|---|
| GET | Retrieve data (order status, customer info) |
| POST | Create records (tickets, leads, orders) |
| PUT | Replace entire records |
| PATCH | Update specific fields |
| DELETE | Remove records |
Endpoint URL
Enter the full API URL. The platform auto-prependshttps:// if you omit the protocol.
The endpoint URL itself is static. Use query parameters or the JSON request body for
{{variable_name}} substitutions.Authentication Methods
None
None
No authentication required. Use for public APIs or internal endpoints on private networks.
Bearer Token
Bearer Token
Most common for modern APIs. Sends
Authorization: Bearer {your_token} header.Use for: OAuth 2.0 access tokens, JWT authentication, modern REST APIs.Basic Auth
Basic Auth
Username/password authentication. Sends
Authorization: Basic {base64(username:password)} header.Use for: Legacy APIs, simple authentication schemes.Header
Header
Custom header-based auth (e.g.,
X-API-Key: {your_api_key}).Use for: API key authentication, custom auth schemes.Body
Body
Credentials sent in the request body (e.g.,
{"api_key": "{your_key}"}).Use for: Non-standard auth schemes, login endpoints.Parameters Configuration
Expert ModeHeaders
Add custom HTTP headers as key-value pairs. Example:Content-Type: application/json
Query Parameters (GET requests)
Add URL query parameters as key-value pairs. Template variables are supported in query parameter values. Example:Request Body (POST/PUT/PATCH)
Write your JSON request body in the editor. Use{{variable_name}} syntax to insert values collected from the conversation.
Variables - Parameter Mapping from Conversation Context
Expert Mode Variables define what information your agent needs to collect from the conversation before calling the API. Each variable tells the AI what information to collect from the caller before making the request.Variable Fields
| Field | Description |
|---|---|
| Name | Variable name (e.g., order_number, customer_email) |
| Type | Data type: string, integer, float, boolean, date, email, phone |
| Description | What this variable is for (helps the AI understand when to collect it) |
| Example | Example value (guides the AI on expected format) |
| Required | If true, the AI must collect this before calling the API |
| Default Value | Used if not required and not provided by the customer |
Example Variable
Runtime Variables
Custom Action templates use flat{{variable_name}} placeholders in headers, query parameters, and the request body. These runtime values are available when present:
{{account_id}} or {{cal_email}}.
Testing Tools
Test endpoint independently
Use Postman or cURL to verify the endpoint is reachable, authentication works, and the request format is correct.
Start with static values
Configure the action with hardcoded values first (no variables) to verify basic functionality.
Test in agent
Start Test Agent and run a Web call, Phone call, or Chat session. Trigger the action through conversation and verify:
- Agent collects variables correctly
- API is called with correct data
- Agent uses the response appropriately
Error Handling
Configure your agent prompt to handle API errors gracefully:Troubleshooting
401 Unauthorized
401 Unauthorized
404 Not Found
404 Not Found
Cause: Incorrect URL or resource does not exist.Solution: Verify the static endpoint URL, check that query parameters or body variables populate correctly, and test with static values first.
Agent does not collect variables
Agent does not collect variables
Cause: Variables not configured or descriptions are unclear.Solution: Verify variables are defined in the Variables tab, add clear descriptions and examples, set required=true for essential variables, reference the tool by exact name in your prompt.
Variables not replacing in request
Variables not replacing in request
Cause: Incorrect syntax or variable does not exist.Solution: Use exact syntax
{{variable_name}}, verify the variable is defined, and avoid dotted placeholders such as {{contact.email}} in Custom Action request templates.Timeout errors
Timeout errors
Cause: API responding too slowly.Solution: Optimize API response time, consider using webhooks for slow operations, cache frequently accessed data.
Security Best Practices
- Use HTTPS only for all API endpoints
- Secure credentials - never hardcode in URLs, rotate keys regularly
- Limit permissions - use read-only keys for lookup actions
- Validate inputs - your API should check for injection attempts and validate data types
- Verify identity - authenticate customers before exposing sensitive data
Real-World Examples
CRM Customer Lookup
CRM Customer Lookup
- Method: GET
- URL:
https://api.salesforce.com/customers - Auth: Bearer token
- Variable:
customer_id(string, required) - Query parameter:
customer_id={{customer_id}}
Create Support Ticket
Create Support Ticket
- Method: POST
- URL:
https://company.zendesk.com/api/v2/tickets - Auth: Basic (email/token)
- Variables:
issue_description(string),priority_level(string) - Body:
Check Product Inventory
Check Product Inventory
- Method: GET
- URL:
https://inventory.company.com/products/availability - Auth: Header (
X-API-Key) - Variable:
sku(string, required, example: “PROD-12345”) - Query parameter:
sku={{sku}}
Next Steps
Tools Overview
Learn about all tool types
Custom Action Troubleshooting
Diagnose auth, payload, timeout, and response issues
Booking Tools
Set up Cal.com appointment scheduling
Conversation Data Flow
Understand where variables come from and what happens after tool execution
Template Syntax
Master template variables
MCP Servers
Connect MCP servers for advanced integrations