Obtain your credentials
The Email API client requires one credential:- API key: a secret token that authenticates your requests
Global configuration (recommended)
Set your API key once at application startup. AllPaubox::Client instances will use it automatically:
Per-client configuration
Override the API key for a specific client instance:Paubox::Client.new reads the global configuration even when you pass api_key:, so call Paubox.configure first. Without it, Paubox::Client.new raises NoMethodError.
The SDK sets the Authorization header automatically on every request:
Forms client
get_form and submit_form on Paubox::FormsClient require no credentials:
list_forms, create_form, and list_submissions) require a scoped API key with the forms scope, sent as Authorization: Bearer. It can be the same key as the Email API key if that key also has the forms scope. Pass it to the constructor or set config.forms_api_key:
Security notes
- Never hard-code credentials in source files; always read from environment variables.
- The SDK does not log API keys or request bodies.