Inbound & Inbox API
API reference for hosted mailbox webmail and the admin inbound message log.
Base URL: https://govconnect.ke/v1
The authenticated /v1/inbound archive API has been retired. Do not call GET /v1/inbound, POST /v1/inbound/{id}/archive, or related endpoints: they are no longer mounted. Read mail through webmail or the /v1/inbox API below.
Mail intake itself is handled by Taifa Mail's mail servers (Postfix/Dovecot), not by a public "upload message" endpoint. For a domain to receive mail, its MX record must point to mx1.govconnect.ke.
Webmail inbox API
Hosted mailboxes are accessed at /v1/inbox/{mailbox_id}/…. Every endpoint authorises the caller against that mailbox first:
- User session (OAuth JWT or API key): the caller must belong to the mailbox's organisation and be assigned to the mailbox, or be an org owner/admin (audit-logged as opened as).
- Mailbox session (
mailbox_accesstoken from mail.govconnect.ke login): may act on only that mailbox.
All endpoints require authentication via API key or JWT cookie.
List folders
Returns IMAP folders with unseen/total counts.
List messages
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
folder | string | INBOX | IMAP folder path. |
limit | integer | 50 | Results per page (1-200). |
offset | integer | 0 | Row offset for pagination. |
Full-text search is a separate endpoint:
Query parameters: q (string, required), plus folder, limit, and offset as above.
Get a message
Returns the full parsed message for the given IMAP UID in the message's folder.
Message actions
Send mail
Request body (JSON):
Provide at least one of text or html. Plain text is auto-wrapped in HTML when only text is supplied.
Attachments
Returns raw attachment bytes.
Labels, scheduled send, quota
See the webmail UI at mail.govconnect.ke for the full feature set these endpoints back.
Admin inbound log
ICT administrators can inspect how an inbound message was routed (received → parsed → forwarding rules) from the unified email log.
Requires the domains:view permission. Returns metadata, a text preview, attachment count, and an events array (the message's routing log). This is read-only; it does not replace webmail for reading officer mailboxes.
Example response (abbreviated):
Inbound messages also appear in the merged Developer → Email Logs list when you filter for received mail.
Errors
| Status | Cause |
|---|---|
401 Unauthorized | Missing or invalid authentication. |
403 Forbidden | Caller cannot access this mailbox or lacks admin permission. |
404 Not Found | Mailbox, message UID, or inbound log ID does not exist. |
422 Unprocessable Entity | Invalid send body or attachment reference. |
502 Bad Gateway | IMAP/SMTP transport error talking to the mail server. |