Sending and Mailbox clients require mailbox-scoped
smx_mbx_ keys.
Management clients require team-scoped smx_root_ keys.Requirements
- A Sendmux API key for the surface you are calling.
- An application that can install packages from npm.
Install
Install the umbrella package when one application needs more than one API surface.Create a client
The umbrella package exportssending, mailbox, and management namespaces. Each namespace exposes the same factory as its surface package.
createSendingClient, createMailboxClient, and createManagementClient directly.
Choose a surface
| Surface | Package | Factory | API key |
|---|---|---|---|
| Sending | @sendmux/sending | createSendingClient | smx_mbx_ |
| Mailbox | @sendmux/mailbox | createMailboxClient | smx_mbx_ |
| Management | @sendmux/management | createManagementClient | smx_root_ |
https://smtp.sendmux.ai/api/v1 by default. Mailbox and Management use https://app.sendmux.ai/api/v1.
Shared API behaviour
The SDK configures bearer authentication, retries, and error mapping when you create a surface client.Pagination
List responses use cursor pagination withpagination.has_more and pagination.next_cursor. The core package exports paginate() for cursor iteration when you wrap a page-fetching function.
Retries and rate limits
The default retry client retries safe methods and retry-safePOST requests that include Idempotency-Key. It honours Retry-After and X-RateLimit-Reset response headers.
Pass retry into a client factory to change maxAttempts, delay, replay body size, or jitter.
Idempotency and ETags
Use core header helpers when a generated operation accepts custom headers.Idempotency-Key for retry-safe mutating requests. Use If-Match and If-None-Match with single-resource endpoints that support ETags.
Errors
Generated client errors are mapped toSendmuxApiError. The error exposes the API error code, retryability, request ID, response status, headers, and raw body when available.
Use error.retryable and error.requestId when deciding whether to retry or contact support.
Next steps
SDK overview
Choose the right package family and API surface.
Versioning and support
Check compatibility, support, and upgrade guidance.
Sending API
Review the Sending API contract used by
@sendmux/sending.API keys
Create and scope the credentials used by SDK clients.