Skip to main content
DELETE
/
phone
/
delete
/
{id}
Delete Phone By ID
curl --request DELETE \
  --url https://server.sellagent.ai/api/phone/delete/{id} \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>'
import requests

url = "https://server.sellagent.ai/api/phone/delete/{id}"

headers = {
    "x-api-key": "<x-api-key>",
    "Content-Type": "<content-type>"
}

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

print(response.text)
const options = {
  method: 'DELETE',
  headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'}
};

fetch('https://server.sellagent.ai/api/phone/delete/{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://server.sellagent.ai/api/phone/delete/{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 => [
    "Content-Type: <content-type>",
    "x-api-key: <x-api-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://server.sellagent.ai/api/phone/delete/{id}"

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

	req.Header.Add("x-api-key", "<x-api-key>")
	req.Header.Add("Content-Type", "<content-type>")

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

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

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://server.sellagent.ai/api/phone/delete/{id}")
  .header("x-api-key", "<x-api-key>")
  .header("Content-Type", "<content-type>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://server.sellagent.ai/api/phone/delete/{id}")

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

request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Phone number deleted successfully"
}
{
  "status": "error",
  "message": "API key is missing or invalid."
}
{
  "status": "error",
  "message": "Phone not found"
}
{
  "status": "error",
  "message": "An unexpected server error occurred."
}

Headers

x-api-key
string
required

Your API key for authentication

Content-Type
enum<string>
required

Must be application/json

Available options:
application/json
x-workspace-id
string

Optional workspace ID (defaults to user's current workspace)

Path Parameters

id
string
required

The ID of the phone to delete

Example:

"+17245868135"

Response

Phone number successfully deleted

success
boolean
Example:

true

message
string
Example:

"Phone number deleted successfully"