Skip to main content
Update an existing action for a voice AI agent. Modifies the behavior and configuration of an agent action.
PUT https://services.leadconnectorhq.com/voice-ai/actions/{actionId}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

actionId
string
required
Unique identifier for the action

Body

agentId
string
default:"507f1f77bcf86cd799439011"
required
Agent ID to attach the action to
locationId
string
default:"507f1f77bcf86cd799439012"
required
Account ID
actionType
string
default:"CALL_TRANSFER"
required
Type of action Posibles valores: ‘CALL_TRANSFER’, ‘DATA_EXTRACTION’, ‘IN_CALL_DATA_EXTRACTION’, ‘WORKFLOW_TRIGGER’, ‘SMS’, ‘APPOINTMENT_BOOKING’, ‘CUSTOM_ACTION’, ‘KNOWLEDGE_BASE’
name
string
default:"Transfer to Manager"
required
Human-readable name for this action
actionParameters
object
required
Action parameters - structure varies by actionType

Respuestas

id
string
default:"507f1f77bcf86cd799439011"
required
Unique identifier for the created action
actionType
string
default:"CALL_TRANSFER"
required
Type of action Posibles valores: ‘CALL_TRANSFER’, ‘DATA_EXTRACTION’, ‘IN_CALL_DATA_EXTRACTION’, ‘WORKFLOW_TRIGGER’, ‘SMS’, ‘APPOINTMENT_BOOKING’, ‘CUSTOM_ACTION’, ‘KNOWLEDGE_BASE’
name
string
default:"Transfer to Manager"
required
Human-readable name for this action
actionParameters
object
required
Action parameters - structure varies by actionType
{
  "id": "507f1f77bcf86cd799439011",
  "actionType": "CALL_TRANSFER",
  "name": "Transfer to Manager"
}
{}
{}
{}

Ejemplo

curl -X PUT 'https://services.leadconnectorhq.com/voice-ai/actions/YOUR_actionId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "agentId": "507f1f77bcf86cd799439011",
  "locationId": "507f1f77bcf86cd799439012",
  "actionType": "CALL_TRANSFER",
  "name": "Transfer to Manager"
}'
const response = await fetch('https://services.leadconnectorhq.com/voice-ai/actions/YOUR_actionId', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"agentId": "507f1f77bcf86cd799439011", "locationId": "507f1f77bcf86cd799439012", "actionType": "CALL_TRANSFER", "name": "Transfer to Manager"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'PUT',
    'https://services.leadconnectorhq.com/voice-ai/actions/YOUR_actionId',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"agentId": "507f1f77bcf86cd799439011", "locationId": "507f1f77bcf86cd799439012", "actionType": "CALL_TRANSFER", "name": "Transfer to Manager"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/voice-ai/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({'agentId': '507f1f77bcf86cd799439011', 'locationId': '507f1f77bcf86cd799439012', 'actionType': 'CALL_TRANSFER', 'name': 'Transfer to Manager'}),
]);
$data = json_decode(curl_exec($ch), true);