Skip to main content

Obtain your API key

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

Create a config.cfg file

Create a config.cfg file in your project directory:
The key name is case-sensitive: API_KEY is not recognized. The SDK reads this file automatically via Config::General when you instantiate the client; no constructor arguments are needed:
config.cfg is read from the current working directory. The constructor dies immediately if apiKey is missing from the config file, so credential errors are caught at startup. The SDK sets the Authorization header on every request:

Forms client

getForm and submitForm are public and need no credentials:
All other Paubox_Forms_SDK methods need an API key with the forms scope, sent as Authorization: Bearer YOUR_API_KEY. Pass it to the constructor, or set FORMS_API_KEY in config.cfg:

Security notes

  • Do not commit config.cfg to source control. Add it to your .gitignore.
  • The SDK does not expose credentials in error messages or logs.