BIMI API
API reference for managing Brand Indicators for Message Identification (BIMI) logos and DNS configuration in Taifa Mail.
Base URL: https://govconnect.ke/v1
All endpoints require authentication via API Key or JWT cookie unless noted otherwise.
BIMI features require the Pro plan or above. Requests from Free or Starter accounts will receive a 403 error.
Check BIMI readiness
Returns the current BIMI configuration status for a domain, including whether the domain is verified, whether a logo has been uploaded, and the DNS records needed to enable BIMI.
cURL:
Python:
Node.js:
Response:
| Field | Type | Description |
|---|---|---|
domain | string | The domain name. |
domain_verified | boolean | Whether the domain has passed DNS verification. |
bimi_svg_url | string or null | URL of the uploaded BIMI logo, or null if no logo is uploaded. |
bimi_vmc_url | string or null | URL of the Verified Mark Certificate, or null if not configured. |
bimi_enabled | boolean | Whether BIMI is currently enabled for this domain. |
bimi_dns_record | string | The TXT record value to add at bimi_dns_host. |
bimi_dns_host | string | The DNS hostname where the BIMI TXT record should be published. |
dmarc_upgrade_record | string or null | A suggested DMARC record if your current policy is none. BIMI requires quarantine or reject. null if your DMARC policy already meets the requirement. |
Upload BIMI logo
Upload an SVG logo for BIMI.
Request: multipart/form-data with a file field containing the SVG.
File requirements enforced by the API:
- The filename must end in
.svg - The file must contain an
<svgelement - The file size must not exceed 100 KB
For inbox providers to render your logo, the SVG should also conform to the BIMI specification's SVG Tiny Portable/Secure (P/S) profile and be square. The API does not enforce these, so validate them with a BIMI tool before publishing.
cURL:
Python:
Node.js:
Response:
| Field | Type | Description |
|---|---|---|
url | string | The public URL where the logo is served. |
size | integer | File size in bytes. |
bimi_dns_record | string | The TXT record value to publish at bimi_dns_host. |
bimi_dns_host | string | The DNS hostname for the BIMI TXT record. |
After uploading the logo, add the BIMI TXT record to your DNS, then call the enable endpoint. You can verify the DNS record is live using dig TXT default._bimi.yourdomain.com.
Enable BIMI
Enable BIMI for a domain. This endpoint validates that all prerequisites are met before enabling.
Prerequisites:
- The domain must be verified in Taifa Mail.
- A BIMI SVG logo must be uploaded.
- The domain's DMARC policy must be set to
quarantineorreject(notnone).
cURL:
Python:
Node.js:
Response:
| Field | Type | Description |
|---|---|---|
detail | string | Confirmation message. |
bimi_dns_record | string | The BIMI TXT record to publish in DNS (if not already published). |
Serve BIMI logo (public)
Serves the uploaded BIMI SVG logo for a domain. This is a public endpoint and does not require authentication. Mail clients fetch this URL when rendering BIMI logos in the inbox.
The response is cached with a 24-hour Cache-Control header.
cURL:
Python:
Node.js:
Response headers:
Response body: The raw SVG file content.
This endpoint returns 404 Not Found if no logo has been uploaded for the domain, or if the domain does not exist.
Errors
| Status | Cause |
|---|---|
400 Bad Request | Uploaded file is not an .svg, does not contain an <svg> element, or exceeds 100 KB. Also returned by the enable endpoint when no logo is uploaded or the DMARC policy is not quarantine or reject. |
401 Unauthorized | Missing or invalid authentication token (does not apply to the public logo endpoint). |
403 Forbidden | Account is on the Free or Starter plan. BIMI requires Pro or above. |
404 Not Found | Domain ID does not exist, or no logo has been uploaded (logo endpoint only). |