Remove Recipients
curl --request DELETE \
--url https://api.example.com/email/lists/{list_id}/recipients/{identifier} \
--header 'Content-Type: application/json' \
--data '
{
"emails": [
"<string>"
],
"external_ids": [
"<string>"
]
}
'import requests
url = "https://api.example.com/email/lists/{list_id}/recipients/{identifier}"
payload = {
"emails": ["<string>"],
"external_ids": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({emails: ['<string>'], external_ids: ['<string>']})
};
fetch('https://api.example.com/email/lists/{list_id}/recipients/{identifier}', 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.example.com/email/lists/{list_id}/recipients/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'emails' => [
'<string>'
],
'external_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/email/lists/{list_id}/recipients/{identifier}"
payload := strings.NewReader("{\n \"emails\": [\n \"<string>\"\n ],\n \"external_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
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.delete("https://api.example.com/email/lists/{list_id}/recipients/{identifier}")
.header("Content-Type", "application/json")
.body("{\n \"emails\": [\n \"<string>\"\n ],\n \"external_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/email/lists/{list_id}/recipients/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"emails\": [\n \"<string>\"\n ],\n \"external_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"removed": 123,
"already_removed": 123,
"skipped_unsubscribed": 123,
"not_found": [
"<string>"
]
}Mailing Lists
Remove Recipients
Take one recipient (or a batch) off a list without erasing their opt-out history
DELETE
/
email
/
lists
/
{list_id}
/
recipients
/
{identifier}
Remove Recipients
curl --request DELETE \
--url https://api.example.com/email/lists/{list_id}/recipients/{identifier} \
--header 'Content-Type: application/json' \
--data '
{
"emails": [
"<string>"
],
"external_ids": [
"<string>"
]
}
'import requests
url = "https://api.example.com/email/lists/{list_id}/recipients/{identifier}"
payload = {
"emails": ["<string>"],
"external_ids": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({emails: ['<string>'], external_ids: ['<string>']})
};
fetch('https://api.example.com/email/lists/{list_id}/recipients/{identifier}', 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.example.com/email/lists/{list_id}/recipients/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'emails' => [
'<string>'
],
'external_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/email/lists/{list_id}/recipients/{identifier}"
payload := strings.NewReader("{\n \"emails\": [\n \"<string>\"\n ],\n \"external_ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
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.delete("https://api.example.com/email/lists/{list_id}/recipients/{identifier}")
.header("Content-Type", "application/json")
.body("{\n \"emails\": [\n \"<string>\"\n ],\n \"external_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/email/lists/{list_id}/recipients/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"emails\": [\n \"<string>\"\n ],\n \"external_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"removed": 123,
"already_removed": 123,
"skipped_unsubscribed": 123,
"not_found": [
"<string>"
]
}Removal is a soft state. A removed recipient stops getting release emails but keeps their row, so a later upsert or add puts them back, and a contact who unsubscribed themselves can never be removed-then-re-added as a way around their opt-out.
Two forms:
At least one of the two, at most 1000 identifiers in total.
- Single —
DELETE /email/lists/{list_id}/recipients/{identifier}, whereidentifieris matched as an email address first (case-insensitive), then as anexternal_id. - Batch —
POST /email/lists/{list_id}/recipients/removewithemailsand/orexternal_ids, up to 1000 identifiers.
Authentication
This endpoint requires an API token passed as a Bearer token in theAuthorization header.
Authorization: Bearer YOUR_API_TOKEN
Single removal
Path Parameters
string
required
The mailing list’s unique identifier (UUID).
string
required
An email address or an
external_id. URL-encode it (@ is fine as is in most clients).Request
cURL
curl -X DELETE "https://api.shipstar.ai/api/v1/email/lists/a1b2c3d4-e5f6-7890-abcd-ef1234567890/recipients/usr_42" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response
string
required
removed (was active), already_removed, or unsubscribed (left untouched).200
{"status": "removed"}
Batch removal
POST /email/lists/{list_id}/recipients/remove
Body
string[]
Email addresses to remove
string[]
External ids to remove
Request
cURL
curl -X POST "https://api.shipstar.ai/api/v1/email/lists/a1b2c3d4-e5f6-7890-abcd-ef1234567890/recipients/remove" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"external_ids": ["usr_42", "usr_43"], "emails": ["[email protected]"]}'
Response
integer
required
Active recipients now removed
integer
required
Identifiers that were already removed
integer
required
Identifiers matching unsubscribed recipients (untouched)
string[]
required
Identifiers that matched nothing on this list
200
{
"removed": 2,
"already_removed": 0,
"skipped_unsubscribed": 0,
"not_found": ["[email protected]"]
}
Errors
| Status | Description |
|---|---|
| 401 | Invalid or expired API token |
| 404 | Mailing list not found in the token’s project, or (single form) no recipient matches the identifier |
| 422 | Batch body has neither emails nor external_ids, or more than 1000 identifiers |
Rate Limits
Both forms are limited to 30 requests per minute per IP.Was this page helpful?