LISTS
Remove Users from List
API to remove users from a list by passing their distinct_ids.
POST
/
v1
/
subscriber_list
/
{list_id}
/
subscriber
/
remove
/
Remove Subscribers from List
curl --request POST \
--url https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"distinct_ids": [
"_distinct_id1_"
]
}
'import requests
url = "https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/"
payload = { "distinct_ids": ["_distinct_id1_"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({distinct_ids: ['_distinct_id1_']})
};
fetch('https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/', 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://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'distinct_ids' => [
'_distinct_id1_'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/"
payload := strings.NewReader("{\n \"distinct_ids\": [\n \"_distinct_id1_\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"distinct_ids\": [\n \"_distinct_id1_\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"distinct_ids\": [\n \"_distinct_id1_\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"affected_count": 0
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "list_id: _list_id_ not found",
"detail": "list_id: _list_id_ not found"
}Authorizations
Pass as Bearer <API_KEY>. Get API Key from SuprSend dashboard Developers -> API Keys section.
Path Parameters
Unique string identifier of the list to which user needs to be updated
Body
application/json
Array of subscriber_ids, uniquely identifying the subscribers to be removed from the list.
Was this page helpful?
Previous
OverviewOverview of SuprSend APIs to fully replace a subscriber list using start sync, add or remove users in a draft, and finish sync to publish changes.
Next
⌘I
Remove Subscribers from List
curl --request POST \
--url https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"distinct_ids": [
"_distinct_id1_"
]
}
'import requests
url = "https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/"
payload = { "distinct_ids": ["_distinct_id1_"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({distinct_ids: ['_distinct_id1_']})
};
fetch('https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/', 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://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'distinct_ids' => [
'_distinct_id1_'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/"
payload := strings.NewReader("{\n \"distinct_ids\": [\n \"_distinct_id1_\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"distinct_ids\": [\n \"_distinct_id1_\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/subscriber_list/{list_id}/subscriber/remove/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"distinct_ids\": [\n \"_distinct_id1_\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"affected_count": 0
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "list_id: _list_id_ not found",
"detail": "list_id: _list_id_ not found"
}