Skip to main content

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.

Option 1: Constructor parameters

Pass credentials directly; useful for console apps or when managing secrets via environment variables:
Read from environment variables:
Add your credentials to appsettings.json:
Then inject IConfiguration and pass it to the constructor:
Or instantiate directly:
The SDK reads APIKey and APIUser from the configuration and sets the Authorization header automatically on every request:

Forms client

FormsLibrary requires no credentials. Instantiate it with no arguments:
Use IFormsLibrary in ASP.NET Core for dependency injection and testability:

Security notes

  • Never hard-code credentials in source files. Use appsettings.json with user secrets or environment variables.
  • Use .NET user secrets during development to keep credentials out of source control.