API reference
Email suppressions
Manage email suppression lists.
get
/v1/email-suppressionsList suppressed email addresses
Permission
email_suppressions:rNode.js SDKhonkio.suppressions.list()Newest first. Filter with reason (hard_bounce, complaint, unsubscribe or manual) and page with limit (default 50, up to 100) and cursor.
Requires email_suppressions:r.
Responses
- 401Missing, invalid, revoked or expired API key.The standard error body.
- 402The account has no balance, or a LIVE key was used before the first top-up.The standard error body.
- 403The API key lacks the permission this operation requires, or the account is suspended or closed.The standard error body.
- 429Rate limit reached: 100 requests per second per account, or a route-specific limit (Retry-After set where one applies).The standard error body.
- 500Unexpected server error.The standard error body.
Example
const { data, error } = await honkio.suppressions.list({ reason: 'hard_bounce' })
if (error) throw new Error(error.message)
for (const s of data.data) console.log(s.email_address, s.created_at)curl https://api.honkio.ca/v1/email-suppressions \
-H "Authorization: Bearer mk_live_YOUR_KEY"post
/v1/email-suppressionsSuppress an email address
Permission
email_suppressions:wNode.js SDKhonkio.suppressions.create()Adds the address to the suppression list with the reason manual. A send to a suppressed address is refused with EMAIL_SUPPRESSED.
Requires email_suppressions:w.
Request body
The address to block.
| Field | Type | Description |
|---|---|---|
email_addressrequired | string | The address. No email is sent to it again until you remove it.
|
reasonrequired | string | Always manual: bounces, complaints and unsubscribes are added automatically.
|
Responses
- 401Missing, invalid, revoked or expired API key.The standard error body.
- 402The account has no balance, or a LIVE key was used before the first top-up.The standard error body.
- 403The API key lacks the permission this operation requires, or the account is suspended or closed.The standard error body.
- 429Rate limit reached: 100 requests per second per account, or a route-specific limit (Retry-After set where one applies).The standard error body.
- 500Unexpected server error.The standard error body.
Example
const { error } = await honkio.suppressions.create({ emailAddress: 'sam@example.com' })
if (error) throw new Error(error.message)curl -X POST https://api.honkio.ca/v1/email-suppressions \
-H "Authorization: Bearer mk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"email_address": "sam@example.com",
"reason": "manual"
}'delete
/v1/email-suppressions/{address}Remove an address from the suppression list
Permission
email_suppressions:dNode.js SDKhonkio.suppressions.remove()Answers 204, or 404 when the address is not suppressed.
Requires email_suppressions:d.
Parameters
| Parameter | Type | Description |
|---|---|---|
addressrequiredpath | string |
Responses
- 401Missing, invalid, revoked or expired API key.The standard error body.
- 402The account has no balance, or a LIVE key was used before the first top-up.The standard error body.
- 403The API key lacks the permission this operation requires, or the account is suspended or closed.The standard error body.
- 429Rate limit reached: 100 requests per second per account, or a route-specific limit (Retry-After set where one applies).The standard error body.
- 500Unexpected server error.The standard error body.
Example
const { error } = await honkio.suppressions.remove('sam@example.com')
if (error) throw new Error(error.message)curl -X DELETE https://api.honkio.ca/v1/email-suppressions/ADDRESS \
-H "Authorization: Bearer mk_live_YOUR_KEY"
HonkIO