Sending clients accept a send-capable
smx_mbx_ key or owner-approved Sending-resource smx_agent_ token. Mailbox clients accept
smx_mbx_ keys or scoped smx_agent_ tokens. Management clients require
team-scoped smx_root_ keys.Requirements
- Rust 1.82 or newer.
- You need a Sendmux API key for the specific surface you’re trying to access.
- An async context for API calls.
Install
The Rust SDK is one crate with three surface modules.Create a client
Import the surface client from thesendmux crate.
Choose a surface
sending, mailbox, and management are modules inside the sendmux crate. They are not separate installable crates.https://smtp.sendmux.ai/api/v1 by default. Mailbox and Management use https://app.sendmux.ai/api/v1.
Shared API behaviour
Surface clients validate API key prefixes, attach bearer auth, and return a response with data, metadata, and the HTTP status.Typed and raw JSON coverage
Sending has typed request and response models. Mailbox and Management expose typed surface clients with raw JSON helpers. Their operation helpers return JSON values rather than the typed Sending models.Pagination
Mailbox and Management list helpers return paginated data as JSON. Readpagination.has_more and pagination.next_cursor according to the relevant API reference. The crate does not currently provide a typed cursor iterator for these surfaces.
Retries and rate limits
The crate sends each request once. Whensendmux::Error::Api reports retryable as true, follow the API retry guidance before sending the request again.
Idempotency and ETags
UseRequestOptions when an 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
SDK methods returnsendmux::Result<Response<T>>. API failures map to sendmux::Error::Api with the status, machine-readable code, retryable flag, raw response body, and request ID when available.
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::management.API keys
Create and scope the credentials used by SDK clients.