Outbound
Import suppression rules from CSV
Imports recipient emails from a CSV with a target_value column; skips rows that match an existing active rule.
POST
/
outbound
/
suppression
/
import
Import suppression rules from CSV
curl --request POST \
--url https://api.jetemail.com/outbound/suppression/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/csv' \
--data 'target_value
user@example.com
other@example.com
'import requests
url = "https://api.jetemail.com/outbound/suppression/import"
payload = "target_value\r\nuser@example.com\r\nother@example.com\r\n"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "text/csv"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/csv'},
body: 'target_value\r\nuser@example.com\r\nother@example.com\r\n'
};
fetch('https://api.jetemail.com/outbound/suppression/import', 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.jetemail.com/outbound/suppression/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "target_value\r\nuser@example.com\r\nother@example.com\r\n",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: text/csv"
],
]);
$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.jetemail.com/outbound/suppression/import"
payload := strings.NewReader("target_value\r\nuser@example.com\r\nother@example.com\r\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "text/csv")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jetemail.com/outbound/suppression/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "text/csv")
.body("target_value\r\nuser@example.com\r\nother@example.com\r\n")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jetemail.com/outbound/suppression/import")
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"] = 'text/csv'
request.body = "target_value\r\nuser@example.com\r\nother@example.com\r\n"
response = http.request(request)
puts response.read_body{
"success": true,
"inserted": 12,
"skipped": 3,
"failed": [
{
"row": 5,
"reason": "target_value \"not-an-email\" is not a valid email"
}
]
}{
"success": false,
"error": "Missing required column \"target_value\""
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Body exceeds 5242880 bytes"
}{
"success": false,
"error": "Failed to load existing rules"
}Authorizations
API key for account management endpoints. Use your api_ prefixed token.
Body
text/csv
The body is of type string.
Example:
"target_value\r\nuser@example.com\r\nother@example.com\r\n"
⌘I
Import suppression rules from CSV
curl --request POST \
--url https://api.jetemail.com/outbound/suppression/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/csv' \
--data 'target_value
user@example.com
other@example.com
'import requests
url = "https://api.jetemail.com/outbound/suppression/import"
payload = "target_value\r\nuser@example.com\r\nother@example.com\r\n"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "text/csv"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/csv'},
body: 'target_value\r\nuser@example.com\r\nother@example.com\r\n'
};
fetch('https://api.jetemail.com/outbound/suppression/import', 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.jetemail.com/outbound/suppression/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "target_value\r\nuser@example.com\r\nother@example.com\r\n",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: text/csv"
],
]);
$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.jetemail.com/outbound/suppression/import"
payload := strings.NewReader("target_value\r\nuser@example.com\r\nother@example.com\r\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "text/csv")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.jetemail.com/outbound/suppression/import")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "text/csv")
.body("target_value\r\nuser@example.com\r\nother@example.com\r\n")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jetemail.com/outbound/suppression/import")
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"] = 'text/csv'
request.body = "target_value\r\nuser@example.com\r\nother@example.com\r\n"
response = http.request(request)
puts response.read_body{
"success": true,
"inserted": 12,
"skipped": 3,
"failed": [
{
"row": 5,
"reason": "target_value \"not-an-email\" is not a valid email"
}
]
}{
"success": false,
"error": "Missing required column \"target_value\""
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Body exceeds 5242880 bytes"
}{
"success": false,
"error": "Failed to load existing rules"
}