Delete a subscriber's location
curl --request DELETE \
--url https://api.kit.com/v4/subscribers/{subscriber_id}/location \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/subscribers/{subscriber_id}/location")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyconst options = {method: 'DELETE', headers: {'X-Kit-Api-Key': '<api-key>'}};
fetch('https://api.kit.com/v4/subscribers/{subscriber_id}/location', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/subscribers/{subscriber_id}/location"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/subscribers/{subscriber_id}/location",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/subscribers/{subscriber_id}/location"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"errors": [
"Not Found"
]
}Subscribers
Delete a subscriber's location
Removes the subscriber’s pinned location and returns 204 No Content on success. After deletion, Kit may re-infer the subscriber’s location from future open events.
To set or replace a pinned location, use Pin a subscriber’s location; to replace the values on an existing pin, use Update a subscriber’s pinned location. Returns 404 when the subscriber is not found.
DELETE
/
v4
/
subscribers
/
{subscriber_id}
/
location
Delete a subscriber's location
curl --request DELETE \
--url https://api.kit.com/v4/subscribers/{subscriber_id}/location \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/subscribers/{subscriber_id}/location")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyconst options = {method: 'DELETE', headers: {'X-Kit-Api-Key': '<api-key>'}};
fetch('https://api.kit.com/v4/subscribers/{subscriber_id}/location', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/subscribers/{subscriber_id}/location"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/subscribers/{subscriber_id}/location",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/subscribers/{subscriber_id}/location"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"errors": [
"Not Found"
]
}Related topics
Pin a subscriber's locationUpdate a subscriber's pinned locationUpgrading to V4API AuthenticationGet a subscriberWas this page helpful?