Remove tag from subscriber by email address
curl --request DELETE \
--url https://api.kit.com/v4/tags/{tag_id}/subscribers \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/tags/{tag_id}/subscribers")
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/tags/{tag_id}/subscribers', 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/tags/{tag_id}/subscribers"
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/tags/{tag_id}/subscribers",
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/tags/{tag_id}/subscribers"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"errors": [
"The access token is invalid"
]
}{
"errors": [
"Not Found"
]
}{
"errors": [
"Either subscriber id or email address is required to remove tag from subscriber"
]
}Tags
Remove tag from subscriber by email address
Removes the tag from a subscriber identified by the email_address query parameter, returning 204 No Content. The subscriber stays in your account and keeps their other tags — only this tag association is removed.
This is the email-address variant of Remove tag from subscriber — use it when you have the subscriber’s email but not their id. Returns 404 when the tag doesn’t exist or no subscriber matches the email address.
DELETE
/
v4
/
tags
/
{tag_id}
/
subscribers
Remove tag from subscriber by email address
curl --request DELETE \
--url https://api.kit.com/v4/tags/{tag_id}/subscribers \
--header 'X-Kit-Api-Key: <api-key>'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/tags/{tag_id}/subscribers")
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/tags/{tag_id}/subscribers', 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/tags/{tag_id}/subscribers"
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/tags/{tag_id}/subscribers",
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/tags/{tag_id}/subscribers"
headers = {"X-Kit-Api-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text){
"errors": [
"The access token is invalid"
]
}{
"errors": [
"Not Found"
]
}{
"errors": [
"Either subscriber id or email address is required to remove tag from subscriber"
]
}Was this page helpful?