Sending and Mailbox clients require mailbox-scoped
smx_mbx_ keys.
Management clients require team-scoped smx_root_ keys.Requirements
- Go 1.23 or newer.
- A Sendmux API key for the surface you are calling.
Install
The Go SDK is one module with surface subpackages.Create a client
Import the surface package directly.Choose a surface
| Surface | Import path | Factory | API key |
|---|---|---|---|
| Sending | sendmux.ai/go/sending | sending.New | smx_mbx_ |
| Mailbox | sendmux.ai/go/mailbox | mailbox.New | smx_mbx_ |
| Management | sendmux.ai/go/management | management.New | smx_root_ |
https://smtp.sendmux.ai/api/v1 by default. Mailbox and Management use https://app.sendmux.ai/api/v1.
Shared API behaviour
Surface packages validate API key prefixes, attach bearer auth, and wrap an HTTP client with retry behaviour.Pagination
List responses use cursor pagination withpagination.has_more and pagination.next_cursor. The core package exports IterateCursor() for cursor iteration when you wrap a page-fetching function.
Retries and rate limits
Surface clients usecore.NewHTTPClient() by default. It retries safe requests and requests that carry Idempotency-Key, then honours Retry-After and X-RateLimit-Reset response headers.
Pass WithRetryOptions(core.RetryOptions{...}) into a surface factory to change attempts and backoff.
Idempotency and ETags
Use surface header helpers when a generated operation accepts optional header values.Idempotency-Key for retry-safe mutating requests. Use If-Match and If-None-Match with single-resource endpoints that support ETags.
Errors
Thecore package defines core.APIError. Surface packages expose APIErrorFromResponse() to map generated error responses into the typed API error shape.
Keep the request ID from the API response when contacting support.
Next steps
SDK overview
Choose the right package family and API surface.
Versioning and support
Check compatibility, support, and upgrade guidance.
Management API
Review the Management API contract used by
sendmux.ai/go/management.API keys
Create and scope the credentials used by SDK clients.