Updates agent metadata such as name, description, and status.
PATCH https://services.leadconnectorhq.com/agent-studio/agent/{agentId}
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Path parameters
agentId
string
default:"p1q2r3s4t5u6v7w8x9y0z1a2"
required
Query parameters
Body
locationId
string
default:"C2QujeCh8ZnC7al2InWR"
required
Account ID for authorization (cannot be updated)
name
string
default:"Updated Customer Support Agent"
Name of the agent
Status of the agent Posibles valores: ‘active’, ‘inactive’, ‘archived’
Respuestas
200 - Agent metadata updated successfully
422 - Unprocessable Entity
500 - Internal Server Error
message
string
default:"Internal Server Error"
{
"statusCode": 500,
"message": "Internal Server Error"
}
Ejemplo
curl -X PATCH 'https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "C2QujeCh8ZnC7al2InWR",
"name": "Updated Customer Support Agent",
"description": "Updated AI agent with enhanced customer support capabilities",
"status": "active"
}'
const response = await fetch('https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "C2QujeCh8ZnC7al2InWR", "name": "Updated Customer Support Agent", "description": "Updated AI agent with enhanced customer support capabilities", "status": "active"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'PATCH',
'https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "C2QujeCh8ZnC7al2InWR", "name": "Updated Customer Support Agent", "description": "Updated AI agent with enhanced customer support capabilities", "status": "active"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/agent-studio/agent/YOUR_agentId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'locationId': 'C2QujeCh8ZnC7al2InWR', 'name': 'Updated Customer Support Agent', 'description': 'Updated AI agent with enhanced customer support capabilities', 'status': 'active'}),
]);
$data = json_decode(curl_exec($ch), true);