Taifa MailTaifa Mail Docs
Integrations

REST API

Send official email from any government backend with one authenticated HTTPS request.

The REST API is the most direct way to integrate Taifa Mail with a government system. One authenticated POST sends a message from a verified official domain. It works from any language or framework.

Use cases

  • Send service-request updates, receipts, appointment reminders, and one-time passcodes.
  • Trigger official mail from any language without an SDK.
  • Queue and batch thousands of notices from your own workers.

Step 1: Create an API key

  1. In the dashboard, go to Developer -> API Keys.
  2. Create a key with the emails:send scope.
  3. Copy the tfm_k_... secret. It is shown only once.

Step 2: Send a message

Send a POST to https://govconnect.ke/v1/emails/ with a Bearer token.

curl -X POST 'https://govconnect.ke/v1/emails/' \
  -H 'Authorization: Bearer tfm_k_xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "from_": { "email": "info@health.go.ke", "name": "Ministry of Health" },
    "to": [{ "email": "citizen@example.com" }],
    "subject": "Your service request has been received",
    "html": "<strong>Asante.</strong> Your service request has been received and is being reviewed."
  }'

Step 3: Follow delivery

The response includes an email id. Fetch its status, or wire a webhook to react to events.

The full request and response schema lives in the Emails API reference. Official SDKs are documented under SDKs.

Next steps

On this page