Skip to main content

Creating a client

See Authentication for details on all three options.

Building a message

Use Message::builder() to compose a message. All methods take impl Into<String> or iterables:
.build() validates required fields and returns Err(PauboxError::Validation(...)) if any are missing.

Attachments

The from_bytes constructor base64-encodes the data automatically; no manual encoding needed:
If you already have base64-encoded content:
Add attachments to a message via the builder:

Send a message

SendResponse fields:

Check delivery status

MessageDelivery fields:

Scheduled send

Schedule a message for future delivery, check its status, reschedule, or cancel it.

Schedule a message

scheduled_at must be an ISO 8601 UTC datetime string in the future and within 30 days.

Get scheduled message status

ScheduledMessageStatus fields:

Reschedule a message

Cancel a scheduled message

Health check

Returns Ok(()) if the API is reachable, or a PauboxError if not.

Error handling

All methods return Result<T, PauboxError>. Match on the variants to handle specific conditions:
PauboxError variants: