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
| Tool | Package | Repository | Status |
|---|---|---|---|
| Go SDK | github.com/mailafrica/go-sdk | MailAfrica/go-sdk | v0.1.0 (beta) |
| CLI | github.com/MailAfrica/MailAfrica-CLI | MailAfrica/CLI | dev |
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 URL —
https://api.mailafrica.online, overridable in every tool. - Wallet-gated — debits hit your balance; tools surface
INSUFFICIENT_BALANCEas 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
- Follow the Go SDK guide to install and send your first message.
- Install the CLI for terminal-based account, inbound, and sending workflows.
- Read the Authentication reference for request signing and the envelope.
- Download the OpenAPI spec for code generation in any language.