Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.paubox.com/llms.txt

Use this file to discover all available pages before exploring further.

Obtain your credentials

The Email API client requires two credentials:
  • API key: a secret token that authenticates your requests
  • Username: your Paubox API endpoint username (not your login email)
Both are available in the Paubox dashboard under API Credentials.
export PAUBOX_API_KEY="YOUR_API_KEY"
export PAUBOX_API_USER="YOUR_USERNAME"
let client = PauboxClient::from_env()?;
from_env() returns Err(PauboxError::EnvVar(...)) immediately if either variable is missing or empty.

Option 2: Direct constructor

let client = PauboxClient::new("YOUR_API_KEY", "YOUR_USERNAME");

Option 3: Builder (with custom timeout or base URL)

use std::time::Duration;

let client = PauboxClient::builder()
    .api_key("YOUR_API_KEY")
    .api_user("YOUR_USERNAME")
    .timeout(Duration::from_secs(15))
    .build()?;
Use .base_url(url) in tests to point at a mock server. The SDK sets the Authorization header automatically on every request:
Authorization: Token token=YOUR_API_KEY

Forms client

FormsClient requires no credentials:
let forms = FormsClient::new();
If you already have a PauboxClient, reuse its HTTP connection pool:
let forms = email_client.forms();

Security notes

  • Never hard-code credentials in source files.
  • The SDK does not log API keys or request bodies.