Versions in this module Expand all Collapse all v0 v0.2.0 Oct 18, 2026 Changes in this version + type Attachment struct + Content []byte + ContentType string + Filename string + func (a Attachment) MarshalJSON() ([]byte, error) type SendEmailParams + Attachments []Attachment + ReplyTo []string v0.1.1 Oct 17, 2026 v0.1.0 Oct 16, 2026 Changes in this version + const DefaultBaseURL + const SignatureHeader + const Version + const WebhookTolerance + func Bool(b bool) *bool + func ParseSignatureHeader(header string) (timestamp int64, signatures []string, ok bool) + func SignPayload(secret string, timestamp int64, rawBody []byte) string + func WebhookSignatureHeader(secret string, rawBody []byte, timestamp int64) string + type APIKey struct + CreatedAt time.Time + Domain *string + DomainID *string + ID string + Last4 string + LastUsedAt *time.Time + Masked string + Name string + Permission string + Prefix string + type APIKeysService struct + func (s *APIKeysService) List(ctx context.Context, opts ...RequestOption) ([]APIKey, error) + type Audience struct + Color string + Count int + ID string + Name string + type AudienceList struct + Audiences []Audience + TotalContacts int + type AudiencesService struct + func (s *AudiencesService) List(ctx context.Context, opts ...RequestOption) (*AudienceList, error) + type AutomationsService struct + func (s *AutomationsService) Enroll(ctx context.Context, automationID, email string, opts ...RequestOption) (map[string]any, error) + type BatchItemError struct + Code string + Detail json.RawMessage + Message string + type BatchResult struct + Error *BatchItemError + ID string + Index int + MessageID string + Status string + type BatchService struct + func (s *BatchService) Send(ctx context.Context, emails []SendEmailParams, opts ...RequestOption) (*SendBatchResponse, error) + type Client struct + APIKeys *APIKeysService + Audiences *AudiencesService + Automations *AutomationsService + Batch *BatchService + Contacts *ContactsService + Domains *DomainsService + Emails *EmailsService + Mailboxes *MailboxesService + Sandboxes *SandboxesService + Suppressions *SuppressionsService + Templates *TemplatesService + Webhooks *WebhooksService + Workspace *WorkspaceService + func NewClient(apiKey string, opts ...ClientOption) *Client + func (c *Client) BaseURL() string + type ClientOption func(*Client) + func WithBaseURL(url string) ClientOption + func WithDefaultHeader(name, value string) ClientOption + func WithHTTPClient(hc *http.Client) ClientOption + func WithMaxRetries(n int) ClientOption + func WithTimeout(d time.Duration) ClientOption + type Contact struct + AudienceColor *string + AudienceID *string + AudienceName *string + CreatedAt time.Time + Email string + ID string + Name string + Status string + type ContactList struct + Items []Contact + Page int + PageSize int + Total int + TotalAll int + TotalPages int + type ContactsService struct + func (s *ContactsService) All(ctx context.Context, params *ListContactsParams, opts ...RequestOption) iter.Seq2[Contact, error] + func (s *ContactsService) Create(ctx context.Context, params *CreateContactParams, opts ...RequestOption) (*Contact, error) + func (s *ContactsService) Export(ctx context.Context, params *ExportContactsParams, opts ...RequestOption) (string, error) + func (s *ContactsService) Import(ctx context.Context, params *ImportContactsParams, opts ...RequestOption) (map[string]any, error) + func (s *ContactsService) ImportPreview(ctx context.Context, params *ImportContactsParams, opts ...RequestOption) (map[string]any, error) + func (s *ContactsService) List(ctx context.Context, params *ListContactsParams, opts ...RequestOption) (*ContactList, error) + type CreateContactParams struct + AudienceID string + Email string + Name string + Status string + type CreateDomainParams struct + Name string + Region Region + type CreateMailboxParams struct + CatchAll bool + Color string + DisplayName string + DomainID string + LocalPart string + type CreateSuppressionParams struct + Email string + Note string + type CreateTemplateParams struct + Blocks []TemplateBlock + Key string + Name string + Preheader string + ProjectDomainID string + Subject string + type CreateWebhookParams struct + AllowInsecureHTTP bool + Events []WebhookEventType + URL string + type CursorInfo struct + Cursor *string + HasMore bool + type DNSRecord struct + CopyValue string + Host string + Priority int + Purpose string + Status string + Type string + Value string + type Domain struct + CheckCount int + CreatedAt time.Time + DkimOK bool + DmarcOK bool + ID string + LastCheckedAt *time.Time + LastError *string + MxOK bool + Name string + ReceivingEnabled bool + ReceivingError *string + ReceivingVerified bool + Records []struct{ ... } + Region Region + Sent int + SpfOK bool + Status string + type DomainRecords struct + Domain Domain + Records []DNSRecord + type DomainsService struct + func (s *DomainsService) Create(ctx context.Context, params *CreateDomainParams, opts ...RequestOption) (*Domain, error) + func (s *DomainsService) DeletionPreview(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error) + func (s *DomainsService) DisableReceiving(ctx context.Context, id string, opts ...RequestOption) (*Domain, error) + func (s *DomainsService) EnableReceiving(ctx context.Context, id string, opts ...RequestOption) (*Domain, error) + func (s *DomainsService) List(ctx context.Context, opts ...RequestOption) ([]Domain, error) + func (s *DomainsService) Records(ctx context.Context, id string, opts ...RequestOption) (*DomainRecords, error) + func (s *DomainsService) Remove(ctx context.Context, id string, opts ...RequestOption) error + func (s *DomainsService) SetRegion(ctx context.Context, id string, region Region, opts ...RequestOption) (*Domain, error) + func (s *DomainsService) Verify(ctx context.Context, id string, opts ...RequestOption) (*Domain, error) + type DownloadedFile struct + Content []byte + ContentType string + Filename string + type EmailDetail struct + BodyExpired bool + Events []EmailEvent + HTML *string + SendClass SendClass + Text *string + ThreadID *string + TrackClicks *bool + TrackOpens *bool + type EmailEvent struct + CreatedAt time.Time + ID string + Meta json.RawMessage + Type string + type EmailList struct + Items []EmailRow + Page int + PageSize int + Total int + TotalCapped bool + type EmailRow struct + CreatedAt time.Time + Domain string + From string + ID string + MessageID string + SesMessageID *string + Status EmailStatus + Subject string + To string + type EmailStats struct + BodyRetentionDays int + Bounced int + Clicked int + Complained int + Delivered int + Failed int + Opened int + Queued int + Sent int + Total int + type EmailStatus string + const StatusBounced + const StatusClicked + const StatusComplained + const StatusDelivered + const StatusFailed + const StatusOpened + const StatusQueued + const StatusSent + type EmailsService struct + func (s *EmailsService) All(ctx context.Context, params *ListEmailsParams, opts ...RequestOption) iter.Seq2[EmailRow, error] + func (s *EmailsService) Get(ctx context.Context, id string, opts ...RequestOption) (*EmailDetail, error) + func (s *EmailsService) List(ctx context.Context, params *ListEmailsParams, opts ...RequestOption) (*EmailList, error) + func (s *EmailsService) Send(ctx context.Context, params *SendEmailParams, opts ...RequestOption) (*SentEmail, error) + func (s *EmailsService) SendBatch(ctx context.Context, emails []SendEmailParams, opts ...RequestOption) (*SendBatchResponse, error) + func (s *EmailsService) Stats(ctx context.Context, opts ...RequestOption) (*EmailStats, error) + type Error struct + Detail json.RawMessage + Headers http.Header + Message string + Name string + StatusCode int + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ExportContactsParams struct + Audience string + Format string + type ImportContactsParams struct + AudienceID string + CreateAudiences *bool + File []byte + Filename string + Mapping map[string]any + NewAudience string + OnDuplicate string + type ListContactsParams struct + AudienceID string + Page int + PageSize int + Status string + type ListEmailsParams struct + BroadcastID string + Domain string + From string + Page int + PageSize int + Search string + Status EmailStatus + To string + type ListMailboxMessagesParams struct + Cursor string + Folder string + Label string + Limit int + Search string + type ListSandboxMessagesParams struct + Limit int + Search string + type ListSuppressionsParams struct + Cursor string + Limit int + Q string + Reason string + type ListTemplatesParams struct + Project string + Tag string + type ListWebhookDeliveriesParams struct + EndpointID string + FinalOnly *bool + Limit int + type ListWebhookDispatchesParams struct + Cursor string + EndpointID string + Limit int + State string + type Mailbox struct + Address string + Archived bool + CanReceive bool + CanSend bool + CatchAll bool + DisplayName string + Domain string + DomainID string + ID string + Total int + Unread int + type MailboxMessage struct + Attachments []struct{ ... } + Authentication map[string]any + BodyExpiredAt *time.Time + BodyHTML *string + BodyText *string + Thread ... + type MailboxMessageList struct + Items []MailboxMessageRow + Page CursorInfo + Total int + TotalCapped bool + Unread int + type MailboxMessageRow struct + Bcc *string + Cc *string + Folder string + From string + FromName string + ID string + Label *string + MailboxID *string + ReceivedAt time.Time + Snippet string + Starred bool + Subject string + ThreadID *string + To string + Unread bool + type MailboxMessagesService struct + func (s *MailboxMessagesService) All(ctx context.Context, mailboxID string, params *ListMailboxMessagesParams, ...) iter.Seq2[MailboxMessageRow, error] + func (s *MailboxMessagesService) Attachment(ctx context.Context, mailboxID, messageID, attachmentID string, ...) (*DownloadedFile, error) + func (s *MailboxMessagesService) Get(ctx context.Context, mailboxID, messageID string, opts ...RequestOption) (*MailboxMessage, error) + func (s *MailboxMessagesService) List(ctx context.Context, mailboxID string, params *ListMailboxMessagesParams, ...) (*MailboxMessageList, error) + type MailboxesService struct + Messages *MailboxMessagesService + func (s *MailboxesService) Archive(ctx context.Context, id string, opts ...RequestOption) (*Mailbox, error) + func (s *MailboxesService) Create(ctx context.Context, params *CreateMailboxParams, opts ...RequestOption) (*Mailbox, error) + func (s *MailboxesService) Get(ctx context.Context, id string, opts ...RequestOption) (*Mailbox, error) + func (s *MailboxesService) List(ctx context.Context, includeArchived bool, opts ...RequestOption) ([]Mailbox, error) + func (s *MailboxesService) Update(ctx context.Context, id string, params *UpdateMailboxParams, ...) (*Mailbox, error) + type NamedRef struct + ID string + Name string + type Region string + const EUWest1 + const USEast1 + const USWest2 + type ReplayAllParams struct + EndpointID string + State string + type ReplayAllResult struct + Capped bool + Max int + Queued int + Remaining int + type RequestOption func(*requestConfig) + func WithHeader(name, value string) RequestOption + func WithIdempotencyKey(key string) RequestOption + func WithRequestMaxRetries(n int) RequestOption + func WithRequestTimeout(d time.Duration) RequestOption + func WithResponseHeaders(dst *http.Header) RequestOption + type ResetSandboxCredentials struct + APIToken string + Password string + Username string + type Sandbox struct + Color string + CreatedAt time.Time + ID string + InboundLive bool + InboxAddress string + LastTrappedAt *time.Time + MessageCap int + Name string + ProjectLabel string + RetentionDays int + Slug string + Total int + Unread int + type SandboxCredentials struct + APIEndpoint string + APITokenHint string + Host string + InboundDomain string + InboundLive bool + InboxAddress string + InboxID string + MaxMessageBytes int + MaxRecipients int + Password string + Port int + RetentionDays int + TLS string + Username string + type SandboxMessage struct + BodyHTML *string + BodyText *string + CcAddresses []string + ClientIP *string + EnvelopeFrom string + EnvelopeTo []string + HasRaw bool + Headers []struct{ ... } + Transport string + type SandboxMessageSummary struct + FromAddress string + FromName string + ID string + Read bool + SizeBytes int + Snippet string + Subject string + ToAddresses []string + TrappedAt time.Time + type SandboxMessagesService struct + func (s *SandboxMessagesService) Clear(ctx context.Context, sandboxID string, opts ...RequestOption) (int, error) + func (s *SandboxMessagesService) Get(ctx context.Context, sandboxID, messageID string, opts ...RequestOption) (*SandboxMessage, error) + func (s *SandboxMessagesService) List(ctx context.Context, sandboxID string, params *ListSandboxMessagesParams, ...) ([]SandboxMessageSummary, error) + func (s *SandboxMessagesService) MarkAllRead(ctx context.Context, sandboxID string, opts ...RequestOption) (int, error) + func (s *SandboxMessagesService) Raw(ctx context.Context, sandboxID, messageID string, opts ...RequestOption) (string, error) + func (s *SandboxMessagesService) Remove(ctx context.Context, sandboxID, messageID string, opts ...RequestOption) error + func (s *SandboxMessagesService) WaitFor(ctx context.Context, sandboxID string, opts *WaitForOptions) (*SandboxMessage, error) + type SandboxParams struct + Color string + Name string + ProjectLabel string + type SandboxSendResult struct + Duplicate bool + ID string + type SandboxesService struct + Messages *SandboxMessagesService + func (s *SandboxesService) Create(ctx context.Context, params *SandboxParams, opts ...RequestOption) (*Sandbox, error) + func (s *SandboxesService) Credentials(ctx context.Context, id string, opts ...RequestOption) (*SandboxCredentials, error) + func (s *SandboxesService) Get(ctx context.Context, id string, opts ...RequestOption) (*Sandbox, error) + func (s *SandboxesService) List(ctx context.Context, opts ...RequestOption) ([]Sandbox, error) + func (s *SandboxesService) Remove(ctx context.Context, id string, opts ...RequestOption) (int, error) + func (s *SandboxesService) ResetCredentials(ctx context.Context, id string, opts ...RequestOption) (*ResetSandboxCredentials, error) + func (s *SandboxesService) Send(ctx context.Context, sandboxToken string, params *SendEmailParams, ...) (*SandboxSendResult, error) + func (s *SandboxesService) Update(ctx context.Context, id string, params *SandboxParams, opts ...RequestOption) (*Sandbox, error) + type SendBatchResponse struct + Data []BatchResult + Summary struct{ ... } + type SendClass string + const Marketing + const Transactional + type SendEmailParams struct + From string + HTML string + SendClass SendClass + Subject string + Template string + TemplateID string + Text string + To string + TrackClicks *bool + TrackOpens *bool + Variables map[string]any + type SentEmail struct + CreatedAt time.Time + Domain string + From string + ID string + MessageID string + SesMessageID *string + Status EmailStatus + Subject string + TemplateID *string + To string + type Suppression struct + CreatedAt time.Time + DiagnosticCode *string + Email string + ID string + Reason string + ReasonDetail *string + ReasonLabel string + Scope string + SourceEmailID *string + SourceMessageID *string + type SuppressionCreated struct + Created bool + Row *Suppression + type SuppressionList struct + Counts struct{ ... } + Data []Suppression + Page CursorInfo + type SuppressionsService struct + func (s *SuppressionsService) All(ctx context.Context, params *ListSuppressionsParams, opts ...RequestOption) iter.Seq2[Suppression, error] + func (s *SuppressionsService) Create(ctx context.Context, params *CreateSuppressionParams, opts ...RequestOption) (*SuppressionCreated, error) + func (s *SuppressionsService) Export(ctx context.Context, params *ListSuppressionsParams, opts ...RequestOption) (string, error) + func (s *SuppressionsService) List(ctx context.Context, params *ListSuppressionsParams, opts ...RequestOption) (*SuppressionList, error) + func (s *SuppressionsService) Remove(ctx context.Context, id, reason string, opts ...RequestOption) error + type Template struct + Blocks []TemplateBlock + HTML string + Preheader string + Subject string + type TemplateAsset struct + Bytes int + CreatedAt time.Time + ID string + MimeType string + Name string + PublicID string + URL string + type TemplateAssetsService struct + func (s *TemplateAssetsService) List(ctx context.Context, opts ...RequestOption) ([]TemplateAsset, error) + func (s *TemplateAssetsService) Upload(ctx context.Context, params *UploadTemplateAssetParams, opts ...RequestOption) (*TemplateAsset, error) + type TemplateBlock = map[string]any + type TemplatePreview struct + HTML string + Preheader string + Subject string + Text string + UnsafeLinks []string + Variables []struct{ ... } + type TemplateSummary struct + BlockCount int + CreatedAt time.Time + Domains []NamedRef + ID string + Key *string + Name string + Project *NamedRef + PublicID string + PublishedAt *time.Time + Status string + Tags []TemplateTag + UpdatedAt time.Time + type TemplateTag struct + Color string + ID string + Name string + TemplateCount *int + type TemplateTagsService struct + func (s *TemplateTagsService) Create(ctx context.Context, name, color string, opts ...RequestOption) (*TemplateTag, error) + func (s *TemplateTagsService) List(ctx context.Context, opts ...RequestOption) ([]TemplateTag, error) + func (s *TemplateTagsService) Remove(ctx context.Context, id string, opts ...RequestOption) (int, error) + func (s *TemplateTagsService) Update(ctx context.Context, id, name, color string, opts ...RequestOption) (*TemplateTag, error) + type TemplatesService struct + Assets *TemplateAssetsService + Tags *TemplateTagsService + func (s *TemplatesService) Create(ctx context.Context, params *CreateTemplateParams, opts ...RequestOption) (*Template, error) + func (s *TemplatesService) Duplicate(ctx context.Context, id string, opts ...RequestOption) (*Template, error) + func (s *TemplatesService) Get(ctx context.Context, id string, opts ...RequestOption) (*Template, error) + func (s *TemplatesService) HTML(ctx context.Context, id string, opts ...RequestOption) (string, error) + func (s *TemplatesService) List(ctx context.Context, params *ListTemplatesParams, opts ...RequestOption) ([]TemplateSummary, error) + func (s *TemplatesService) Preview(ctx context.Context, id string, variables map[string]any, ...) (*TemplatePreview, error) + func (s *TemplatesService) Projects(ctx context.Context, opts ...RequestOption) ([]NamedRef, error) + func (s *TemplatesService) Publish(ctx context.Context, id string, opts ...RequestOption) (*Template, error) + func (s *TemplatesService) Remove(ctx context.Context, id string, opts ...RequestOption) error + func (s *TemplatesService) SetTags(ctx context.Context, id string, tagIDs []string, opts ...RequestOption) ([]TemplateTag, error) + func (s *TemplatesService) Unpublish(ctx context.Context, id string, opts ...RequestOption) (*Template, error) + func (s *TemplatesService) Update(ctx context.Context, id string, params *UpdateTemplateParams, ...) (*Template, error) + type UpdateMailboxParams struct + Archived *bool + CatchAll *bool + Color string + DisplayName *string + EmbedOrigins []string + LocalPart string + NotifyOwner *bool + type UpdateTemplateParams struct + Blocks []TemplateBlock + DomainIDs []string + Key *string + Name *string + Preheader *string + ProjectDomainID *string + Subject *string + type UpdateWebhookParams struct + Active *bool + AllowInsecureHTTP *bool + Events []WebhookEventType + URL string + type UploadTemplateAssetParams struct + Data []byte + MimeType string + Name string + type VerifyOption func(*verifyConfig) + func WithNow(t time.Time) VerifyOption + func WithTolerance(d time.Duration) VerifyOption + type WaitForOptions struct + Interval time.Duration + Match func(SandboxMessageSummary) bool + type WebhookDispatch struct + Attempts int + CreatedAt time.Time + EndpointID string + EndpointURL string + Event WebhookEventType + EventID string + FirstAttemptAt *time.Time + ID string + LastAttemptAt *time.Time + LastAttemptError *string + LastError *string + LastStatusCode *int + NextAttemptAt *time.Time + ReplayCount int + ReplayedAt *time.Time + State string + type WebhookDispatchPage struct + Data []WebhookDispatch + Page CursorInfo + type WebhookDispatchesService struct + func (s *WebhookDispatchesService) All(ctx context.Context, params *ListWebhookDispatchesParams, ...) iter.Seq2[WebhookDispatch, error] + func (s *WebhookDispatchesService) Get(ctx context.Context, id string, opts ...RequestOption) (*WebhookDispatch, error) + func (s *WebhookDispatchesService) List(ctx context.Context, params *ListWebhookDispatchesParams, ...) (*WebhookDispatchPage, error) + func (s *WebhookDispatchesService) Replay(ctx context.Context, id string, opts ...RequestOption) (*WebhookDispatch, error) + func (s *WebhookDispatchesService) ReplayAll(ctx context.Context, params *ReplayAllParams, opts ...RequestOption) (*ReplayAllResult, error) + type WebhookEndpoint struct + Active bool + CreatedAt time.Time + DeliveredCount int + DeliveryCount int + Events []WebhookEventType + ID string + PreviousSecretExpiresAt *time.Time + SecretMasked string + SecretRotatedAt *time.Time + SuccessRate *float64 + SuccessRateWindowDays int + URL string + type WebhookEndpointWithSecret struct + Secret string + type WebhookEvent struct + CreatedAt time.Time + Data WebhookEventData + Event WebhookEventType + ID string + func VerifyWebhook(payload []byte, headers http.Header, secret string, opts ...VerifyOption) (*WebhookEvent, error) + func VerifyWebhookSignature(payload []byte, signature, secret string, opts ...VerifyOption) (*WebhookEvent, error) + type WebhookEventData struct + Domain string + EmailID string + MessageID string + Raw map[string]any + Subject string + To string + func (d *WebhookEventData) UnmarshalJSON(b []byte) error + type WebhookEventType string + const EventBounced + const EventClicked + const EventComplained + const EventDelivered + const EventFailed + const EventOpened + type WebhookVerificationError struct + Message string + Reason string + func (e *WebhookVerificationError) Error() string + type WebhooksService struct + Dispatches *WebhookDispatchesService + func (s *WebhooksService) Create(ctx context.Context, params *CreateWebhookParams, opts ...RequestOption) (*WebhookEndpointWithSecret, error) + func (s *WebhooksService) Deliveries(ctx context.Context, params *ListWebhookDeliveriesParams, ...) ([]map[string]any, error) + func (s *WebhooksService) List(ctx context.Context, opts ...RequestOption) ([]WebhookEndpoint, error) + func (s *WebhooksService) Remove(ctx context.Context, id string, opts ...RequestOption) error + func (s *WebhooksService) RotateSecret(ctx context.Context, id string, opts ...RequestOption) (*WebhookEndpointWithSecret, error) + func (s *WebhooksService) Update(ctx context.Context, id string, params *UpdateWebhookParams, ...) (*WebhookEndpoint, error) + func (s *WebhooksService) Verify(payload []byte, headers http.Header, secret string, opts ...VerifyOption) (*WebhookEvent, error) + type Workspace struct + CreatedAt time.Time + ID string + Name string + PostalAddress *string + PublicID string + SendingPaused ... + type WorkspaceService struct + func (s *WorkspaceService) Get(ctx context.Context, opts ...RequestOption) (*Workspace, error)