SDKs & CLI

SDKs & CLI

Official MailAfrica interfaces in your language of choice: the Go SDK and the MailAfrica CLI are available today; the raw REST API and OpenAPI spec remain fully supported everywhere else.


Official tools

ToolPackageRepositoryStatus
Go SDKgithub.com/mailafrica/go-sdkMailAfrica/go-sdkv0.1.0 (beta)
CLIgithub.com/MailAfrica/MailAfrica-CLIMailAfrica/CLIdev

The Go SDK is the official, open-source client library, and the CLI is its terminal companion. Both wrap the raw REST API and ship the same behavior: typed requests, envelope unwrapping, automatic authentication headers, and typed errors.

Pick your interface

  • Go SDK — idiomatic, standard-library-only client with typed requests, automatic JWT refresh, and observability hooks. See the Go SDK guide.
  • CLI — a user-side terminal client for the whole API surface: inbound mail, webhooks, sending from verified domains, wallet, SMS, compliance, and AI auto-reply. See the CLI reference.
  • Raw REST API — a plain JSON HTTP API usable from any language. Every endpoint is documented on these pages and in the OpenAPI spec.
  • MCP server — the MailAfrica Agent MCP server exposes the API as tools for Claude Desktop/Code, Cursor, and any MCP client.
Every official tool talks to the same REST API and speaks the same response envelope: check success before touching data, and treat errors[] as field-level guidance. Learning the response envelope once applies to every language.

Common ground

  • Authentication — SDKs and the CLI send X-API-Key: MAIL_... for you (or a JWT bearer); see Authentication.
  • One base URLhttps://api.mailafrica.online, overridable in every tool.
  • Wallet-gated — debits hit your balance; tools surface INSUFFICIENT_BALANCE as a typed error.
  • Secrets are single-show — API keys, webhook secrets, and SMS keys are returned once; tools never log them.
  • No admin routes — tools expose only user-facing endpoints, same as the public API.

Next steps