Skip to main content
PATCH
/
api
/
v1
/
phone-numbers
/
{uuid}
Update channel settings
curl --request PATCH \
  --url https://{subdomain}.mihu.ai/api/v1/phone-numbers/{uuid} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channel_settings": {
    "voice": {
      "enabled": true,
      "channel_limit": 123,
      "whitelisted_destinations": [
        "US"
      ]
    },
    "sms": {
      "enabled": true,
      "channel_limit": 123,
      "whitelisted_destinations": [
        "<string>"
      ]
    },
    "inbound": {
      "enabled": true,
      "channel_limit": 123
    }
  }
}
'
import requests

url = "https://{subdomain}.mihu.ai/api/v1/phone-numbers/{uuid}"

payload = { "channel_settings": {
"voice": {
"enabled": True,
"channel_limit": 123,
"whitelisted_destinations": ["US"]
},
"sms": {
"enabled": True,
"channel_limit": 123,
"whitelisted_destinations": ["<string>"]
},
"inbound": {
"enabled": True,
"channel_limit": 123
}
} }
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({
channel_settings: {
voice: {enabled: true, channel_limit: 123, whitelisted_destinations: ['US']},
sms: {enabled: true, channel_limit: 123, whitelisted_destinations: ['<string>']},
inbound: {enabled: true, channel_limit: 123}
}
})
};

fetch('https://{subdomain}.mihu.ai/api/v1/phone-numbers/{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/phone-numbers/{uuid}",
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([
'channel_settings' => [
'voice' => [
'enabled' => true,
'channel_limit' => 123,
'whitelisted_destinations' => [
'US'
]
],
'sms' => [
'enabled' => true,
'channel_limit' => 123,
'whitelisted_destinations' => [
'<string>'
]
],
'inbound' => [
'enabled' => true,
'channel_limit' => 123
]
]
]),
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/phone-numbers/{uuid}"

payload := strings.NewReader("{\n \"channel_settings\": {\n \"voice\": {\n \"enabled\": true,\n \"channel_limit\": 123,\n \"whitelisted_destinations\": [\n \"US\"\n ]\n },\n \"sms\": {\n \"enabled\": true,\n \"channel_limit\": 123,\n \"whitelisted_destinations\": [\n \"<string>\"\n ]\n },\n \"inbound\": {\n \"enabled\": true,\n \"channel_limit\": 123\n }\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/phone-numbers/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_settings\": {\n \"voice\": {\n \"enabled\": true,\n \"channel_limit\": 123,\n \"whitelisted_destinations\": [\n \"US\"\n ]\n },\n \"sms\": {\n \"enabled\": true,\n \"channel_limit\": 123,\n \"whitelisted_destinations\": [\n \"<string>\"\n ]\n },\n \"inbound\": {\n \"enabled\": true,\n \"channel_limit\": 123\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{subdomain}.mihu.ai/api/v1/phone-numbers/{uuid}")

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 \"channel_settings\": {\n \"voice\": {\n \"enabled\": true,\n \"channel_limit\": 123,\n \"whitelisted_destinations\": [\n \"US\"\n ]\n },\n \"sms\": {\n \"enabled\": true,\n \"channel_limit\": 123,\n \"whitelisted_destinations\": [\n \"<string>\"\n ]\n },\n \"inbound\": {\n \"enabled\": true,\n \"channel_limit\": 123\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "phone_number_uuid": "9bcb8f00-c0c5-4ee1-9b75-ad1e87a2bd8b",
    "number": "+12084439178",
    "country_code": "US",
    "location": "Sassari, Sardegna",
    "is_external": true,
    "compliance": {
      "requirements": [
        {
          "name": "<string>",
          "description": "<string>"
        }
      ]
    },
    "capabilities": {
      "voice": true,
      "sms": true,
      "mms": true,
      "fax": true,
      "emergency": true,
      "local_calling": true
    },
    "channel_settings": {
      "voice": {
        "enabled": true,
        "channel_limit": 123,
        "whitelisted_destinations": [
          "US"
        ]
      },
      "sms": {
        "enabled": true,
        "channel_limit": 123,
        "whitelisted_destinations": [
          "US"
        ]
      },
      "inbound": {
        "enabled": true,
        "channel_limit": 123
      }
    },
    "billing": {
      "monthly_fee": 123,
      "currency": "EUR"
    },
    "bindings": {
      "call": {
        "bound": true,
        "agent_uuid": "<string>",
        "agent_name": "<string>"
      },
      "sms": {
        "bound": true,
        "agent_uuid": "<string>",
        "agent_name": "<string>"
      },
      "whatsapp": {
        "bound": true,
        "agent_uuid": "<string>",
        "agent_name": "<string>"
      }
    },
    "purchased_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

Body

application/json
channel_settings
object

Response

Updated

success
boolean

Indicates whether the request completed successfully. True for successful responses; false for documented error responses.

data
object

A phone number connected to your workspace. Always returned by inventory and lookup endpoints. The shape is the same for purchased and external (trunk) numbers — fields that don't apply to externals come back as null.