Change AI escalation rules and knowledge-gap behavior
Update the existing guest-facing escalation policy using a fresh get_ai_handoff_policy read and expectedPolicyVersion. enabled and the complete intents array are required; preserve IDs/fields of rules you intend to retain. Omit knowledgeGapBehavior or workingHours to preserve them. New rules may omit id and receive a service-generated stable ID; inspect returned IDs. Normally at most eight rules; existing oversized policies can only shrink without adding IDs. propertyIds must reference active properties from list_properties. Working hours require all seven distinct days with valid HH:mm times in the business timezone. A 409 conflict requires reload/reconciliation. The service schedules existing handoff projections after saving; on uncertain failure read current policy before retrying. This affects future escalation and projection state; it does not resolve cases, send a guest reply, or enable server knowledge-gap rollout gates. Required permission: ai_settings:write. Connected business only.
curl --request PUT \
--url https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedPolicyVersion": "<string>",
"enabled": true,
"intents": [
{
"name": "<string>",
"description": "<string>",
"id": "<string>",
"enabled": true,
"severity": "hard",
"priority": 123,
"propertyIds": [
"<string>"
],
"requiredFields": [
"<string>"
],
"fieldLabels": {}
}
]
}
'import requests
url = "https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy"
payload = {
"expectedPolicyVersion": "<string>",
"enabled": True,
"intents": [
{
"name": "<string>",
"description": "<string>",
"id": "<string>",
"enabled": True,
"severity": "hard",
"priority": 123,
"propertyIds": ["<string>"],
"requiredFields": ["<string>"],
"fieldLabels": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedPolicyVersion: '<string>',
enabled: true,
intents: [
{
name: '<string>',
description: '<string>',
id: '<string>',
enabled: true,
severity: 'hard',
priority: 123,
propertyIds: ['<string>'],
requiredFields: ['<string>'],
fieldLabels: {}
}
]
})
};
fetch('https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expectedPolicyVersion' => '<string>',
'enabled' => true,
'intents' => [
[
'name' => '<string>',
'description' => '<string>',
'id' => '<string>',
'enabled' => true,
'severity' => 'hard',
'priority' => 123,
'propertyIds' => [
'<string>'
],
'requiredFields' => [
'<string>'
],
'fieldLabels' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy"
payload := strings.NewReader("{\n \"expectedPolicyVersion\": \"<string>\",\n \"enabled\": true,\n \"intents\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\",\n \"enabled\": true,\n \"severity\": \"hard\",\n \"priority\": 123,\n \"propertyIds\": [\n \"<string>\"\n ],\n \"requiredFields\": [\n \"<string>\"\n ],\n \"fieldLabels\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedPolicyVersion\": \"<string>\",\n \"enabled\": true,\n \"intents\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\",\n \"enabled\": true,\n \"severity\": \"hard\",\n \"priority\": 123,\n \"propertyIds\": [\n \"<string>\"\n ],\n \"requiredFields\": [\n \"<string>\"\n ],\n \"fieldLabels\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedPolicyVersion\": \"<string>\",\n \"enabled\": true,\n \"intents\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\",\n \"enabled\": true,\n \"severity\": \"hard\",\n \"priority\": 123,\n \"propertyIds\": [\n \"<string>\"\n ],\n \"requiredFields\": [\n \"<string>\"\n ],\n \"fieldLabels\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"tenantId": "<string>",
"enabled": true,
"knowledgeGapBehavior": "disabled",
"policyVersion": "<string>",
"workingHours": {
"enabled": true,
"schedule": [
{
"day": "monday",
"open": true,
"start": "<string>",
"end": "<string>"
}
]
},
"intents": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"enabled": true,
"severity": "hard",
"priority": 123,
"requiredFields": [
"<string>"
],
"propertyIds": [
"<string>"
],
"fieldLabels": {}
}
]
}
}Autorizaciones
Server-side tenant-scoped credential created from Build > API Keys.
Cuerpo
Copy policy.policyVersion from get_ai_handoff_policy, including default when no stored policy exists. Stale versions return HANDOFF_POLICY_VERSION_CONFLICT (409); reload and reconcile.
128100Show child attributes
Show child attributes
disabled, report_only, create_handoff Show child attributes
Show child attributes
Respuesta
Success
Show child attributes
Show child attributes
curl --request PUT \
--url https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedPolicyVersion": "<string>",
"enabled": true,
"intents": [
{
"name": "<string>",
"description": "<string>",
"id": "<string>",
"enabled": true,
"severity": "hard",
"priority": 123,
"propertyIds": [
"<string>"
],
"requiredFields": [
"<string>"
],
"fieldLabels": {}
}
]
}
'import requests
url = "https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy"
payload = {
"expectedPolicyVersion": "<string>",
"enabled": True,
"intents": [
{
"name": "<string>",
"description": "<string>",
"id": "<string>",
"enabled": True,
"severity": "hard",
"priority": 123,
"propertyIds": ["<string>"],
"requiredFields": ["<string>"],
"fieldLabels": {}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedPolicyVersion: '<string>',
enabled: true,
intents: [
{
name: '<string>',
description: '<string>',
id: '<string>',
enabled: true,
severity: 'hard',
priority: 123,
propertyIds: ['<string>'],
requiredFields: ['<string>'],
fieldLabels: {}
}
]
})
};
fetch('https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expectedPolicyVersion' => '<string>',
'enabled' => true,
'intents' => [
[
'name' => '<string>',
'description' => '<string>',
'id' => '<string>',
'enabled' => true,
'severity' => 'hard',
'priority' => 123,
'propertyIds' => [
'<string>'
],
'requiredFields' => [
'<string>'
],
'fieldLabels' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy"
payload := strings.NewReader("{\n \"expectedPolicyVersion\": \"<string>\",\n \"enabled\": true,\n \"intents\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\",\n \"enabled\": true,\n \"severity\": \"hard\",\n \"priority\": 123,\n \"propertyIds\": [\n \"<string>\"\n ],\n \"requiredFields\": [\n \"<string>\"\n ],\n \"fieldLabels\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expectedPolicyVersion\": \"<string>\",\n \"enabled\": true,\n \"intents\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\",\n \"enabled\": true,\n \"severity\": \"hard\",\n \"priority\": 123,\n \"propertyIds\": [\n \"<string>\"\n ],\n \"requiredFields\": [\n \"<string>\"\n ],\n \"fieldLabels\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/settings/ai/handoff-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedPolicyVersion\": \"<string>\",\n \"enabled\": true,\n \"intents\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"id\": \"<string>\",\n \"enabled\": true,\n \"severity\": \"hard\",\n \"priority\": 123,\n \"propertyIds\": [\n \"<string>\"\n ],\n \"requiredFields\": [\n \"<string>\"\n ],\n \"fieldLabels\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"tenantId": "<string>",
"enabled": true,
"knowledgeGapBehavior": "disabled",
"policyVersion": "<string>",
"workingHours": {
"enabled": true,
"schedule": [
{
"day": "monday",
"open": true,
"start": "<string>",
"end": "<string>"
}
]
},
"intents": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"enabled": true,
"severity": "hard",
"priority": 123,
"requiredFields": [
"<string>"
],
"propertyIds": [
"<string>"
],
"fieldLabels": {}
}
]
}
}