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.

Create a client

Pass the API key and username directly to paubox.New:
import (
    "os"
    paubox "github.com/paubox/paubox-go"
)

client, err := paubox.New(
    os.Getenv("PAUBOX_API_KEY"),
    os.Getenv("PAUBOX_USERNAME"),
)
if err != nil {
    log.Fatal(err)
}
The SDK sets the Authorization header automatically on every request:
Authorization: Token token=YOUR_API_KEY

Environment variables

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

Forms client

The Forms client (paubox.NewFormsClient) requires no credentials. Form submissions are associated with the form ID, not an API key.
fc, err := paubox.NewFormsClient()
if err != nil {
    log.Fatal(err)
}

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.