Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.paubox.com/llms.txt

Use this file to discover all available pages before exploring further.

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:
var emailLib = new EmailLibrary("YOUR_API_KEY", "YOUR_USERNAME");
Read from environment variables:
var emailLib = new EmailLibrary(
    Environment.GetEnvironmentVariable("PAUBOX_API_KEY"),
    Environment.GetEnvironmentVariable("PAUBOX_API_USER")
);
Add your credentials to appsettings.json:
{
  "APIKey": "YOUR_API_KEY",
  "APIUser": "YOUR_USERNAME"
}
Then inject IConfiguration and pass it to the constructor:
// In Program.cs or Startup.cs
builder.Services.AddSingleton<IEmailLibrary>(sp =>
{
    var config = sp.GetRequiredService<IConfiguration>();
    return new EmailLibrary(config);
});
Or instantiate directly:
var emailLib = new EmailLibrary(configuration);
The SDK reads APIKey and APIUser from the configuration and sets the Authorization header automatically on every request:
Authorization: Token token=YOUR_API_KEY

Forms client

FormsLibrary requires no credentials. Instantiate it with no arguments:
var formsLib = new FormsLibrary();
Use IFormsLibrary in ASP.NET Core for dependency injection and testability:
builder.Services.AddSingleton<IFormsLibrary, FormsLibrary>();

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.