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 client

Pass the API key directly to paubox.New:
The SDK sets the Authorization header automatically on every request:

Environment variables

The SDK does not read environment variables automatically; you must read them and pass the value to paubox.New. The convention used throughout this documentation is PAUBOX_API_KEY.

Forms client

The Forms client (paubox.NewForms) takes an API key with the forms scope and sends it as Authorization: Bearer YOUR_API_KEY. Pass an empty string for a public-only client that can call only GetPublicForm and SubmitForm:

Security notes

  • Never hard-code credentials in source files.
  • The SDK never logs request bodies, response bodies, or the Authorization header.
  • Clients are safe to create once and reuse across goroutines for the lifetime of your application.