Updates an existing action's configuration. This includes modifying the action name, description, trigger conditions, and behavior settings.
http
PUT https://services.leadconnectorhq.com/conversation-ai/agents/{agentId}/actions/{actionId}Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
actionId | string | Yes | The unique identifier of the action ID Attached to the agent | |
agentId | string | Yes |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
type | string | Yes | triggerWorkflow | Possible values: 'triggerWorkflow', 'updateContactField', 'appointmentBooking', 'stopBot', 'humanHandOver', 'advancedFollowup', 'transferBot' |
name | string | Yes | Trigger a Workflow | |
details | object | Yes | Action-specific details. The structure depends on the action type. For TRIGGER_WORKFLOW use triggerWorkflowDto, for UPDATE_CONTACT_FIELD use updateContactFieldDto, for APPOINTMENT_BOOKING use appointmentBookingDto, for STOP_BOT use stopBotDto, for HUMAN_HAND_OVER use humanHandOverDto, for ADVANCED_FOLLOWUP use advancedFollowupDto, and for TRANSFER_BOT use transferBotDto. |
Responses
200 - Successful response
data(object, required): Updated action detailssuccess(boolean, required): Success status of the request Example:True
json
{
"success": true
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X PUT 'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/actions/YOUR_actionId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"type": "triggerWorkflow",
"name": "Trigger a Workflow"
}'const response = await fetch('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/actions/YOUR_actionId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"type": "triggerWorkflow", "name": "Trigger a Workflow"}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/actions/YOUR_actionId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"type": "triggerWorkflow", "name": "Trigger a Workflow"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/actions/YOUR_actionId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'type': 'triggerWorkflow', 'name': 'Trigger a Workflow'}),
]);
$data = json_decode(curl_exec($ch), true);