Phone Numbers
Delete phone number
Disconnect a phone number from Verbeo. Its call history and finished campaigns are kept; a campaign that can still dial from it blocks the delete.
DELETE
/
phone-number
/
{id}
Delete phone number
curl --request DELETE \
--url https://api.verbeo.ai/v1/phone-number/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v1/phone-number/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v1/phone-number/{id}', 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://api.verbeo.ai/v1/phone-number/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.verbeo.ai/v1/phone-number/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.verbeo.ai/v1/phone-number/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/phone-number/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyDeletes a phone number from your workspace. This cannot be undone, but the number can be added again.
- Call history is kept. Past calls stay in your logs with the number they used.
- Campaigns that have finished or were cancelled are kept, without a number to dial from.
- For a SIP-trunk number, the trunks Verbeo set up for it are removed.
- Nothing changes at your carrier: the number is still yours there.
A campaign that can still dial from the number — any campaign that is not completed or cancelled, so a draft, a scheduled, a running or a paused one — blocks the delete with
409 CONFLICT. Cancel it, or let it finish, first.Path parameters
string
required
UUID of the phone number.
Request
curl -X DELETE "https://api.verbeo.ai/v1/phone-number/7d9f3b52-4c1e-4a8e-9b1a-2f6c0d4e8a11" \
-H "Authorization: Bearer YOUR_API_KEY"
const id = "7d9f3b52-4c1e-4a8e-9b1a-2f6c0d4e8a11";
const res = await fetch(`https://api.verbeo.ai/v1/phone-number/${id}`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.VERBEO_API_KEY}` },
});
// 204 No Content
import os, requests
number_id = "7d9f3b52-4c1e-4a8e-9b1a-2f6c0d4e8a11"
res = requests.delete(
f"https://api.verbeo.ai/v1/phone-number/{number_id}",
headers={"Authorization": f"Bearer {os.environ['VERBEO_API_KEY']}"},
)
assert res.status_code == 204
Response
204 No Content, with no body.
Errors
| Code | Status | When |
|---|---|---|
CONFLICT | 409 | A campaign can still dial from this number. The message names it: Campaign "Renewals" is still using this number (scheduled). Cancel it or let it finish before deleting the number. |
NOT_FOUND | 404 | No such phone number, or it belongs to another workspace. |
VALIDATION_FAILED | 422 | id is not a UUID. |
Was this page helpful?
⌘I
Delete phone number
curl --request DELETE \
--url https://api.verbeo.ai/v1/phone-number/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v1/phone-number/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v1/phone-number/{id}', 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://api.verbeo.ai/v1/phone-number/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.verbeo.ai/v1/phone-number/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.verbeo.ai/v1/phone-number/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v1/phone-number/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body