Skip to main content
POST
/
v1
/
inbound
/
{phone_number}
/
delete
Delete Inbound Phone Number
curl --request POST \
  --url https://api.bland.ai/v1/inbound/{phone_number}/delete \
  --header 'authorization: <authorization>' \
  --header 'encrypted_key: <encrypted_key>'
import requests

url = "https://api.bland.ai/v1/inbound/{phone_number}/delete"

headers = {
"authorization": "<authorization>",
"encrypted_key": "<encrypted_key>"
}

response = requests.post(url, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {authorization: '<authorization>', encrypted_key: '<encrypted_key>'}
};

fetch('https://api.bland.ai/v1/inbound/{phone_number}/delete', 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.bland.ai/v1/inbound/{phone_number}/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>",
"encrypted_key: <encrypted_key>"
],
]);

$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.bland.ai/v1/inbound/{phone_number}/delete"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("authorization", "<authorization>")
req.Header.Add("encrypted_key", "<encrypted_key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.bland.ai/v1/inbound/{phone_number}/delete")
.header("authorization", "<authorization>")
.header("encrypted_key", "<encrypted_key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bland.ai/v1/inbound/{phone_number}/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["encrypted_key"] = '<encrypted_key>'

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "message": "Successfully deleted number from database: +15555555555"
}

Headers

authorization
string
required
Your API key for authentication.
encrypted_key
string
required
The encrypted_key for the Twilio account that owns the phone number you want to delete.Learn more about BYOT here.

Path

phone_number
string
required
The phone number you want to remove from Bland’s system.

Response

status
string
Can be success or error.
message
string
A message saying whether the deletion succeeded, or a helpful message describing why it failed.
{
  "status": "success",
  "message": "Successfully deleted number from database: +15555555555"
}

Docs for agents: llms.txt