Webhook Management
Configure API endpoints for tool integrations
Webhook Management
Webhook endpoints allow tools to communicate with external APIs. Configure endpoints once in settings, then reference them by name in your tools for portable, environment-independent integrations.
Why Use Endpoint Configuration?
Instead of hardcoding URLs in tools:
// Avoid this
{ "type": "webhook", "url": "https://api.prod.example.com/meals" }Reference configured endpoints:
// Do this instead
{ "type": "webhook", "endpoint": "save_meal" }Benefits
| Benefit | Description |
|---|---|
| Environment portability | Same tools work in dev, staging, prod |
| Centralized configuration | Update URLs in one place |
| Secure headers | Store auth tokens securely |
| Easy testing | Point to mock servers |
Accessing Endpoint Settings
- Navigate to Settings in the dashboard
- Click Manage Endpoints under Webhook Endpoints
- Or go directly to
/dashboard/settings/endpoints
Configuration Interface
API Base URL
Set the base URL for all endpoints:
https://api.example.comIndividual endpoint paths are appended to this base URL.
Example:
- Base URL:
https://api.example.com - Endpoint path:
/api/v1/meals - Full URL:
https://api.example.com/api/v1/meals
Endpoints List
Each endpoint has:
- Name - Identifier used in tools
- Method - HTTP method (GET, POST, PUT, PATCH, DELETE)
- Path - URL path appended to base URL
- Headers - Custom headers (e.g., Authorization)
Adding an Endpoint
- Enter a name in the input field (e.g.,
save_meal)- Lowercase letters, numbers, underscores only
- Names are auto-formatted as you type
- Click Add Endpoint
- Expand the new endpoint to configure it
Configuring an Endpoint
Click on an endpoint to expand its configuration:
Method
Select the HTTP method:
| Method | Use Case |
|---|---|
| GET | Retrieve data |
| POST | Create new records |
| PUT | Replace existing records |
| PATCH | Partial updates |
| DELETE | Remove records |
Path
Enter the API path:
/api/v1/meals
/users/{{user.id}}/preferencesThe full URL is shown below for verification.
Headers
Add custom headers for authentication and configuration:
- Click Add Header
- Enter header name (e.g.,
Authorization) - Enter header value (e.g.,
Bearer {{api_key}}) - Add more headers as needed
Common headers:
| Header | Purpose |
|---|---|
Authorization | API authentication |
Content-Type | Usually set automatically |
X-API-Key | Alternative auth method |
X-Tenant-ID | Multi-tenant identification |
Testing Endpoints
Click the test tube icon to verify connectivity:
- Sends a request to the configured URL
- Shows success (green check) or failure (red X)
- Displays response status in toast notification
Note: Testing uses the exact configuration, so ensure headers are properly set.
Using Endpoints in Tools
Reference endpoints by name in webhook actions:
{
"type": "webhook",
"endpoint": "save_meal",
"payload": {
"meal_type": "params.meal_type",
"dishes": "params.dishes",
"timestamp": "context.current_time"
},
"result_key": "api_response"
}Payload Mapping
Map tool parameters and context to the request body:
| Source | Syntax | Example |
|---|---|---|
| Parameters | params.field | params.meal_type |
| Context | context.path | context.user.id |
| Static value | "value" | "breakfast" |
Storing Results
Use result_key to store the API response in context:
{
"type": "webhook",
"endpoint": "get_user",
"result_key": "api_user"
}Access the result in subsequent actions:
{
"type": "respond",
"message": "Welcome back, {{context.api_user.name}}!"
}Environment Management
Development Setup
Configure endpoints for local development:
Base URL: http://localhost:3000Staging/Production
Update base URL for each environment:
Base URL: https://api.staging.example.com
Base URL: https://api.example.comTools automatically use the correct endpoints based on tenant configuration.
Common Patterns
REST API Integration
Endpoint: create_order
Method: POST
Path: /api/v1/orders
Endpoint: get_order
Method: GET
Path: /api/v1/orders/{{order_id}}
Endpoint: update_order
Method: PATCH
Path: /api/v1/orders/{{order_id}}Authenticated API
Endpoint: secure_api
Method: POST
Path: /api/v1/secure
Headers:
Authorization: Bearer {{tenant.api_token}}
X-Request-ID: {{call.id}}Third-Party Services
Endpoint: send_notification
Method: POST
Path: /v1/messages
Headers:
Authorization: Key {{twilio_key}}
Content-Type: application/jsonError Handling
When webhook calls fail:
- Error is logged with request details
- Tool's
on_failureactions execute - Context contains error information
Handle errors in tools:
{
"on_failure": [
{
"type": "log",
"level": "error",
"message": "Webhook failed",
"data": "error"
},
{
"type": "respond",
"message": "I'm having trouble saving that. Let me try again."
}
]
}Security Best Practices
API Keys
- Never hardcode secrets in tool configurations
- Use tenant settings for API keys
- Reference via context:
{{tenant.api_key}}
HTTPS
- Always use HTTPS for production endpoints
- HTTP allowed only for local development
- Base URL should start with
https://
Minimal Headers
- Only include necessary headers
- Don't expose internal tokens to logs
- Rotate credentials regularly
Troubleshooting
Connection Errors
| Error | Solution |
|---|---|
| Connection refused | Check base URL and path |
| Timeout | Verify endpoint is responsive |
| SSL error | Ensure valid HTTPS certificate |
Authentication Errors
| Error | Solution |
|---|---|
| 401 Unauthorized | Check Authorization header |
| 403 Forbidden | Verify API permissions |
| Invalid token | Refresh or regenerate credentials |
Response Errors
| Error | Solution |
|---|---|
| 400 Bad Request | Check payload mapping |
| 404 Not Found | Verify endpoint path |
| 500 Server Error | Check external API status |