curl --request PUT \
--url https://{subdomain}.mihu.ai/api/v1/rules/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Aggressive Call Rule",
"max_calls_per_day": 5,
"max_total_calls": 15,
"retry_interval_minutes": 60,
"start_time": "08:00",
"end_time": "20:00",
"dnc_check": true,
"remove_on_opt_out": true,
"escalation_after_failed_attempts": 1,
"escalation_type": "<string>",
"escalation_target": "<string>"
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/rules/{uuid}"
payload = {
"name": "Aggressive Call Rule",
"max_calls_per_day": 5,
"max_total_calls": 15,
"retry_interval_minutes": 60,
"start_time": "08:00",
"end_time": "20:00",
"dnc_check": True,
"remove_on_opt_out": True,
"escalation_after_failed_attempts": 1,
"escalation_type": "<string>",
"escalation_target": "<string>"
}
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({
name: 'Aggressive Call Rule',
max_calls_per_day: 5,
max_total_calls: 15,
retry_interval_minutes: 60,
start_time: '08:00',
end_time: '20:00',
dnc_check: true,
remove_on_opt_out: true,
escalation_after_failed_attempts: 1,
escalation_type: '<string>',
escalation_target: '<string>'
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/rules/{uuid}', 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://{subdomain}.mihu.ai/api/v1/rules/{uuid}",
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([
'name' => 'Aggressive Call Rule',
'max_calls_per_day' => 5,
'max_total_calls' => 15,
'retry_interval_minutes' => 60,
'start_time' => '08:00',
'end_time' => '20:00',
'dnc_check' => true,
'remove_on_opt_out' => true,
'escalation_after_failed_attempts' => 1,
'escalation_type' => '<string>',
'escalation_target' => '<string>'
]),
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://{subdomain}.mihu.ai/api/v1/rules/{uuid}"
payload := strings.NewReader("{\n \"name\": \"Aggressive Call Rule\",\n \"max_calls_per_day\": 5,\n \"max_total_calls\": 15,\n \"retry_interval_minutes\": 60,\n \"start_time\": \"08:00\",\n \"end_time\": \"20:00\",\n \"dnc_check\": true,\n \"remove_on_opt_out\": true,\n \"escalation_after_failed_attempts\": 1,\n \"escalation_type\": \"<string>\",\n \"escalation_target\": \"<string>\"\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://{subdomain}.mihu.ai/api/v1/rules/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Aggressive Call Rule\",\n \"max_calls_per_day\": 5,\n \"max_total_calls\": 15,\n \"retry_interval_minutes\": 60,\n \"start_time\": \"08:00\",\n \"end_time\": \"20:00\",\n \"dnc_check\": true,\n \"remove_on_opt_out\": true,\n \"escalation_after_failed_attempts\": 1,\n \"escalation_type\": \"<string>\",\n \"escalation_target\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/rules/{uuid}")
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 \"name\": \"Aggressive Call Rule\",\n \"max_calls_per_day\": 5,\n \"max_total_calls\": 15,\n \"retry_interval_minutes\": 60,\n \"start_time\": \"08:00\",\n \"end_time\": \"20:00\",\n \"dnc_check\": true,\n \"remove_on_opt_out\": true,\n \"escalation_after_failed_attempts\": 1,\n \"escalation_type\": \"<string>\",\n \"escalation_target\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Rule updated successfully",
"data": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Aggressive call rule",
"type": "call",
"max_calls_per_day": 3,
"max_total_calls": 10,
"retry_interval_minutes": 120,
"start_time": "09:00:00",
"end_time": "18:00:00",
"dnc_check": true,
"remove_on_opt_out": true,
"escalation_after_failed_attempts": 0,
"escalation_type": "<string>",
"escalation_target": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Update an existing rule
Partial update — only fields you send are changed. Important: changing type from ‘call’ to ‘text’ automatically nulls call-only fields (retry_interval_minutes, end_time, escalation_*) regardless of what you send for them. Updates do NOT retroactively rebuild already-scheduled tasks on running campaigns; new tasks created after the update use the new values.
curl --request PUT \
--url https://{subdomain}.mihu.ai/api/v1/rules/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Aggressive Call Rule",
"max_calls_per_day": 5,
"max_total_calls": 15,
"retry_interval_minutes": 60,
"start_time": "08:00",
"end_time": "20:00",
"dnc_check": true,
"remove_on_opt_out": true,
"escalation_after_failed_attempts": 1,
"escalation_type": "<string>",
"escalation_target": "<string>"
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/rules/{uuid}"
payload = {
"name": "Aggressive Call Rule",
"max_calls_per_day": 5,
"max_total_calls": 15,
"retry_interval_minutes": 60,
"start_time": "08:00",
"end_time": "20:00",
"dnc_check": True,
"remove_on_opt_out": True,
"escalation_after_failed_attempts": 1,
"escalation_type": "<string>",
"escalation_target": "<string>"
}
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({
name: 'Aggressive Call Rule',
max_calls_per_day: 5,
max_total_calls: 15,
retry_interval_minutes: 60,
start_time: '08:00',
end_time: '20:00',
dnc_check: true,
remove_on_opt_out: true,
escalation_after_failed_attempts: 1,
escalation_type: '<string>',
escalation_target: '<string>'
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/rules/{uuid}', 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://{subdomain}.mihu.ai/api/v1/rules/{uuid}",
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([
'name' => 'Aggressive Call Rule',
'max_calls_per_day' => 5,
'max_total_calls' => 15,
'retry_interval_minutes' => 60,
'start_time' => '08:00',
'end_time' => '20:00',
'dnc_check' => true,
'remove_on_opt_out' => true,
'escalation_after_failed_attempts' => 1,
'escalation_type' => '<string>',
'escalation_target' => '<string>'
]),
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://{subdomain}.mihu.ai/api/v1/rules/{uuid}"
payload := strings.NewReader("{\n \"name\": \"Aggressive Call Rule\",\n \"max_calls_per_day\": 5,\n \"max_total_calls\": 15,\n \"retry_interval_minutes\": 60,\n \"start_time\": \"08:00\",\n \"end_time\": \"20:00\",\n \"dnc_check\": true,\n \"remove_on_opt_out\": true,\n \"escalation_after_failed_attempts\": 1,\n \"escalation_type\": \"<string>\",\n \"escalation_target\": \"<string>\"\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://{subdomain}.mihu.ai/api/v1/rules/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Aggressive Call Rule\",\n \"max_calls_per_day\": 5,\n \"max_total_calls\": 15,\n \"retry_interval_minutes\": 60,\n \"start_time\": \"08:00\",\n \"end_time\": \"20:00\",\n \"dnc_check\": true,\n \"remove_on_opt_out\": true,\n \"escalation_after_failed_attempts\": 1,\n \"escalation_type\": \"<string>\",\n \"escalation_target\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/rules/{uuid}")
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 \"name\": \"Aggressive Call Rule\",\n \"max_calls_per_day\": 5,\n \"max_total_calls\": 15,\n \"retry_interval_minutes\": 60,\n \"start_time\": \"08:00\",\n \"end_time\": \"20:00\",\n \"dnc_check\": true,\n \"remove_on_opt_out\": true,\n \"escalation_after_failed_attempts\": 1,\n \"escalation_type\": \"<string>\",\n \"escalation_target\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Rule updated successfully",
"data": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Aggressive call rule",
"type": "call",
"max_calls_per_day": 3,
"max_total_calls": 10,
"retry_interval_minutes": 120,
"start_time": "09:00:00",
"end_time": "18:00:00",
"dnc_check": true,
"remove_on_opt_out": true,
"escalation_after_failed_attempts": 0,
"escalation_type": "<string>",
"escalation_target": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Path Parameters
UUID of the rule to update.
Body
New display name. 3-255 characters.
3 - 255"Aggressive Call Rule"
Switch the rule between call (multi-attempt with cadence) and text (one-shot). Switching to 'text' clears call-only fields automatically.
call, text Per-contact daily attempt cap, evaluated in contact's local timezone.
x >= 15
Per-contact lifetime attempt cap across the campaign date range.
x >= 115
Minimum minutes between attempts. Honored only for type='call'.
x >= 160
Earliest local time of day (HH:MM, 24h) the system may attempt the contact.
"08:00"
Latest local time of day (HH:MM, 24h). Cleared if type is or becomes 'text'.
"20:00"
Toggle DNC list filtering at task-creation time.
Toggle automatic pool removal on inbound opt-out.
Trigger threshold for escalation. 0 disables. Cleared if type='text'.
x >= 0Free-form escalation identifier consumed by your downstream logic.
255Free-form escalation payload (email, team UUID, instructions).
