Skip to main content

Prerequisites

Installation

Install the useSend Go SDK:

Initialize

Create a new client using your API key.
API keys can also be supplied via the USESEND_API_KEY environment variable.

Self-Hosted Setup

If you are running a self-hosted version of useSend, provide the base URL using WithBaseURL.
The base URL should be the root domain only. Do not include /api/v1, as the SDK manages API paths internally.

Options

  • WithBaseURL(url string): Override the base API URL (e.g. for self-hosting)
  • WithHTTPClient(*http.Client): Provide a custom HTTP client
The default HTTP client uses a 30s timeout. Requests include a User-Agent: usesend-go header.

Sending Emails

Custom headers are forwarded as-is. useSend only manages the X-Usesend-Email-ID and References headers.

Managing Contacts

Get Contact Book ID

Retrieve the contact book ID from the useSend dashboard.

Create Contacts

Update Contacts