Skip to main content

Obtain your API key

The Email API requires one credential:
  • API key: a secret token that authenticates your requests
It is available in the Paubox dashboard under API Credentials.

Configure the initializer

Create config/initializers/paubox.rb:
The gem’s Railtie registers the :paubox delivery method. Each delivery reads Paubox.configuration, so no per-request setup is needed.

Set environment variables

Add your API key to your environment (e.g. via a .env file with dotenv-rails, Rails credentials, or your deployment platform’s secret management):

Forms client

get_form and submit_form on PauboxRails::Forms::Client require no credentials. Form submissions are associated with the form ID, not an API key.
The form management methods (for example 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 as api_key: or set PAUBOX_FORMS_API_KEY:

Security notes

  • Never hard-code credentials in initializer files; always read from environment variables or encrypted credentials.
  • The gem does not log API keys or request bodies.