Suppression Groups
Bulk Suppress Emails
Add multiple email addresses to a suppression group in bulk using the AutoSend API.
POST
/
suppression-groups
/
emails
/
suppress
curl --request POST \
--url 'https://api.autosend.com/v1/suppression-groups/emails/suppress' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false
}'
import requests
response = requests.post(
"https://api.autosend.com/v1/suppression-groups/emails/suppress",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": False,
},
)
print(response.json())
const response = await fetch(
"https://api.autosend.com/v1/suppression-groups/emails/suppress",
{
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
emails: ["user@example.com", "another@example.com"],
groupId: "AB12C3",
reason: "UNSUBSCRIBE",
isGlobal: false,
}),
}
);
const data = await response.json();
console.log(data);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.autosend.com/v1/suppression-groups/emails/suppress");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"emails" => ["user@example.com", "another@example.com"],
"groupId" => "AB12C3",
"reason" => "UNSUBSCRIBE",
"isGlobal" => false,
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"emails": []string{"user@example.com", "another@example.com"},
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false,
})
req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/suppression-groups/emails/suppress", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/suppression-groups/emails/suppress"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require "net/http"
require "uri"
require "json"
uri = URI("https://api.autosend.com/v1/suppression-groups/emails/suppress")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer <token>"
req["Content-Type"] = "application/json"
req.body = {
emails: ["user@example.com", "another@example.com"],
groupId: "AB12C3",
reason: "UNSUBSCRIBE",
isGlobal: false,
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts response.body
{
"success": true,
"data": {
"suppressed": 2
}
}
curl --request POST \
--url 'https://api.autosend.com/v1/suppression-groups/emails/suppress' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false
}'
import requests
response = requests.post(
"https://api.autosend.com/v1/suppression-groups/emails/suppress",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": False,
},
)
print(response.json())
const response = await fetch(
"https://api.autosend.com/v1/suppression-groups/emails/suppress",
{
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
emails: ["user@example.com", "another@example.com"],
groupId: "AB12C3",
reason: "UNSUBSCRIBE",
isGlobal: false,
}),
}
);
const data = await response.json();
console.log(data);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.autosend.com/v1/suppression-groups/emails/suppress");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"emails" => ["user@example.com", "another@example.com"],
"groupId" => "AB12C3",
"reason" => "UNSUBSCRIBE",
"isGlobal" => false,
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"emails": []string{"user@example.com", "another@example.com"},
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false,
})
req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/suppression-groups/emails/suppress", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/suppression-groups/emails/suppress"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require "net/http"
require "uri"
require "json"
uri = URI("https://api.autosend.com/v1/suppression-groups/emails/suppress")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer <token>"
req["Content-Type"] = "application/json"
req.body = {
emails: ["user@example.com", "another@example.com"],
groupId: "AB12C3",
reason: "UNSUBSCRIBE",
isGlobal: false,
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts response.body
{
"success": true,
"data": {
"suppressed": 2
}
}
Authorizations
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Body
The reason for suppression. Stored on each entry for reporting. One of
UNSUBSCRIBE, BOUNCE, COMPLAINT, or MANUAL.When
true, adds the entries to the global suppression list rather than a project-specific group.Response
Emails suppressed successfullyWas this page helpful?
⌘I
curl --request POST \
--url 'https://api.autosend.com/v1/suppression-groups/emails/suppress' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false
}'
import requests
response = requests.post(
"https://api.autosend.com/v1/suppression-groups/emails/suppress",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": False,
},
)
print(response.json())
const response = await fetch(
"https://api.autosend.com/v1/suppression-groups/emails/suppress",
{
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
emails: ["user@example.com", "another@example.com"],
groupId: "AB12C3",
reason: "UNSUBSCRIBE",
isGlobal: false,
}),
}
);
const data = await response.json();
console.log(data);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.autosend.com/v1/suppression-groups/emails/suppress");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"emails" => ["user@example.com", "another@example.com"],
"groupId" => "AB12C3",
"reason" => "UNSUBSCRIBE",
"isGlobal" => false,
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer <token>",
"Content-Type: application/json",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"emails": []string{"user@example.com", "another@example.com"},
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false,
})
req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/suppression-groups/emails/suppress", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"emails": ["user@example.com", "another@example.com"],
"groupId": "AB12C3",
"reason": "UNSUBSCRIBE",
"isGlobal": false
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/suppression-groups/emails/suppress"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require "net/http"
require "uri"
require "json"
uri = URI("https://api.autosend.com/v1/suppression-groups/emails/suppress")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer <token>"
req["Content-Type"] = "application/json"
req.body = {
emails: ["user@example.com", "another@example.com"],
groupId: "AB12C3",
reason: "UNSUBSCRIBE",
isGlobal: false,
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts response.body
{
"success": true,
"data": {
"suppressed": 2
}
}