Overview
Connectors (also called Agent Actions) allow your AI agent to fetch dynamic data from external APIs and services in real-time. Use connectors to:- Fetch customer data from your CRM or database
- Check order status from your e-commerce system
- Retrieve account information from internal APIs
- Access live data that changes frequently
- Integrate with third-party services
How Connectors Work
- Define the connector with HTTP method, URL, headers, and body
- Reference in procedures using
{{action:connector_name}} - Connector executes when procedure runs
- Response data becomes available to the AI agent
- AI uses the data to provide accurate, personalized responses
Creating a Connector
Step 1: Navigate to Connectors
- Go to Agents → Your Agent → Connectors
- Click “Create Connector”
Step 2: Configure Basic Settings
Fill in the connector details:- Name: Unique identifier (e.g.,
get_order_status) - Description: What this connector does (helps AI understand when to use it)
- Enabled: Toggle to activate/deactivate
Step 3: Configure HTTP Request
HTTP Method
Choose the appropriate method:- GET: Retrieve data (most common)
- POST: Create or submit data
- PUT: Update existing data
- PATCH: Partial update
- DELETE: Remove data
URL
Enter the API endpoint URL. Supports variable substitution:Headers (Optional)
Add HTTP headers as needed: Common Headers:Key: Value format
Request Body (Optional)
For POST, PUT, PATCH requests, provide the request body: JSON Example:Step 4: Test the Connector
- Click “Test Connector”
- Provide sample values for variables
- Review the response
- Verify data structure is correct
Step 5: Save
Click “Save” to create the connector.Using Connectors in Procedures
Reference connectors in your procedure content using the action syntax:Procedures Guide
Learn how to use connectors in procedures
Variable Substitution
Variables in connector URLs, headers, and bodies are replaced with actual values at runtime.Extracting Variables from Conversation
The AI agent automatically extracts relevant information from the conversation: Example Conversation:order_number= “12345”
Available Variables
Variables depend on conversation context and can include:- Customer information:
customer_id,email,name - Order details:
order_number,order_id - Account info:
account_id,username - Custom fields: Any data extracted from conversation
Response Data
Connector responses are available in procedure context.Accessing Response Data
Use dot notation to access nested fields:Response Data in Conditions
Use response data in conditional logic:Authentication
Connectors support various authentication methods:API Key Authentication
In Headers:Bearer Token
In Headers:Basic Auth
In Headers:Custom Authentication
Add custom headers as needed for your API.Best Practices
- Clear Naming: Use descriptive connector names (e.g.,
get_order_status, notaction1) - Good Descriptions: Help AI understand when to use each connector
- Error Handling: Plan for API failures and timeouts
- Secure Credentials: Store API keys securely, never in URLs
- Test Thoroughly: Test connectors with various inputs
- Response Validation: Verify response structure matches expectations
- Rate Limiting: Be mindful of API rate limits
Example Connectors
Example 1: Get Order Status
Name:get_order_status
Description: Fetch order status and tracking information
Method: GET
URL: https://api.shop.com/orders/{{order_number}}
Headers:
Example 2: Check Account Balance
Name:get_account_balance
Description: Retrieve customer account balance
Method: GET
URL: https://api.billing.com/accounts/{{account_id}}/balance
Headers:
Example 3: Update Customer Preferences
Name:update_preferences
Description: Update customer notification preferences
Method: POST
URL: https://api.crm.com/customers/{{customer_id}}/preferences
Headers:
Example 4: Search Knowledge Base
Name:search_internal_kb
Description: Search internal knowledge base for answers
Method: POST
URL: https://kb.company.com/search
Headers:
Troubleshooting
Connector Not Executing
- Verify connector is enabled
- Check connector is referenced correctly in procedure
- Ensure procedure is active and assigned to agent
Variables Not Substituting
- Verify variable names match conversation context
- Check variable syntax:
{{variable_name}} - Ensure AI successfully extracted the variable from conversation
API Errors
- Test connector with valid sample data
- Verify API endpoint URL is correct
- Check authentication credentials are valid
- Review API documentation for required headers/body
Timeout Errors
- Check API response time
- Verify network connectivity
- Consider increasing timeout settings
- Optimize API query if possible
Response Data Not Available
- Verify API returns expected data structure
- Check for API errors in response
- Ensure response is valid JSON (if expected)
- Review procedure syntax for accessing response fields
Security Considerations
- Secure API Keys: Never expose API keys in URLs
- HTTPS Only: Always use HTTPS for API endpoints
- Validate Input: Ensure extracted variables are validated
- Minimal Permissions: Use API keys with minimal required permissions
- Rotate Credentials: Regularly rotate API keys and tokens
- Monitor Usage: Track connector usage for anomalies
Performance Tips
- Cache When Possible: Use cached data for frequently accessed information
- Minimize Calls: Combine multiple data points in one API call when possible
- Optimize Queries: Use efficient API queries
- Set Timeouts: Configure appropriate timeout values
- Handle Failures: Gracefully handle API failures