> For a complete page index, fetch https://developer.close.com/llms.txt # Delete a phone number DELETE https://api.close.com/api/v1/phone_number/{id}/ If you're the only member of a number, you can delete it. Deleting any other number requires the "Manage Team Phone Numbers" permission. Reference: https://developer.close.com/api/resources/phone-numbers/delete ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `id` (string, required) ## Response ### 200 Successful response ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Examples **Response** ```json {} ``` **SDK Code** ```python import requests url = "https://api.close.com/api/v1/phone_number/id/" response = requests.delete(url, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://api.close.com/api/v1/phone_number/id/'; const credentials = btoa(":"); const options = {method: 'DELETE', headers: {Authorization: `Basic ${credentials}`}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/phone_number/id/" req, _ := http.NewRequest("DELETE", url, nil) req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/phone_number/id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.close.com/api/v1/phone_number/id/") .basicAuth("", "") .asString(); ``` ```php request('DELETE', 'https://api.close.com/api/v1/phone_number/id/', [ 'headers' => [ ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/phone_number/id/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.DELETE); IRestResponse response = client.Execute(request); ```