Skip to main content

Obtain your API key

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

Option 1: Constructor parameter

Pass your API key directly; useful for console apps or when managing secrets via environment variables:
Read from an environment variable:
Add your API key to appsettings.json:
Then inject IConfiguration and pass it to the constructor:
Or instantiate directly:
The SDK reads APIKey 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.