Suppressions API
API reference for managing the email suppression list in Taifa Mail.
Base URL: https://govconnect.ke/v1
All endpoints require authentication via API Key or JWT cookie. API keys use the tfm_k_ prefix.
List suppressions
Returns a paginated list of suppressed email addresses.
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 0 | Page number (zero-indexed). |
limit | integer | 50 | Results per page (max 200). |
search | string | -- | Filter by email address substring. |
cURL:
Python:
Node.js:
Response:
Add a suppression
Add an email address to the suppression list. Emails to suppressed addresses are silently dropped at send time.
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
email_address | string | Yes | The email address to suppress. |
reason | string | No | Reason for suppression. Defaults to "manual". |
Valid reasons:
| Reason | Description |
|---|---|
bounce | The address hard-bounced. |
complaint | The recipient filed a spam complaint. |
manual | Manually added by an account user or API call. |
Response (201 Created):
Remove a suppression
Remove an email address from the suppression list, allowing future emails to be delivered to it.
cURL:
Python:
Node.js:
Response: 204 No Content
No response body is returned.
Bulk suppress from CSV
Upload a CSV file of email addresses to add to the suppression list in bulk. The file is read line by line; each line is treated as one email address (surrounding quotes and commas are stripped). Lines without an @ are ignored.
Bulk suppression requires the Starter plan or above. Free plan users will receive a 403 error.
Request: multipart/form-data with a file field containing the CSV.
cURL:
Python:
Node.js:
Response (201 Created):
| Field | Type | Description |
|---|---|---|
added | integer | Number of new emails added to the suppression list. |
skipped | integer | Number of emails that were already suppressed or invalid. |
total_processed | integer | Total rows processed from the CSV. |
Errors
| Status | Cause |
|---|---|
400 Bad Request | Invalid email address format or missing required fields. |
401 Unauthorized | Missing or invalid authentication token. |
403 Forbidden | Plan does not support this feature (bulk suppress on Free plan). |
404 Not Found | Suppression ID does not exist. |
409 Conflict | Email address is already on the suppression list. |
422 Unprocessable Entity | Request body validation failed. |