Skip to main content

Documentation Index

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

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

The client.Domains service manages your sending domains — useful for multi-tenant apps onboarding customer domains, or for automating DNS verification. For the concepts behind domain setup (SPF, DKIM, DMARC), see Sending Domains.
import lettr "github.com/lettr-com/lettr-go"

client := lettr.NewClient("your-api-key")

List Domains

domains, err := client.Domains.List(ctx)

API Reference

GET /domains

Create a Domain

created, err := client.Domains.Create(ctx, &lettr.CreateDomainRequest{
    Domain: "example.com",
})

API Reference

POST /domains

Get Domain Details

domain, err := client.Domains.Get(ctx, "example.com")

API Reference

GET /domains/

Verify Domain DNS

After publishing the records, trigger a verification check:
verification, err := client.Domains.Verify(ctx, "example.com")
fmt.Printf("DKIM: %s, SPF: %s, DMARC: %s\n",
    verification.Data.DkimStatus,
    verification.Data.SpfStatus,
    verification.Data.DmarcStatus,
)
DNS changes take time to propagate. If verification fails right after publishing, wait a few minutes and retry. See Domain Verification troubleshooting.

API Reference

POST /domains//verify

Delete a Domain

err = client.Domains.Delete(ctx, "example.com")
Deleting a domain stops all sending from it immediately. Emails from a deleted domain fail with a validation error.

API Reference

DELETE /domains/

What’s Next

Sending Domains

DNS setup: SPF, DKIM, DMARC

Webhooks

Receive delivery and engagement events