Update phone normalizers
curl --request PATCH \
--url https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outbound": {
"default_prefix": "+90",
"condition_length": 10,
"condition_prefix": "0"
},
"inbound": {
"default_prefix": null,
"condition_length": null,
"condition_prefix": null
}
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers"
payload = {
"outbound": {
"default_prefix": "+90",
"condition_length": 10,
"condition_prefix": "0"
},
"inbound": {
"default_prefix": None,
"condition_length": None,
"condition_prefix": None
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
outbound: {default_prefix: '+90', condition_length: 10, condition_prefix: '0'},
inbound: {default_prefix: null, condition_length: null, condition_prefix: null}
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers', 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/agents/{uuid}/normalizers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'outbound' => [
'default_prefix' => '+90',
'condition_length' => 10,
'condition_prefix' => '0'
],
'inbound' => [
'default_prefix' => null,
'condition_length' => null,
'condition_prefix' => null
]
]),
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/agents/{uuid}/normalizers"
payload := strings.NewReader("{\n \"outbound\": {\n \"default_prefix\": \"+90\",\n \"condition_length\": 10,\n \"condition_prefix\": \"0\"\n },\n \"inbound\": {\n \"default_prefix\": null,\n \"condition_length\": null,\n \"condition_prefix\": null\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outbound\": {\n \"default_prefix\": \"+90\",\n \"condition_length\": 10,\n \"condition_prefix\": \"0\"\n },\n \"inbound\": {\n \"default_prefix\": null,\n \"condition_length\": null,\n \"condition_prefix\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outbound\": {\n \"default_prefix\": \"+90\",\n \"condition_length\": 10,\n \"condition_prefix\": \"0\"\n },\n \"inbound\": {\n \"default_prefix\": null,\n \"condition_length\": null,\n \"condition_prefix\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Normalizers updated successfully",
"data": {
"outbound": {
"default_prefix": "+90",
"condition_length": 10,
"condition_prefix": "0"
},
"inbound": {
"default_prefix": null,
"condition_length": null,
"condition_prefix": null
}
}
}Agents
Update phone normalizers
Partial update of the outbound and inbound phone-number normalizer rules. Each side accepts default_prefix, condition_length, condition_prefix.
PATCH
/
api
/
v1
/
agents
/
{uuid}
/
normalizers
Update phone normalizers
curl --request PATCH \
--url https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outbound": {
"default_prefix": "+90",
"condition_length": 10,
"condition_prefix": "0"
},
"inbound": {
"default_prefix": null,
"condition_length": null,
"condition_prefix": null
}
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers"
payload = {
"outbound": {
"default_prefix": "+90",
"condition_length": 10,
"condition_prefix": "0"
},
"inbound": {
"default_prefix": None,
"condition_length": None,
"condition_prefix": None
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
outbound: {default_prefix: '+90', condition_length: 10, condition_prefix: '0'},
inbound: {default_prefix: null, condition_length: null, condition_prefix: null}
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers', 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/agents/{uuid}/normalizers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'outbound' => [
'default_prefix' => '+90',
'condition_length' => 10,
'condition_prefix' => '0'
],
'inbound' => [
'default_prefix' => null,
'condition_length' => null,
'condition_prefix' => null
]
]),
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/agents/{uuid}/normalizers"
payload := strings.NewReader("{\n \"outbound\": {\n \"default_prefix\": \"+90\",\n \"condition_length\": 10,\n \"condition_prefix\": \"0\"\n },\n \"inbound\": {\n \"default_prefix\": null,\n \"condition_length\": null,\n \"condition_prefix\": null\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outbound\": {\n \"default_prefix\": \"+90\",\n \"condition_length\": 10,\n \"condition_prefix\": \"0\"\n },\n \"inbound\": {\n \"default_prefix\": null,\n \"condition_length\": null,\n \"condition_prefix\": null\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/agents/{uuid}/normalizers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outbound\": {\n \"default_prefix\": \"+90\",\n \"condition_length\": 10,\n \"condition_prefix\": \"0\"\n },\n \"inbound\": {\n \"default_prefix\": null,\n \"condition_length\": null,\n \"condition_prefix\": null\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Normalizers updated successfully",
"data": {
"outbound": {
"default_prefix": "+90",
"condition_length": 10,
"condition_prefix": "0"
},
"inbound": {
"default_prefix": null,
"condition_length": null,
"condition_prefix": null
}
}
}⌘I