Saved Searches
Delete saved search
Deletes the saved search and stops its emails for good. To stop the emails but keep the search, use the pause endpoint instead.
DELETE
/
v1.0
/
leads
/
{leadId}
/
savedSearches
/
{savedSearchId}
Delete a lead's property alert or market snapshot
curl --request DELETE \
--url https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}', 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.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}",
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: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
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://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
response = http.request(request)
puts response.read_body{
"savedSearchId": 88123456789
}Path Parameters
ID of the lead the saved search belongs to.
Required range:
x >= 1ID of the saved search to delete.
Required range:
x >= 1Response
Success. A request rejected by validation or by a business rule also answers HTTP 200, with {"code": <error code>, "message": "..."} in place of the result: check code in the body, not the HTTP status. Codes are listed under Errors in the Saved Searches section.
ID of the deleted saved search
Example:
88123456789
⌘I
Delete a lead's property alert or market snapshot
curl --request DELETE \
--url https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'}
};
fetch('https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}', 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.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}",
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: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
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://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/leads/{leadId}/savedSearches/{savedSearchId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
response = http.request(request)
puts response.read_body{
"savedSearchId": 88123456789
}