Base URL: https://api.groundmail.dev
Authentication
Requires a full-scope API key (or dashboard session). Sending-scoped keys cannot manage suppressions.
Authorization: Bearer gm_…Behavior
- Emails are stored normalized lowercase.
- Hard bounces, permanent SMTP delivery failures (e.g. invalid mailbox / 5xx), and complaint-like events auto-add suppressions (
source: bounce/complaint). - Block bounces (
bounce_type: "block": the receiving server refused the sender because of reputation or policy, not because of the address) never add a suppression. - Emails refused for their size (
552 5.3.4,5.2.3) fail without adding a suppression: the address takes a smaller email. A full mailbox (552 5.2.2) is still suppressed. - Managed unsubscribe links add suppressions with
source: unsubscribe. - One-click unsubscribes from one category (product or newsletter email) are kept as category opt-outs, not suppressions: the reader still gets your other mail.
POST /emailschecksto/cc/bccbefore sending. Suppressed recipients are left out: the email goes to the rest, and the response lists them inheld_backwithreason: "suppressed". When everytorecipient is suppressed, nothing is sent: the API returns 422 withcode: validation_erroranddetails.suppressed, and emitsemail.suppressed(asuppressedemail record is created).
Tenant lists
If you use tenants, bounces, complaints and unsubscribes on a tenant's email go on that tenant's own list, so a complaint to one of your customers never stops another customer emailing the same person. Sends for a tenant check its list and your account-wide list. Category opt-outs (a reader leaving a tenant's product or newsletter email) are kept per tenant the same way.
GET /suppressions?tenant=cust_8412lists the tenant's list. Its entries carry"tenant": "cust_8412".POST /suppressionswith"tenant": "cust_8412"adds to the tenant's list only.DELETE /suppressions?email=…&tenant=cust_8412(orDELETE /suppressions/{id}?tenant=cust_8412) removes from it.- Add
type=category_opt_outto list or remove a tenant's category opt-outs. - A key limited to one tenant always works on its tenant's list.
Without tenant, these endpoints work on the account-wide list, which applies to every send.
Groundmail validation on send
Your suppression list holds what your account has learned. On top of it, Groundmail validation holds back recipients that cannot receive email before they bounce, whichever account learned it first. See Recipients held back by Groundmail validation for the reasons and the response shapes.
- Held-back recipients are not added to your suppression list. Fix the address and the next send goes out.
- An email with some recipients held back still goes to the rest; one with every
toheld back is refused withdetails.held_back, like a suppressed recipient. - Two of the checks use what Groundmail has seen across senders:
previously_bounced(a hard bounce for any Groundmail sender in the last 90 days; block bounces never count) andmailbox_not_found. An account owner can turn both off in Settings → Suppressions ("Hold back addresses known to bounce"). Invalid addresses and domains with no mail server are always held back. - To check an address before you accept it, use
POST /validate.
List
/suppressionsQuery: limit, cursor, optional email.
{
"data": [
{
"id": "…",
"email": "bad@example.com",
"reason": "550 user unknown",
"source": "bounce",
"created_at": "2026-07-26T12:00:00.000Z",
"updated_at": "2026-07-26T12:00:00.000Z"
}
],
"has_more": false,
"next_cursor": null
}Add
/suppressionssource is set to api. Upserts on (account, email).
{ "email": "user@example.com", "reason": "manual opt-out" }Remove
DELETE /suppressions/{id}, where {id} is the suppression id or the address itself (DELETE /suppressions/user@example.com)
or
/suppressions?email=user@example.comReturns 404 (not_found) when nothing matches.
{ "ok": true }Category opt-outs
A reader who uses the one-click unsubscribe on product or newsletter email is opted out of that category only. Sends in that category to them return 422 with details.category_unsubscribed; transactional email still goes out. A product opt-out also covers newsletters, since it's the broader no; a newsletter opt-out leaves product email alone. On a tenant's email the opt-out applies to that tenant only.
Add type=category_opt_out to the list and remove endpoints to work with these instead of the suppression list. tenant works the same way as for suppressions: with it you see and change that tenant's opt-outs, without it the account-wide ones, and a key limited to one tenant always works on its tenant's.
List opt-outs
/suppressions?type=category_opt_outQuery: limit, cursor, optional email, category (product or newsletter), tenant. Without tenant, add include_tenants=true to list the account-wide opt-outs and every tenant's together.
tenant is null on an account-wide opt-out.
{
"data": [
{
"id": "6f1c…",
"type": "category_opt_out",
"email": "reader@example.com",
"category": "newsletter",
"tenant": "cust_8412",
"created_at": "2026-10-19T12:00:00.000Z",
"updated_at": "2026-10-19T12:00:00.000Z"
}
],
"has_more": false,
"next_cursor": null
}Remove an opt-out
When the reader asks to hear from you again (they re-subscribe, or sign up again), remove the opt-out so sends in that category reach them:
/suppressions?type=category_opt_out&email=reader@example.com&category=newsletter&tenant=cust_8412or by opt-out id (or address):
/suppressions/{id}?type=category_opt_out&tenant=cust_8412Leave out category to remove every category for the address. Returns 404 (not_found) when nothing matches, which you can treat as "already subscribed".
Only remove an opt-out when the reader asked for the mail again. Re-adding someone who unsubscribed is the fastest way to collect spam complaints.
{ "ok": true, "deleted": 1 }SDK
import { Groundmail } from 'groundmail'
const client = new Groundmail(process.env.GROUNDMAIL_API_KEY!)
await client.suppressions.create({ email: 'user@example.com', reason: 'opt-out' })
const { data } = await client.suppressions.list()
await client.suppressions.remove('user@example.com')
// A tenant's own list
await client.suppressions.create({ email: 'user@example.com', tenant: 'cust_8412' })
await client.suppressions.remove('user@example.com', { tenant: 'cust_8412' })
// Category opt-outs: list a tenant's, and re-subscribe a reader to its newsletter
const { data: optOuts } = await client.suppressions.listCategoryOptOuts({ tenant: 'cust_8412' })
await client.suppressions.removeCategoryOptOut('reader@example.com', {
category: 'newsletter',
tenant: 'cust_8412',
})CLI
groundmail suppressions list
groundmail suppressions add --email user@example.com --reason "opt-out"
groundmail suppressions remove --email user@example.com
# Category opt-outs
groundmail suppressions list --type category_opt_out --tenant cust_8412
groundmail suppressions remove --type category_opt_out --email reader@example.com --category newsletter --tenant cust_8412