Import suppressions from CSV
Import a whole CSV of suppressions as a background job.
For anything bigger than a few thousand entries — say, 200k bounces from your previous ESP — upload a CSV once and let the import job chew through it in the background in 1,000-row batches. Rows import with source: import, which keeps migrated entries out of your deliverability analytics.
POST /v3/suppressions/{type}/import
Request
Send multipart/form-data with the CSV in a field named file, up to 25 MB. Column 1 = email, optional column 2 = reason; a header row containing “email” in the first cell is skipped automatically. Quoted cells and escaped quotes are handled.
Responses
| Status | Description |
|---|---|
202 | { import_id, status: "pending" } — poll GET /v3/suppressions/imports/{id} for progress and the per-row error report. |
400 | Missing file, or file larger than 25 MB. |
429 | Rate limit exceeded (10 calls/minute). |
Code examples
cURL
curl -X POST https://api.wemail.io/v3/suppressions/{type}/import \
-H "Authorization: Bearer afn_live_…"Node.js
const res = await fetch("https://api.wemail.io/v3/suppressions/{type}/import", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
},
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://api.wemail.io/v3/suppressions/{type}/import",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
data = r.json()