JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const number = await client.numbers.update('550e8400-e29b-41d4-a716-446655440000');
console.log(number.data);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
number = client.numbers.update(
id="550e8400-e29b-41d4-a716-446655440000",
)
print(number.data)curl --request PATCH \
--url https://api.mobilerun.ai/v1/numbers/phones/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Support line"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/numbers/phones/{id}",
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([
'label' => 'Support line'
]),
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://api.mobilerun.ai/v1/numbers/phones/{id}"
payload := strings.NewReader("{\n \"label\": \"Support line\"\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://api.mobilerun.ai/v1/numbers/phones/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Support line\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/numbers/phones/{id}")
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 \"label\": \"Support line\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"canSend": true,
"cancelAtPeriodEnd": true,
"cancellable": true,
"capabilities": [
"sms"
],
"checkoutUrl": "<string>",
"countryCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"phoneNumber": "<string>",
"purpose": "<string>",
"state": "awaiting_payment",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"message": "<string>",
"reason": "product_disabled",
"success": false
}Numbers
Update a phone number's display label
Updates the phone number’s user-defined display label. Omitting label leaves it unchanged; setting it to null or an empty string clears it. The label is capped at 100 characters, is display-only, and never affects routing. It also seeds the billing entity name when set at purchase time; a later change here does not rename the already-created billing entity.
PATCH
/
numbers
/
phones
/
{id}
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const number = await client.numbers.update('550e8400-e29b-41d4-a716-446655440000');
console.log(number.data);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
number = client.numbers.update(
id="550e8400-e29b-41d4-a716-446655440000",
)
print(number.data)curl --request PATCH \
--url https://api.mobilerun.ai/v1/numbers/phones/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Support line"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/numbers/phones/{id}",
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([
'label' => 'Support line'
]),
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://api.mobilerun.ai/v1/numbers/phones/{id}"
payload := strings.NewReader("{\n \"label\": \"Support line\"\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://api.mobilerun.ai/v1/numbers/phones/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Support line\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/numbers/phones/{id}")
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 \"label\": \"Support line\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"canSend": true,
"cancelAtPeriodEnd": true,
"cancellable": true,
"capabilities": [
"sms"
],
"checkoutUrl": "<string>",
"countryCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"currentPeriodEnd": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"phoneNumber": "<string>",
"purpose": "<string>",
"state": "awaiting_payment",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"message": "<string>",
"reason": "product_disabled",
"success": false
}Authorizations
Bearer token via Authorization header
Path Parameters
Example:
"550e8400-e29b-41d4-a716-446655440000"
Body
application/json
User-defined display label — NFC-normalized, up to 100 GRAPHEMES (not UTF-16 code units; an emoji/flag may span several). Display-only, never used for routing. Also seeds the billing entity name at purchase.
Example:
"Support line"
Response
Number updated
Show child attributes
Show child attributes
Was this page helpful?
⌘I