Skip to main content
PUT
/
api
/
v1
/
rules
/
{uuid}
Update an existing rule
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",
    "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

Authorization
string
header
required

Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"

Path Parameters

uuid
string<uuid>
required

UUID of the rule to update.

Body

application/json
name
string

New display name. 3-255 characters.

Required string length: 3 - 255
Example:

"Aggressive Call Rule"

type
enum<string>

Switch the rule between call (multi-attempt with cadence) and text (one-shot). Switching to 'text' clears call-only fields automatically.

Available options:
call,
text
max_calls_per_day
integer

Per-contact daily attempt cap, evaluated in contact's local timezone.

Required range: x >= 1
Example:

5

max_total_calls
integer

Per-contact lifetime attempt cap across the campaign date range.

Required range: x >= 1
Example:

15

retry_interval_minutes
integer | null

Minimum minutes between attempts. Honored only for type='call'.

Required range: x >= 1
Example:

60

start_time
string

Earliest local time of day (HH:MM, 24h) the system may attempt the contact.

Example:

"08:00"

end_time
string | null

Latest local time of day (HH:MM, 24h). Cleared if type is or becomes 'text'.

Example:

"20:00"

dnc_check
boolean

Toggle DNC list filtering at task-creation time.

remove_on_opt_out
boolean

Toggle automatic pool removal on inbound opt-out.

escalation_after_failed_attempts
integer | null

Trigger threshold for escalation. 0 disables. Cleared if type='text'.

Required range: x >= 0
escalation_type
string | null

Free-form escalation identifier consumed by your downstream logic.

Maximum string length: 255
escalation_target
string | null

Free-form escalation payload (email, team UUID, instructions).

Response

Updated rule resource.

success
boolean
Example:

true

message
string
Example:

"Rule updated successfully"

data
object

Campaign contact rule. Drives task cadence, retry interval, working-hours window, and escalation policy when attached to a campaign.