Documentation
¶
Overview ¶
Package smtpfast is the official Go SDK for the SMTPfast API.
client := smtpfast.NewClient() // reads SMTPFAST_API_KEY
email, err := client.Emails.Send(ctx, &smtpfast.SendEmailRequest{
From: smtpfast.String("you@yourdomain.com"), To: smtpfast.StringList{"them@example.org"},
Subject: smtpfast.String("Hi"), Text: smtpfast.String("Hello"),
})
Index ¶
- Constants
- func Bool(b bool) *bool
- func Int(n int64) *int64
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsUnauthorized(err error) bool
- func String(s string) *string
- func VerifyWebhookSignature(payload []byte, signature, secret string) bool
- type APIError
- type APIKey
- type APIKeyCreated
- type APIKeysService
- func (s *APIKeysService) Create(ctx context.Context, params *CreateAPIKeyRequest, opts ...RequestOption) (*APIKeyCreated, error)
- func (s *APIKeysService) List(ctx context.Context, opts ...RequestOption) (*ListAPIKeysResponse, error)
- func (s *APIKeysService) Revoke(ctx context.Context, id string, opts ...RequestOption) (*RevokeAPIKeyResponse, error)
- func (s *APIKeysService) Update(ctx context.Context, id string, params *UpdateAPIKeyParams, ...) (*UpdateAPIKeyResponse, error)
- type AccountService
- type AddDomainRequest
- type AddSuppressionsBatchParams
- type Analytics
- type AnalyticsDailyItem
- type AnalyticsService
- type AnalyticsUsage
- type AnalyticsWindow
- type AnalyticsWindowCounts
- type AnalyticsWindowRatesPercent
- type ApproveAllPendingSignupsParams
- type ApproveAllPendingSignupsResponse
- type ApprovePendingSignupResponse
- type BatchSendResponse
- type BatchSendResponseDataItem
- type BatchSendResponseEmailsItem
- type Broadcast
- type BroadcastDetail
- type BroadcastDetailLinksItem
- type BroadcastList
- type BroadcastMetrics
- type BroadcastRecipientDetail
- type BroadcastRecipientDetailEventsItem
- type BroadcastSendResult
- type BroadcastsRecipientsService
- type BroadcastsService
- func (s *BroadcastsService) Archive(ctx context.Context, id string, opts ...RequestOption) (*Broadcast, error)
- func (s *BroadcastsService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*Broadcast, error)
- func (s *BroadcastsService) Create(ctx context.Context, params *CreateBroadcastRequest, opts ...RequestOption) (*Broadcast, error)
- func (s *BroadcastsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeletedObject, error)
- func (s *BroadcastsService) Duplicate(ctx context.Context, id string, opts ...RequestOption) (*DuplicateBroadcastResponse, error)
- func (s *BroadcastsService) Get(ctx context.Context, id string, opts ...RequestOption) (*BroadcastDetail, error)
- func (s *BroadcastsService) GetAudience(ctx context.Context, query *GetBroadcastAudienceQuery, opts ...RequestOption) (map[string]any, error)
- func (s *BroadcastsService) List(ctx context.Context, query *ListBroadcastsQuery, opts ...RequestOption) (*BroadcastList, error)
- func (s *BroadcastsService) ListClickedLinks(ctx context.Context, id string, opts ...RequestOption) (*ListBroadcastClickedLinksResponse, error)
- func (s *BroadcastsService) Send(ctx context.Context, id string, params *SendBroadcastParams, ...) (*BroadcastSendResult, error)
- func (s *BroadcastsService) SendTest(ctx context.Context, id string, params *SendBroadcastTestParams, ...) (*SendBroadcastTestResponse, error)
- func (s *BroadcastsService) Unarchive(ctx context.Context, id string, opts ...RequestOption) (*Broadcast, error)
- func (s *BroadcastsService) Update(ctx context.Context, id string, params *UpdateBroadcastRequest, ...) (*Broadcast, error)
- type CancelEmailResponse
- type ClaimDomainParams
- type ClaimDomainResponse
- type Client
- type ConnectionError
- type Contact
- type ContactBatchCreated
- type ContactCreated
- type ContactDeleted
- type ContactExport
- type ContactList
- type ContactListItem
- type ContactListItemSegmentsItem
- type ContactPropertiesService
- func (s *ContactPropertiesService) Create(ctx context.Context, params *CreateContactPropertyParams, ...) (*CreateContactPropertyResponse, error)
- func (s *ContactPropertiesService) Delete(ctx context.Context, id string, opts ...RequestOption) (*Success, error)
- func (s *ContactPropertiesService) Get(ctx context.Context, id string, opts ...RequestOption) (*GetContactPropertyResponse, error)
- func (s *ContactPropertiesService) List(ctx context.Context, opts ...RequestOption) (*ListContactPropertiesResponse, error)
- func (s *ContactPropertiesService) Update(ctx context.Context, id string, params *UpdateContactPropertyParams, ...) (*UpdateContactPropertyResponse, error)
- type ContactProperty
- type ContactSegmentsItem
- type ContactSummary
- type ContactSummarySegmentsItem
- type ContactSuppression
- type ContactsSegmentsService
- func (s *ContactsSegmentsService) Add(ctx context.Context, id string, segmentID string, opts ...RequestOption) (map[string]any, error)
- func (s *ContactsSegmentsService) List(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
- func (s *ContactsSegmentsService) Remove(ctx context.Context, id string, segmentID string, opts ...RequestOption) (map[string]any, error)
- type ContactsService
- func (s *ContactsService) Create(ctx context.Context, params *CreateContactParams, opts ...RequestOption) (*CreateContactResponse, error)
- func (s *ContactsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*ContactDeleted, error)
- func (s *ContactsService) DeleteMany(ctx context.Context, params *DeleteContactsParams, opts ...RequestOption) (map[string]any, error)
- func (s *ContactsService) Export(ctx context.Context, query *ExportContactsQuery, opts ...RequestOption) (*ContactExport, error)
- func (s *ContactsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Contact, error)
- func (s *ContactsService) List(ctx context.Context, query *ListContactsQuery, opts ...RequestOption) (*ContactList, error)
- func (s *ContactsService) Update(ctx context.Context, id string, params *UpdateContactRequest, ...) (*ContactCreated, error)
- type CreateAPIKeyRequest
- type CreateBroadcastRequest
- type CreateContactBatchRequest
- type CreateContactParams
- type CreateContactPropertyParams
- type CreateContactPropertyResponse
- type CreateContactRequest
- type CreateContactResponse
- type CreateInboxDraftParams
- type CreateInboxLabelParams
- type CreateInboxParams
- type CreateLinkDomainRequest
- type CreateSegmentRequest
- type CreateSignupFormRequest
- type CreateSuppressionRequest
- type CreateTeamInviteParams
- type CreateTemplateRequest
- type CreateWebhookRequest
- type DNSRecord
- type DeleteContactsParams
- type DeleteInboxDraftResponse
- type DeleteInboxLabelResponse
- type DeleteInboxResponse
- type DeleteInboxThreadResponse
- type DeleteReceivedEmailResponse
- type DeletedObject
- type Domain
- type DomainEventsItem
- type DomainListItem
- type DomainProvider
- type DomainReceiving
- type DomainReceivingMXRecord
- type DomainReceivingPublishedMXItem
- type DomainsService
- func (s *DomainsService) Claim(ctx context.Context, params *ClaimDomainParams, opts ...RequestOption) (*ClaimDomainResponse, error)
- func (s *DomainsService) ConnectCloudflare(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
- func (s *DomainsService) ConnectCloudflareInbound(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
- func (s *DomainsService) Create(ctx context.Context, params *AddDomainRequest, opts ...RequestOption) (*Domain, error)
- func (s *DomainsService) Delete(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
- func (s *DomainsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Domain, error)
- func (s *DomainsService) GetClaimRecord(ctx context.Context, query *GetDomainClaimRecordQuery, opts ...RequestOption) (*GetDomainClaimRecordResponse, error)
- func (s *DomainsService) List(ctx context.Context, opts ...RequestOption) (*ListDomainsResponse, error)
- func (s *DomainsService) Update(ctx context.Context, id string, params *UpdateDomainReceivingParams, ...) (*UpdateDomainReceivingResponse, error)
- func (s *DomainsService) Verify(ctx context.Context, id string, opts ...RequestOption) (*VerifyDomainResponse, error)
- type DuplicateBroadcastResponse
- type Email
- type EmailEventsItem
- type EmailList
- type EmailSummary
- type EmailTagsItem
- type EmailsReceivingAttachmentsService
- func (s *EmailsReceivingAttachmentsService) Get(ctx context.Context, id string, attachmentID string, opts ...RequestOption) (*ReceivedAttachment, error)
- func (s *EmailsReceivingAttachmentsService) List(ctx context.Context, id string, opts ...RequestOption) (*ListReceivedEmailAttachmentsResponse, error)
- type EmailsReceivingService
- func (s *EmailsReceivingService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeleteReceivedEmailResponse, error)
- func (s *EmailsReceivingService) Get(ctx context.Context, id string, opts ...RequestOption) (*ReceivedEmail, error)
- func (s *EmailsReceivingService) List(ctx context.Context, query *ListReceivedEmailsQuery, opts ...RequestOption) (*ListReceivedEmailsResponse, error)
- func (s *EmailsReceivingService) ListAll(ctx context.Context, query *ListReceivedEmailsQuery, opts ...RequestOption) iter.Seq2[ReceivedEmailSummary, error]
- func (s *EmailsReceivingService) Mark(ctx context.Context, params *MarkReceivedEmailsParams, opts ...RequestOption) (*MarkReceivedEmailsResponse, error)
- func (s *EmailsReceivingService) Reply(ctx context.Context, id string, params *ReplyToReceivedEmailParams, ...) (*ReplyToReceivedEmailResponse, error)
- func (s *EmailsReceivingService) Update(ctx context.Context, id string, params *UpdateReceivedEmailParams, ...) (*UpdateReceivedEmailResponse, error)
- type EmailsService
- func (s *EmailsService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*CancelEmailResponse, error)
- func (s *EmailsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Email, error)
- func (s *EmailsService) GetMetrics(ctx context.Context, query *GetEmailMetricsQuery, opts ...RequestOption) (*GetEmailMetricsResponse, error)
- func (s *EmailsService) List(ctx context.Context, query *ListEmailsQuery, opts ...RequestOption) (*EmailList, error)
- func (s *EmailsService) ListAll(ctx context.Context, query *ListEmailsQuery, opts ...RequestOption) iter.Seq2[EmailSummary, error]
- func (s *EmailsService) ListClickedLinks(ctx context.Context, query *ListClickedLinksQuery, opts ...RequestOption) (map[string]any, error)
- func (s *EmailsService) Send(ctx context.Context, params *SendEmailRequest, opts ...RequestOption) (*SendEmailResponse, error)
- func (s *EmailsService) SendBatch(ctx context.Context, params []SendEmailRequest, opts ...RequestOption) (*BatchSendResponse, error)
- func (s *EmailsService) Share(ctx context.Context, id string, params *ShareEmailParams, ...) (*ShareEmailResponse, error)
- func (s *EmailsService) Update(ctx context.Context, id string, params *UpdateEmailParams, ...) (*UpdateEmailResponse, error)
- type Error
- type ExportContactsQuery
- type FormsPendingService
- func (s *FormsPendingService) Approve(ctx context.Context, id string, pendingID string, opts ...RequestOption) (*ApprovePendingSignupResponse, error)
- func (s *FormsPendingService) ApproveAll(ctx context.Context, id string, params *ApproveAllPendingSignupsParams, ...) (*ApproveAllPendingSignupsResponse, error)
- func (s *FormsPendingService) List(ctx context.Context, id string, query *ListPendingSignupsQuery, ...) (*PendingSignupList, error)
- func (s *FormsPendingService) Remove(ctx context.Context, id string, pendingID string, opts ...RequestOption) (*RemovePendingSignupResponse, error)
- type FormsService
- func (s *FormsService) Create(ctx context.Context, params *CreateSignupFormRequest, opts ...RequestOption) (*SignupForm, error)
- func (s *FormsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*SignupFormDeleted, error)
- func (s *FormsService) Get(ctx context.Context, id string, opts ...RequestOption) (*SignupForm, error)
- func (s *FormsService) List(ctx context.Context, opts ...RequestOption) (*SignupFormList, error)
- func (s *FormsService) PreviewWelcomeEmail(ctx context.Context, id string, params *PreviewFormWelcomeEmailParams, ...) (map[string]any, error)
- func (s *FormsService) Update(ctx context.Context, id string, params *UpdateSignupFormRequest, ...) (*SignupForm, error)
- type ForwardInboxThreadEmailParams
- type GetAnalyticsQuery
- type GetBroadcastAudienceQuery
- type GetCapabilitiesResponse
- type GetCapabilitiesResponseAccount
- type GetCapabilitiesResponseRateLimit
- type GetCapabilitiesResponseSendChecks
- type GetContactPropertyResponse
- type GetDomainClaimRecordQuery
- type GetDomainClaimRecordResponse
- type GetDomainClaimRecordResponseRecord
- type GetEmailMetricsQuery
- type GetEmailMetricsResponse
- type GetEmailMetricsResponseDataItem
- type GetWebhookDeliveryResponse
- type GetWebhookDeliveryResponseAttemptLogItem
- type Inbox
- type InboxDraft
- type InboxDraftListItem
- type InboxLabel
- type InboxLabelRef
- type InboxListItem
- type InboxSentEmail
- type InboxSentEmailAttachmentsItem
- type InboxSentEmailVerdicts
- type InboxThread
- type InboxThreadEmail
- type InboxThreadEmailAttachmentsItem
- type InboxThreadEmailVerdicts
- type InboxThreadListItem
- type InboxesDraftsService
- func (s *InboxesDraftsService) Create(ctx context.Context, inboxID string, params *CreateInboxDraftParams, ...) (*InboxDraft, error)
- func (s *InboxesDraftsService) Delete(ctx context.Context, inboxID string, draftID string, opts ...RequestOption) (*DeleteInboxDraftResponse, error)
- func (s *InboxesDraftsService) Get(ctx context.Context, inboxID string, draftID string, opts ...RequestOption) (*InboxDraft, error)
- func (s *InboxesDraftsService) List(ctx context.Context, inboxID string, query *ListInboxDraftsQuery, ...) (*ListInboxDraftsResponse, error)
- func (s *InboxesDraftsService) ListAll(ctx context.Context, inboxID string, query *ListInboxDraftsQuery, ...) iter.Seq2[InboxDraftListItem, error]
- func (s *InboxesDraftsService) Send(ctx context.Context, inboxID string, draftID string, ...) (*SendInboxDraftResponse, error)
- func (s *InboxesDraftsService) Update(ctx context.Context, inboxID string, draftID string, ...) (*InboxDraft, error)
- type InboxesLabelsService
- func (s *InboxesLabelsService) Create(ctx context.Context, inboxID string, params *CreateInboxLabelParams, ...) (*InboxLabel, error)
- func (s *InboxesLabelsService) Delete(ctx context.Context, inboxID string, labelID string, opts ...RequestOption) (*DeleteInboxLabelResponse, error)
- func (s *InboxesLabelsService) Get(ctx context.Context, inboxID string, labelID string, opts ...RequestOption) (*InboxLabel, error)
- func (s *InboxesLabelsService) List(ctx context.Context, inboxID string, opts ...RequestOption) (*ListInboxLabelsResponse, error)
- func (s *InboxesLabelsService) Update(ctx context.Context, inboxID string, labelID string, ...) (*UpdateInboxLabelResponse, error)
- type InboxesService
- func (s *InboxesService) Create(ctx context.Context, params *CreateInboxParams, opts ...RequestOption) (*Inbox, error)
- func (s *InboxesService) Delete(ctx context.Context, inboxID string, opts ...RequestOption) (*DeleteInboxResponse, error)
- func (s *InboxesService) Get(ctx context.Context, inboxID string, opts ...RequestOption) (*Inbox, error)
- func (s *InboxesService) List(ctx context.Context, query *ListInboxesQuery, opts ...RequestOption) (*ListInboxesResponse, error)
- func (s *InboxesService) ListAll(ctx context.Context, query *ListInboxesQuery, opts ...RequestOption) iter.Seq2[InboxListItem, error]
- func (s *InboxesService) Update(ctx context.Context, inboxID string, params *UpdateInboxParams, ...) (*UpdateInboxResponse, error)
- type InboxesThreadsEmailsService
- func (s *InboxesThreadsEmailsService) Forward(ctx context.Context, inboxID string, threadID string, emailID string, ...) (*InboxSentEmail, error)
- func (s *InboxesThreadsEmailsService) Get(ctx context.Context, inboxID string, threadID string, emailID string, ...) (*InboxThreadEmail, error)
- func (s *InboxesThreadsEmailsService) List(ctx context.Context, inboxID string, threadID string, ...) (*ListInboxThreadEmailsResponse, error)
- func (s *InboxesThreadsEmailsService) ListAll(ctx context.Context, inboxID string, threadID string, ...) iter.Seq2[InboxThreadEmail, error]
- func (s *InboxesThreadsEmailsService) Reply(ctx context.Context, inboxID string, threadID string, emailID string, ...) (*InboxSentEmail, error)
- type InboxesThreadsService
- func (s *InboxesThreadsService) Delete(ctx context.Context, inboxID string, threadID string, opts ...RequestOption) (*DeleteInboxThreadResponse, error)
- func (s *InboxesThreadsService) Get(ctx context.Context, inboxID string, threadID string, opts ...RequestOption) (*InboxThread, error)
- func (s *InboxesThreadsService) List(ctx context.Context, inboxID string, query *ListInboxThreadsQuery, ...) (*ListInboxThreadsResponse, error)
- func (s *InboxesThreadsService) ListAll(ctx context.Context, inboxID string, query *ListInboxThreadsQuery, ...) iter.Seq2[InboxThreadListItem, error]
- func (s *InboxesThreadsService) Update(ctx context.Context, inboxID string, threadID string, ...) (*InboxThread, error)
- type LinkDomain
- type LinkDomainConnectCheck
- type LinkDomainConnectLink
- type LinkDomainDNSRecord
- type LinkDomainDeleted
- type LinkDomainError
- type LinkDomainList
- type LinkDomainsService
- func (s *LinkDomainsService) Create(ctx context.Context, params *CreateLinkDomainRequest, opts ...RequestOption) (*LinkDomain, error)
- func (s *LinkDomainsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*LinkDomainDeleted, error)
- func (s *LinkDomainsService) Get(ctx context.Context, id string, opts ...RequestOption) (*LinkDomain, error)
- func (s *LinkDomainsService) GetDomainConnect(ctx context.Context, id string, opts ...RequestOption) (*LinkDomainConnectCheck, error)
- func (s *LinkDomainsService) List(ctx context.Context, opts ...RequestOption) (*LinkDomainList, error)
- func (s *LinkDomainsService) Refresh(ctx context.Context, id string, opts ...RequestOption) (*LinkDomain, error)
- func (s *LinkDomainsService) StartDomainConnect(ctx context.Context, id string, opts ...RequestOption) (*LinkDomainConnectLink, error)
- type ListAPIKeysResponse
- type ListBroadcastClickedLinksResponse
- type ListBroadcastClickedLinksResponseLinksItem
- type ListBroadcastRecipientsQuery
- type ListBroadcastsQuery
- type ListClickedLinksQuery
- type ListContactPropertiesResponse
- type ListContactsQuery
- type ListDomainsResponse
- type ListEmailsQuery
- type ListInboxDraftsQuery
- type ListInboxDraftsResponse
- type ListInboxLabelsResponse
- type ListInboxThreadEmailsQuery
- type ListInboxThreadEmailsResponse
- type ListInboxThreadsQuery
- type ListInboxThreadsResponse
- type ListInboxesQuery
- type ListInboxesResponse
- type ListLogsQuery
- type ListLogsResponse
- type ListPendingSignupsQuery
- type ListReceivedEmailAttachmentsResponse
- type ListReceivedEmailsQuery
- type ListReceivedEmailsResponse
- type ListSegmentContactsQuery
- type ListSuppressionsQuery
- type ListTeamInvitesResponse
- type ListTeamMembersResponse
- type ListTemplatesQuery
- type ListWebhookDeliveriesQuery
- type ListWebhookDeliveriesResponse
- type ListWebhookEventAttemptsResponse
- type ListWebhookEventAttemptsResponseDataItem
- type ListWebhookEventsQuery
- type ListWebhookEventsResponse
- type ListWebhooksResponse
- type LogEvent
- type LogEventTagsItem
- type LogsService
- type MarkReceivedEmailsParams
- type MarkReceivedEmailsResponse
- type Nullable
- type Option
- type PendingSignup
- type PendingSignupConfirmationEmail
- type PendingSignupList
- type PreviewFormWelcomeEmailParams
- type PreviewFormWelcomeEmailParamsSample
- type PublishTemplateParams
- type ReceivedAttachment
- type ReceivedEmail
- type ReceivedEmailRaw
- type ReceivedEmailSummary
- type ReceivedEmailSummaryVerdicts
- type ReceivedEmailVerdicts
- type RemovePendingSignupResponse
- type RemoveSuppressionsBatchParams
- type ReplayWebhookEventResponse
- type ReplyToInboxThreadEmailParams
- type ReplyToReceivedEmailParams
- type ReplyToReceivedEmailResponse
- type RequestOption
- type RetryWebhookDeliveryResponse
- type RevokeAPIKeyResponse
- type RotateWebhookSigningSecretResponse
- type Segment
- type SegmentContactList
- type SegmentContactListSegment
- type SegmentList
- type SegmentSummary
- type SegmentsContactsService
- type SegmentsService
- func (s *SegmentsService) Create(ctx context.Context, params *CreateSegmentRequest, opts ...RequestOption) (*Segment, error)
- func (s *SegmentsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeletedObject, error)
- func (s *SegmentsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Segment, error)
- func (s *SegmentsService) List(ctx context.Context, opts ...RequestOption) (*SegmentList, error)
- func (s *SegmentsService) Update(ctx context.Context, id string, params *UpdateSegmentRequest, ...) (*Segment, error)
- type SendBroadcastParams
- type SendBroadcastTestParams
- type SendBroadcastTestResponse
- type SendEmailRequest
- type SendEmailRequestAttachmentsItem
- type SendEmailRequestTagsItem
- type SendEmailRequestTemplate
- type SendEmailResponse
- type SendInboxDraftParams
- type SendInboxDraftResponse
- type Service
- type ShareEmailParams
- type ShareEmailResponse
- type SignupForm
- type SignupFormDeleted
- type SignupFormList
- type SignupFormRecentPendingConfirmationsItem
- type SignupFormWelcomeStats
- type StringList
- type Success
- type Suppression
- type SuppressionDeleted
- type SuppressionList
- type SuppressionsService
- func (s *SuppressionsService) AddBatch(ctx context.Context, params *AddSuppressionsBatchParams, opts ...RequestOption) (map[string]any, error)
- func (s *SuppressionsService) Create(ctx context.Context, params *CreateSuppressionRequest, opts ...RequestOption) (*Suppression, error)
- func (s *SuppressionsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*SuppressionDeleted, error)
- func (s *SuppressionsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Suppression, error)
- func (s *SuppressionsService) List(ctx context.Context, query *ListSuppressionsQuery, opts ...RequestOption) (*SuppressionList, error)
- func (s *SuppressionsService) RemoveBatch(ctx context.Context, params *RemoveSuppressionsBatchParams, ...) (map[string]any, error)
- type TeamInvite
- type TeamInvitesService
- func (s *TeamInvitesService) Create(ctx context.Context, params *CreateTeamInviteParams, opts ...RequestOption) (*TeamInvite, error)
- func (s *TeamInvitesService) Get(ctx context.Context, id string, opts ...RequestOption) (*TeamInvite, error)
- func (s *TeamInvitesService) List(ctx context.Context, opts ...RequestOption) (*ListTeamInvitesResponse, error)
- func (s *TeamInvitesService) Revoke(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
- type TeamMember
- type TeamMembersService
- func (s *TeamMembersService) List(ctx context.Context, opts ...RequestOption) (*ListTeamMembersResponse, error)
- func (s *TeamMembersService) Remove(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
- func (s *TeamMembersService) Update(ctx context.Context, id string, params *UpdateTeamMemberParams, ...) (map[string]any, error)
- type TeamService
- type Template
- type TemplateDeleted
- type TemplateError
- type TemplateList
- type TemplateRef
- type TemplateSummary
- type TemplateVariable
- type TemplatesService
- func (s *TemplatesService) Create(ctx context.Context, params *CreateTemplateRequest, opts ...RequestOption) (*TemplateRef, error)
- func (s *TemplatesService) Delete(ctx context.Context, id string, opts ...RequestOption) (*TemplateDeleted, error)
- func (s *TemplatesService) Duplicate(ctx context.Context, id string, opts ...RequestOption) (*TemplateRef, error)
- func (s *TemplatesService) Get(ctx context.Context, id string, opts ...RequestOption) (*Template, error)
- func (s *TemplatesService) List(ctx context.Context, query *ListTemplatesQuery, opts ...RequestOption) (*TemplateList, error)
- func (s *TemplatesService) ListAll(ctx context.Context, query *ListTemplatesQuery, opts ...RequestOption) iter.Seq2[TemplateSummary, error]
- func (s *TemplatesService) Publish(ctx context.Context, id string, params *PublishTemplateParams, ...) (*TemplateRef, error)
- func (s *TemplatesService) Update(ctx context.Context, id string, params *UpdateTemplateRequest, ...) (*TemplateRef, error)
- type TestWebhookResponse
- type UpdateAPIKeyParams
- type UpdateAPIKeyResponse
- type UpdateBroadcastRequest
- type UpdateContactPropertyParams
- type UpdateContactPropertyResponse
- type UpdateContactRequest
- type UpdateDomainReceivingParams
- type UpdateDomainReceivingResponse
- type UpdateEmailParams
- type UpdateEmailResponse
- type UpdateInboxDraftParams
- type UpdateInboxLabelParams
- type UpdateInboxLabelResponse
- type UpdateInboxParams
- type UpdateInboxResponse
- type UpdateInboxThreadParams
- type UpdateReceivedEmailParams
- type UpdateReceivedEmailResponse
- type UpdateSegmentRequest
- type UpdateSignupFormRequest
- type UpdateTeamMemberParams
- type UpdateTemplateRequest
- type UpdateWebhookRequest
- type Usage
- type UsageAICredits
- type UsageAutomationRuns
- type UsageBroadcasts
- type UsageContacts
- type UsageDomains
- type UsageEmails
- type UsageEmailsCredits
- type UsageEmailsDaily
- type UsageEmailsMonthly
- type UsageRateLimit
- type UsageSegments
- type VerifyDomainResponse
- type VerifyDomainResponseChecks
- type Webhook
- type WebhookDelivery
- type WebhookDeliveryAttemptLogItem
- type WebhookEvent
- type WebhookEventSummary
- type WebhookUpdated
- type WebhooksDeliveriesService
- func (s *WebhooksDeliveriesService) Get(ctx context.Context, id string, deliveryID string, opts ...RequestOption) (*GetWebhookDeliveryResponse, error)
- func (s *WebhooksDeliveriesService) List(ctx context.Context, id string, query *ListWebhookDeliveriesQuery, ...) (*ListWebhookDeliveriesResponse, error)
- func (s *WebhooksDeliveriesService) ListAll(ctx context.Context, id string, query *ListWebhookDeliveriesQuery, ...) iter.Seq2[WebhookDelivery, error]
- func (s *WebhooksDeliveriesService) Retry(ctx context.Context, id string, deliveryID string, opts ...RequestOption) (*RetryWebhookDeliveryResponse, error)
- type WebhooksEventsAttemptsService
- type WebhooksEventsService
- func (s *WebhooksEventsService) Get(ctx context.Context, id string, eventID string, opts ...RequestOption) (*WebhookEvent, error)
- func (s *WebhooksEventsService) List(ctx context.Context, id string, query *ListWebhookEventsQuery, ...) (*ListWebhookEventsResponse, error)
- func (s *WebhooksEventsService) ListAll(ctx context.Context, id string, query *ListWebhookEventsQuery, ...) iter.Seq2[WebhookEventSummary, error]
- func (s *WebhooksEventsService) Replay(ctx context.Context, id string, eventID string, opts ...RequestOption) (*ReplayWebhookEventResponse, error)
- type WebhooksService
- func (s *WebhooksService) Create(ctx context.Context, params *CreateWebhookRequest, opts ...RequestOption) (*Webhook, error)
- func (s *WebhooksService) Delete(ctx context.Context, id string, opts ...RequestOption) (*Success, error)
- func (s *WebhooksService) Get(ctx context.Context, id string, opts ...RequestOption) (*Webhook, error)
- func (s *WebhooksService) List(ctx context.Context, opts ...RequestOption) (*ListWebhooksResponse, error)
- func (s *WebhooksService) Replace(ctx context.Context, id string, params *UpdateWebhookRequest, ...) (*WebhookUpdated, error)
- func (s *WebhooksService) RotateSigningSecret(ctx context.Context, id string, opts ...RequestOption) (*RotateWebhookSigningSecretResponse, error)
- func (s *WebhooksService) Test(ctx context.Context, id string, opts ...RequestOption) (*TestWebhookResponse, error)
- func (s *WebhooksService) Update(ctx context.Context, id string, params *UpdateWebhookRequest, ...) (*WebhookUpdated, error)
Constants ¶
const Version = "0.1.1"
Version is the SDK version, sent in the User-Agent header.
Variables ¶
This section is empty.
Functions ¶
func IsForbidden ¶
IsForbidden reports whether err is a 403: the key lacks the scope, or the domain is not verified.
func IsNotFound ¶
IsNotFound reports whether err is a 404 from the API.
func IsUnauthorized ¶
IsUnauthorized reports whether err is a 401: a missing or wrong API key.
func VerifyWebhookSignature ¶
VerifyWebhookSignature checks that a webhook request came from SMTPfast. signature is the X-SMTPfast-Signature header: the hex HMAC-SHA256 of the raw request body, keyed with the webhook's signing secret. Pass the body exactly as received, before any JSON parsing.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
// Message is the API's "error" field, or the raw body when it is not JSON.
Message string
// Body is the raw response body; it can hold more fields, such as missing_variables.
Body []byte
Header http.Header
}
APIError is an answer outside 2xx. Check the status with errors.As, or with IsNotFound, IsRateLimited and the other helpers.
type APIKey ¶
type APIKey struct {
ID string `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
Scopes []string `json:"scopes"`
CreatedAt string `json:"created_at"`
LastUsedAt Nullable[string] `json:"last_used_at,omitzero"`
RevokedAt Nullable[string] `json:"revoked_at,omitzero"`
// ExpiresAt: Set for connected-app keys, which rotate.
ExpiresAt Nullable[string] `json:"expires_at,omitzero"`
// GrantExpiresAt: When a connected app's grant ends.
GrantExpiresAt Nullable[string] `json:"grant_expires_at,omitzero"`
}
APIKey: List and update responses also carry the same values in camelCase (keyPrefix, createdAt, lastUsedAt, revokedAt, expiresAt, grantExpiresAt) for older c
type APIKeyCreated ¶
type APIKeyCreated struct {
ID *string `json:"id,omitzero"`
Name *string `json:"name,omitzero"`
Key *string `json:"key,omitzero"`
Prefix *string `json:"prefix,omitzero"`
Scopes []string `json:"scopes,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
}
APIKeyCreated: Returned when a new API key is created. The key field contains the full secret and is only shown once.
type APIKeysService ¶
type APIKeysService struct {
// contains filtered or unexported fields
}
APIKeysService groups the apiKeys operations.
func (*APIKeysService) Create ¶
func (s *APIKeysService) Create(ctx context.Context, params *CreateAPIKeyRequest, opts ...RequestOption) (*APIKeyCreated, error)
Create: Create API key (POST /v1/api-keys).
func (*APIKeysService) List ¶
func (s *APIKeysService) List(ctx context.Context, opts ...RequestOption) (*ListAPIKeysResponse, error)
List: List API keys (GET /v1/api-keys).
func (*APIKeysService) Revoke ¶
func (s *APIKeysService) Revoke(ctx context.Context, id string, opts ...RequestOption) (*RevokeAPIKeyResponse, error)
Revoke: Revoke API key (DELETE /v1/api-keys/{id}).
func (*APIKeysService) Update ¶
func (s *APIKeysService) Update(ctx context.Context, id string, params *UpdateAPIKeyParams, opts ...RequestOption) (*UpdateAPIKeyResponse, error)
Update: Update API key (PATCH /v1/api-keys/{id}).
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
AccountService groups the account operations.
func (*AccountService) Me ¶
func (s *AccountService) Me(ctx context.Context, opts ...RequestOption) (*GetCapabilitiesResponse, error)
Me: What this API key can do (GET /v1/me).
func (*AccountService) Usage ¶
func (s *AccountService) Usage(ctx context.Context, opts ...RequestOption) (*Usage, error)
Usage: Usage against the plan (GET /v1/usage).
type AddDomainRequest ¶
type AddDomainRequest struct {
// Domain: The domain name to register for sending
Domain string `json:"domain"`
}
type AddSuppressionsBatchParams ¶
type AddSuppressionsBatchParams struct {
Emails []string `json:"emails"`
}
type Analytics ¶
type Analytics struct {
// Total: Every email on the account, whatever its status
Total *int64 `json:"total,omitzero"`
// Sent: Emails that went out (sent, delivered, opened, clicked, bounced or complained). The rates are worked out against this.
Sent *int64 `json:"sent,omitzero"`
// Today: Emails sent in the last 24 hours
Today *int64 `json:"today,omitzero"`
// ThisWeek: Emails sent in the last 7 days
ThisWeek *int64 `json:"thisWeek,omitzero"`
// Delivered: Accepted by the receiving server, including those later opened or clicked
Delivered *int64 `json:"delivered,omitzero"`
Bounced *int64 `json:"bounced,omitzero"`
Complained *int64 `json:"complained,omitzero"`
// Failed: Never sent because of an error
Failed *int64 `json:"failed,omitzero"`
// Pending: Scheduled, queued or sending; not counted in any rate yet
Pending *int64 `json:"pending,omitzero"`
Canceled *int64 `json:"canceled,omitzero"`
// AwaitingReport: Sent, with no delivery or bounce report yet; not counted in the rates
AwaitingReport *int64 `json:"awaitingReport,omitzero"`
// DeliveryRate: (delivered + complained) / (sent - awaitingReport), as a percentage
DeliveryRate *float64 `json:"deliveryRate,omitzero"`
// BounceRate: bounced / (sent - awaitingReport), as a percentage
BounceRate *float64 `json:"bounceRate,omitzero"`
// Daily: Last 30 days, bucketed by the UTC day each email was sent
Daily []AnalyticsDailyItem `json:"daily,omitzero"`
Usage *AnalyticsUsage `json:"usage,omitzero"`
// Window: Present when days or domain is passed
Window *AnalyticsWindow `json:"window,omitzero"`
}
type AnalyticsDailyItem ¶
type AnalyticsService ¶
type AnalyticsService struct {
// contains filtered or unexported fields
}
AnalyticsService groups the analytics operations.
func (*AnalyticsService) Get ¶
func (s *AnalyticsService) Get(ctx context.Context, query *GetAnalyticsQuery, opts ...RequestOption) (*Analytics, error)
Get: Get analytics (GET /v1/analytics).
type AnalyticsUsage ¶
type AnalyticsWindow ¶
type AnalyticsWindow struct {
Days *int64 `json:"days,omitzero"`
From *string `json:"from,omitzero"`
To *string `json:"to,omitzero"`
Domain Nullable[string] `json:"domain,omitzero"`
Counts *AnalyticsWindowCounts `json:"counts,omitzero"`
RatesPercent *AnalyticsWindowRatesPercent `json:"rates_percent,omitzero"`
Complete *bool `json:"complete,omitzero"`
}
AnalyticsWindow: Present when days or domain is passed
type AnalyticsWindowCounts ¶
type AnalyticsWindowCounts struct {
Sent *int64 `json:"sent,omitzero"`
Delivered *int64 `json:"delivered,omitzero"`
HardBounced *int64 `json:"hard_bounced,omitzero"`
SoftBounced *int64 `json:"soft_bounced,omitzero"`
Complained *int64 `json:"complained,omitzero"`
Failed *int64 `json:"failed,omitzero"`
}
type ApproveAllPendingSignupsParams ¶
type ApproveAllPendingSignupsParams struct {
// Q: Only approve signups matching this search
Q *string `json:"q,omitzero"`
}
type BatchSendResponse ¶
type BatchSendResponse struct {
// BatchID: Identifier for the batch as a whole
BatchID string `json:"batch_id"`
// Count: Number of emails created (matches input length)
Count int64 `json:"count"`
// Emails: Per-row result. status is "queued" for normal sends, "scheduled" if scheduled_at is in the future, or "failed" if the row has no deliverable To recipi
Emails []BatchSendResponseEmailsItem `json:"emails"`
// Data: The same ids in Resend's batch response shape: one { id } per item, in request order.
Data []BatchSendResponseDataItem `json:"data"`
}
type BatchSendResponseDataItem ¶
type BatchSendResponseDataItem struct {
ID string `json:"id"`
}
type Broadcast ¶
type Broadcast struct {
Object *string `json:"object,omitzero"`
ID string `json:"id"`
Name string `json:"name"`
Audience *string `json:"audience,omitzero"`
// AudienceMeta: Details of the audience, such as the segment_id
AudienceMeta map[string]any `json:"audience_meta,omitzero"`
// SegmentID: The segment the broadcast goes to when audience is segment, otherwise null
SegmentID Nullable[string] `json:"segment_id,omitzero"`
From Nullable[string] `json:"from,omitzero"`
ReplyTo Nullable[string] `json:"reply_to,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
PreviewText Nullable[string] `json:"preview_text,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Markdown Nullable[string] `json:"markdown,omitzero"`
Status string `json:"status"`
ScheduledAt Nullable[string] `json:"scheduled_at,omitzero"`
QueuedAt Nullable[string] `json:"queued_at,omitzero"`
SentAt Nullable[string] `json:"sent_at,omitzero"`
CanceledAt Nullable[string] `json:"canceled_at,omitzero"`
// ArchivedAt: When the broadcast was archived. Archived broadcasts are left out of the list unless archived=true or archived=all.
ArchivedAt Nullable[string] `json:"archived_at,omitzero"`
// PausedAt: Set when the campaign was stopped mid-send by the deliverability guard
PausedAt Nullable[string] `json:"paused_at,omitzero"`
// PauseReason: Why the campaign was paused, for example the complaint rate that tripped the guard
PauseReason Nullable[string] `json:"pause_reason,omitzero"`
// FanoutCompletedAt: When every recipient of the send had been created
FanoutCompletedAt Nullable[string] `json:"fanout_completed_at,omitzero"`
// ExpectedRecipients: Eligible recipients counted when the send was accepted
ExpectedRecipients Nullable[int64] `json:"expected_recipients,omitzero"`
// SendOverMinutes: Minutes the send is spread over from its start (scheduled_at, else queued_at); 0 means all at once
SendOverMinutes *int64 `json:"send_over_minutes,omitzero"`
TrackOpens *bool `json:"track_opens,omitzero"`
TrackClicks *bool `json:"track_clicks,omitzero"`
RecipientCount *int64 `json:"recipient_count,omitzero"`
Metrics *BroadcastMetrics `json:"metrics,omitzero"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type BroadcastDetail ¶
type BroadcastDetail struct {
Object *string `json:"object,omitzero"`
ID string `json:"id"`
Name string `json:"name"`
Audience *string `json:"audience,omitzero"`
// AudienceMeta: Details of the audience, such as the segment_id
AudienceMeta map[string]any `json:"audience_meta,omitzero"`
// SegmentID: The segment the broadcast goes to when audience is segment, otherwise null
SegmentID Nullable[string] `json:"segment_id,omitzero"`
From Nullable[string] `json:"from,omitzero"`
ReplyTo Nullable[string] `json:"reply_to,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
PreviewText Nullable[string] `json:"preview_text,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Markdown Nullable[string] `json:"markdown,omitzero"`
Status string `json:"status"`
ScheduledAt Nullable[string] `json:"scheduled_at,omitzero"`
QueuedAt Nullable[string] `json:"queued_at,omitzero"`
SentAt Nullable[string] `json:"sent_at,omitzero"`
CanceledAt Nullable[string] `json:"canceled_at,omitzero"`
// ArchivedAt: When the broadcast was archived. Archived broadcasts are left out of the list unless archived=true or archived=all.
ArchivedAt Nullable[string] `json:"archived_at,omitzero"`
// PausedAt: Set when the campaign was stopped mid-send by the deliverability guard
PausedAt Nullable[string] `json:"paused_at,omitzero"`
// PauseReason: Why the campaign was paused, for example the complaint rate that tripped the guard
PauseReason Nullable[string] `json:"pause_reason,omitzero"`
// FanoutCompletedAt: When every recipient of the send had been created
FanoutCompletedAt Nullable[string] `json:"fanout_completed_at,omitzero"`
// ExpectedRecipients: Eligible recipients counted when the send was accepted
ExpectedRecipients Nullable[int64] `json:"expected_recipients,omitzero"`
// SendOverMinutes: Minutes the send is spread over from its start (scheduled_at, else queued_at); 0 means all at once
SendOverMinutes *int64 `json:"send_over_minutes,omitzero"`
TrackOpens *bool `json:"track_opens,omitzero"`
TrackClicks *bool `json:"track_clicks,omitzero"`
RecipientCount *int64 `json:"recipient_count,omitzero"`
Metrics *BroadcastMetrics `json:"metrics,omitzero"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Recipients []BroadcastRecipientDetail `json:"recipients"`
Links []BroadcastDetailLinksItem `json:"links"`
}
BroadcastDetail: A broadcast with its latest 250 recipients and the links clicked in it.
type BroadcastList ¶
type BroadcastList struct {
Object string `json:"object"`
Data []Broadcast `json:"data"`
HasMore bool `json:"has_more"`
Page *int64 `json:"page,omitzero"`
PageSize *int64 `json:"page_size,omitzero"`
// FilteredTotal: Broadcasts matching the status, search and archived filters
FilteredTotal *int64 `json:"filtered_total,omitzero"`
// Total: Every broadcast of the team that is not archived
Total *int64 `json:"total,omitzero"`
// ArchivedTotal: Archived broadcasts of the team
ArchivedTotal *int64 `json:"archived_total,omitzero"`
// StatusCounts: Broadcasts that are not archived, per status
StatusCounts map[string]int64 `json:"status_counts,omitzero"`
}
type BroadcastMetrics ¶
type BroadcastMetrics struct {
Total *int64 `json:"total,omitzero"`
Skipped *int64 `json:"skipped,omitzero"`
Queued *int64 `json:"queued,omitzero"`
Sending *int64 `json:"sending,omitzero"`
// HandedOff: Recipients whose email the provider accepted, whatever happened next. Shows how far a send spread over send_over_minutes has got.
HandedOff *int64 `json:"handed_off,omitzero"`
Sent *int64 `json:"sent,omitzero"`
Delivered *int64 `json:"delivered,omitzero"`
Opened *int64 `json:"opened,omitzero"`
Clicked *int64 `json:"clicked,omitzero"`
Unsubscribed *int64 `json:"unsubscribed,omitzero"`
Bounced *int64 `json:"bounced,omitzero"`
Complained *int64 `json:"complained,omitzero"`
Failed *int64 `json:"failed,omitzero"`
Canceled *int64 `json:"canceled,omitzero"`
DeliveryRate *float64 `json:"delivery_rate,omitzero"`
OpenRate *float64 `json:"open_rate,omitzero"`
ClickRate *float64 `json:"click_rate,omitzero"`
UnsubscribeRate *float64 `json:"unsubscribe_rate,omitzero"`
BounceRate *float64 `json:"bounce_rate,omitzero"`
}
type BroadcastRecipientDetail ¶
type BroadcastRecipientDetail struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName Nullable[string] `json:"first_name,omitzero"`
LastName Nullable[string] `json:"last_name,omitzero"`
Status string `json:"status"`
// SkipReason: Why the contact was left out: unsubscribed, suppressed or invalid
SkipReason Nullable[string] `json:"skip_reason,omitzero"`
EmailID Nullable[string] `json:"email_id,omitzero"`
QueuedAt Nullable[string] `json:"queued_at,omitzero"`
SentAt Nullable[string] `json:"sent_at,omitzero"`
DeliveredAt Nullable[string] `json:"delivered_at,omitzero"`
OpenedAt Nullable[string] `json:"opened_at,omitzero"`
ClickedAt Nullable[string] `json:"clicked_at,omitzero"`
BouncedAt Nullable[string] `json:"bounced_at,omitzero"`
ComplainedAt Nullable[string] `json:"complained_at,omitzero"`
UnsubscribedAt Nullable[string] `json:"unsubscribed_at,omitzero"`
FailedAt Nullable[string] `json:"failed_at,omitzero"`
ErrorMessage Nullable[string] `json:"error_message,omitzero"`
Events []BroadcastRecipientDetailEventsItem `json:"events"`
}
type BroadcastSendResult ¶
type BroadcastSendResult struct {
Object string `json:"object"`
ID string `json:"id"`
Name string `json:"name"`
Audience *string `json:"audience,omitzero"`
// AudienceMeta: Details of the audience, such as the segment_id
AudienceMeta map[string]any `json:"audience_meta,omitzero"`
// SegmentID: The segment the broadcast goes to when audience is segment, otherwise null
SegmentID Nullable[string] `json:"segment_id,omitzero"`
From Nullable[string] `json:"from,omitzero"`
ReplyTo Nullable[string] `json:"reply_to,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
PreviewText Nullable[string] `json:"preview_text,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Markdown Nullable[string] `json:"markdown,omitzero"`
Status string `json:"status"`
ScheduledAt Nullable[string] `json:"scheduled_at,omitzero"`
QueuedAt Nullable[string] `json:"queued_at,omitzero"`
SentAt Nullable[string] `json:"sent_at,omitzero"`
CanceledAt Nullable[string] `json:"canceled_at,omitzero"`
// ArchivedAt: When the broadcast was archived. Archived broadcasts are left out of the list unless archived=true or archived=all.
ArchivedAt Nullable[string] `json:"archived_at,omitzero"`
// PausedAt: Set when the campaign was stopped mid-send by the deliverability guard
PausedAt Nullable[string] `json:"paused_at,omitzero"`
// PauseReason: Why the campaign was paused, for example the complaint rate that tripped the guard
PauseReason Nullable[string] `json:"pause_reason,omitzero"`
// FanoutCompletedAt: When every recipient of the send had been created
FanoutCompletedAt Nullable[string] `json:"fanout_completed_at,omitzero"`
// ExpectedRecipients: Eligible recipients counted when the send was accepted
ExpectedRecipients Nullable[int64] `json:"expected_recipients,omitzero"`
// SendOverMinutes: Minutes the send is spread over from its start (scheduled_at, else queued_at); 0 means all at once
SendOverMinutes *int64 `json:"send_over_minutes,omitzero"`
TrackOpens *bool `json:"track_opens,omitzero"`
TrackClicks *bool `json:"track_clicks,omitzero"`
RecipientCount *int64 `json:"recipient_count,omitzero"`
Metrics *BroadcastMetrics `json:"metrics,omitzero"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
// Recipients: Contacts the send will reach
Recipients int64 `json:"recipients"`
// Skipped: Contacts left out: unsubscribed, suppressed or invalid
Skipped int64 `json:"skipped"`
BatchID string `json:"batch_id"`
}
type BroadcastsRecipientsService ¶
type BroadcastsRecipientsService struct {
// contains filtered or unexported fields
}
BroadcastsRecipientsService groups the broadcasts.recipients operations.
func (*BroadcastsRecipientsService) List ¶
func (s *BroadcastsRecipientsService) List(ctx context.Context, id string, query *ListBroadcastRecipientsQuery, opts ...RequestOption) (map[string]any, error)
List: List broadcast recipients (GET /v1/broadcasts/{id}/recipients).
type BroadcastsService ¶
type BroadcastsService struct {
Recipients *BroadcastsRecipientsService
// contains filtered or unexported fields
}
BroadcastsService groups the broadcasts operations.
func (*BroadcastsService) Archive ¶
func (s *BroadcastsService) Archive(ctx context.Context, id string, opts ...RequestOption) (*Broadcast, error)
Archive: Archive a broadcast (POST /v1/broadcasts/{id}/archive).
func (*BroadcastsService) Cancel ¶
func (s *BroadcastsService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*Broadcast, error)
Cancel: Cancel a scheduled broadcast (POST /v1/broadcasts/{id}/cancel).
func (*BroadcastsService) Create ¶
func (s *BroadcastsService) Create(ctx context.Context, params *CreateBroadcastRequest, opts ...RequestOption) (*Broadcast, error)
Create: Create a broadcast draft (POST /v1/broadcasts).
func (*BroadcastsService) Delete ¶
func (s *BroadcastsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeletedObject, error)
Delete: Delete a draft broadcast (DELETE /v1/broadcasts/{id}).
func (*BroadcastsService) Duplicate ¶
func (s *BroadcastsService) Duplicate(ctx context.Context, id string, opts ...RequestOption) (*DuplicateBroadcastResponse, error)
Duplicate: Duplicate broadcast (POST /v1/broadcasts/{id}/duplicate).
func (*BroadcastsService) Get ¶
func (s *BroadcastsService) Get(ctx context.Context, id string, opts ...RequestOption) (*BroadcastDetail, error)
Get: Get broadcast details (GET /v1/broadcasts/{id}).
func (*BroadcastsService) GetAudience ¶
func (s *BroadcastsService) GetAudience(ctx context.Context, query *GetBroadcastAudienceQuery, opts ...RequestOption) (map[string]any, error)
GetAudience: Preview a broadcast audience (GET /v1/broadcasts/audience).
func (*BroadcastsService) List ¶
func (s *BroadcastsService) List(ctx context.Context, query *ListBroadcastsQuery, opts ...RequestOption) (*BroadcastList, error)
List: List broadcasts (GET /v1/broadcasts).
func (*BroadcastsService) ListClickedLinks ¶
func (s *BroadcastsService) ListClickedLinks(ctx context.Context, id string, opts ...RequestOption) (*ListBroadcastClickedLinksResponse, error)
ListClickedLinks: List clicked links (GET /v1/broadcasts/{id}/clicked-links).
func (*BroadcastsService) Send ¶
func (s *BroadcastsService) Send(ctx context.Context, id string, params *SendBroadcastParams, opts ...RequestOption) (*BroadcastSendResult, error)
Send: Send or schedule a broadcast (POST /v1/broadcasts/{id}/send).
func (*BroadcastsService) SendTest ¶
func (s *BroadcastsService) SendTest(ctx context.Context, id string, params *SendBroadcastTestParams, opts ...RequestOption) (*SendBroadcastTestResponse, error)
SendTest: Send a test broadcast email (POST /v1/broadcasts/{id}/test).
func (*BroadcastsService) Unarchive ¶
func (s *BroadcastsService) Unarchive(ctx context.Context, id string, opts ...RequestOption) (*Broadcast, error)
Unarchive: Unarchive a broadcast (POST /v1/broadcasts/{id}/unarchive).
func (*BroadcastsService) Update ¶
func (s *BroadcastsService) Update(ctx context.Context, id string, params *UpdateBroadcastRequest, opts ...RequestOption) (*Broadcast, error)
Update: Update a draft or scheduled broadcast (PATCH /v1/broadcasts/{id}).
type CancelEmailResponse ¶
type ClaimDomainParams ¶
type ClaimDomainParams struct {
Domain string `json:"domain"`
}
type ClaimDomainResponse ¶
type Client ¶
type Client struct {
*Service
}
Client is the SMTPfast API client. Every operation is a method on one of its services, named after the path: client.Emails.Send, client.Inboxes.Threads.Emails.Reply.
type ConnectionError ¶
ConnectionError means no answer arrived: DNS, TLS, a reset connection, or a timeout.
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
func (*ConnectionError) Unwrap ¶
func (e *ConnectionError) Unwrap() error
type Contact ¶
type Contact struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName Nullable[string] `json:"first_name,omitzero"`
LastName Nullable[string] `json:"last_name,omitzero"`
CreatedAt string `json:"created_at"`
Unsubscribed bool `json:"unsubscribed"`
// Disposable: The address is on a known throwaway-mailbox domain (set when the contact is created).
Disposable bool `json:"disposable"`
// Suppressed: The address is on the suppression list
Suppressed bool `json:"suppressed"`
// Segments: The manual segments the contact is in. Lists and GET /v1/contacts/{id} return it.
Segments []ContactSegmentsItem `json:"segments,omitzero"`
Object *string `json:"object,omitzero"`
Properties map[string]any `json:"properties,omitzero"`
Suppression Nullable[ContactSuppression] `json:"suppression,omitzero"`
}
type ContactBatchCreated ¶
type ContactBatchCreated struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []ContactSummary `json:"data"`
}
type ContactCreated ¶
type ContactDeleted ¶
type ContactExport ¶
type ContactExport struct {
Object string `json:"object"`
// HasMore: True when more than 10,000 contacts matched and the export stopped there
HasMore bool `json:"has_more"`
Data []ContactListItem `json:"data"`
ExportedAt string `json:"exported_at"`
}
type ContactList ¶
type ContactList struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []ContactListItem `json:"data"`
Page *int64 `json:"page,omitzero"`
PageSize *int64 `json:"page_size,omitzero"`
// FilteredTotal: Contacts matching the filters
FilteredTotal *int64 `json:"filtered_total,omitzero"`
// Total: Every contact of the team
Total *int64 `json:"total,omitzero"`
Subscribed *int64 `json:"subscribed,omitzero"`
Unsubscribed *int64 `json:"unsubscribed,omitzero"`
// Disposable: Subscribed contacts on throwaway-mailbox domains
Disposable *int64 `json:"disposable,omitzero"`
// New7d: Subscribed contacts added in the last 7 days
New7d *int64 `json:"new_7d,omitzero"`
// New30d: Subscribed contacts added in the last 30 days
New30d *int64 `json:"new_30d,omitzero"`
// ContactLimit: The plan's contact limit, with any override for the account
ContactLimit *int64 `json:"contact_limit,omitzero"`
// ContactLimitBase: The plan's contact limit without overrides
ContactLimitBase *int64 `json:"contact_limit_base,omitzero"`
Tier *string `json:"tier,omitzero"`
}
type ContactListItem ¶
type ContactListItem struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName Nullable[string] `json:"first_name,omitzero"`
LastName Nullable[string] `json:"last_name,omitzero"`
CreatedAt string `json:"created_at"`
Unsubscribed bool `json:"unsubscribed"`
// Disposable: The address is on a known throwaway-mailbox domain (set when the contact is created).
Disposable bool `json:"disposable"`
// Suppressed: The address is on the suppression list
Suppressed bool `json:"suppressed"`
// Segments: The manual segments the contact is in. Lists and GET /v1/contacts/{id} return it.
Segments []ContactListItemSegmentsItem `json:"segments"`
Properties map[string]any `json:"properties"`
Suppression *ContactSuppression `json:"suppression"`
}
ContactListItem: A contact as lists return it: the summary fields plus properties, segments and the suppression.
type ContactPropertiesService ¶
type ContactPropertiesService struct {
// contains filtered or unexported fields
}
ContactPropertiesService groups the contactProperties operations.
func (*ContactPropertiesService) Create ¶
func (s *ContactPropertiesService) Create(ctx context.Context, params *CreateContactPropertyParams, opts ...RequestOption) (*CreateContactPropertyResponse, error)
Create: Declare a contact property (POST /v1/contact-properties).
func (*ContactPropertiesService) Delete ¶
func (s *ContactPropertiesService) Delete(ctx context.Context, id string, opts ...RequestOption) (*Success, error)
Delete: Delete a contact property (DELETE /v1/contact-properties/{id}).
func (*ContactPropertiesService) Get ¶
func (s *ContactPropertiesService) Get(ctx context.Context, id string, opts ...RequestOption) (*GetContactPropertyResponse, error)
Get: Get a contact property (GET /v1/contact-properties/{id}).
func (*ContactPropertiesService) List ¶
func (s *ContactPropertiesService) List(ctx context.Context, opts ...RequestOption) (*ListContactPropertiesResponse, error)
List: List contact properties (GET /v1/contact-properties).
func (*ContactPropertiesService) Update ¶
func (s *ContactPropertiesService) Update(ctx context.Context, id string, params *UpdateContactPropertyParams, opts ...RequestOption) (*UpdateContactPropertyResponse, error)
Update: Update a contact property default (PATCH /v1/contact-properties/{id}).
type ContactProperty ¶
type ContactSegmentsItem ¶
type ContactSummary ¶
type ContactSummary struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName Nullable[string] `json:"first_name,omitzero"`
LastName Nullable[string] `json:"last_name,omitzero"`
CreatedAt string `json:"created_at"`
Unsubscribed bool `json:"unsubscribed"`
// Disposable: The address is on a known throwaway-mailbox domain (set when the contact is created).
Disposable bool `json:"disposable"`
// Suppressed: The address is on the suppression list
Suppressed bool `json:"suppressed"`
// Segments: The manual segments the contact is in. Lists and GET /v1/contacts/{id} return it.
Segments []ContactSummarySegmentsItem `json:"segments,omitzero"`
}
type ContactSuppression ¶
type ContactSuppression struct {
ID string `json:"id"`
Reason string `json:"reason"`
Source string `json:"source"`
// Scope: all: every send to the address is blocked. marketing: only marketing email is blocked, and email labelled transactional still goes out. A recipient's
Scope string `json:"scope"`
CreatedAt string `json:"created_at"`
}
type ContactsSegmentsService ¶
type ContactsSegmentsService struct {
// contains filtered or unexported fields
}
ContactsSegmentsService groups the contacts.segments operations.
func (*ContactsSegmentsService) Add ¶
func (s *ContactsSegmentsService) Add(ctx context.Context, id string, segmentID string, opts ...RequestOption) (map[string]any, error)
Add: Add a contact to a segment (POST /v1/contacts/{id}/segments/{segment_id}).
func (*ContactsSegmentsService) List ¶
func (s *ContactsSegmentsService) List(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
List: List a contact's segments (GET /v1/contacts/{id}/segments).
type ContactsService ¶
type ContactsService struct {
Segments *ContactsSegmentsService
// contains filtered or unexported fields
}
ContactsService groups the contacts operations.
func (*ContactsService) Create ¶
func (s *ContactsService) Create(ctx context.Context, params *CreateContactParams, opts ...RequestOption) (*CreateContactResponse, error)
Create: Create a contact (POST /v1/contacts).
func (*ContactsService) Delete ¶
func (s *ContactsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*ContactDeleted, error)
Delete: Delete a contact (DELETE /v1/contacts/{id}).
func (*ContactsService) DeleteMany ¶
func (s *ContactsService) DeleteMany(ctx context.Context, params *DeleteContactsParams, opts ...RequestOption) (map[string]any, error)
DeleteMany: Delete contacts in bulk (DELETE /v1/contacts).
func (*ContactsService) Export ¶
func (s *ContactsService) Export(ctx context.Context, query *ExportContactsQuery, opts ...RequestOption) (*ContactExport, error)
Export: Export contacts (GET /v1/contacts/export).
func (*ContactsService) Get ¶
func (s *ContactsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Contact, error)
Get: Retrieve a contact (GET /v1/contacts/{id}).
func (*ContactsService) List ¶
func (s *ContactsService) List(ctx context.Context, query *ListContactsQuery, opts ...RequestOption) (*ContactList, error)
List: List contacts (GET /v1/contacts).
func (*ContactsService) Update ¶
func (s *ContactsService) Update(ctx context.Context, id string, params *UpdateContactRequest, opts ...RequestOption) (*ContactCreated, error)
Update: Update a contact (PATCH /v1/contacts/{id}).
type CreateAPIKeyRequest ¶
type CreateAPIKeyRequest struct {
// Name: A human-readable name for the key
Name string `json:"name"`
// Scopes: Optional list of scopes to restrict the key. Available: email:send, email:read, domain:read, domain:write, contact:read, contact:write, form:read, for
Scopes []string `json:"scopes,omitzero"`
}
type CreateBroadcastRequest ¶
type CreateBroadcastRequest struct {
Name *string `json:"name,omitzero"`
Audience *string `json:"audience,omitzero"`
// SegmentID: Required when audience is segment
SegmentID *string `json:"segment_id,omitzero"`
// AudienceMeta: Details of the audience, such as the segment_id
AudienceMeta map[string]any `json:"audience_meta,omitzero"`
// TemplateID: Not in Resend, and only on create (PATCH ignores it). Start from a template (id or alias): its current content, as the template editor shows it, is co
TemplateID *string `json:"template_id,omitzero"`
From *string `json:"from,omitzero"`
ReplyTo Nullable[string] `json:"reply_to,omitzero"`
Subject *string `json:"subject,omitzero"`
PreviewText Nullable[string] `json:"preview_text,omitzero"`
// Markdown: Markdown body. Must include {{unsubscribe_url}} or {{{RESEND_UNSUBSCRIBE_URL}}} before sending.
Markdown *string `json:"markdown,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
TrackOpens *bool `json:"track_opens,omitzero"`
TrackClicks *bool `json:"track_clicks,omitzero"`
// SendOverMinutes: Not in Resend. Spread the send evenly over this many minutes from the send time (or scheduled_at): recipient i of N goes out at start + i * window / N
SendOverMinutes Nullable[int64] `json:"send_over_minutes,omitzero"`
}
CreateBroadcastRequest: name is required unless template_id is given.
type CreateContactBatchRequest ¶
type CreateContactBatchRequest struct {
Contacts []CreateContactRequest `json:"contacts"`
// SegmentIDs: Manual segments to add every contact to, for contacts that do not name their own
SegmentIDs []string `json:"segment_ids,omitzero"`
}
CreateContactBatchRequest: Create or update up to 500 contacts, matched by email. Fields sent replace the stored ones; fields left out stay. segment_ids only adds memberships.
type CreateContactParams ¶
type CreateContactParams struct {
// Email: The contact email address
Email *string `json:"email,omitzero"`
FirstName *string `json:"firstName,omitzero"`
LastName *string `json:"lastName,omitzero"`
FirstName_ *string `json:"first_name,omitzero"`
LastName_ *string `json:"last_name,omitzero"`
// Unsubscribed: Global broadcast subscription status
Unsubscribed *bool `json:"unsubscribed,omitzero"`
Properties map[string]any `json:"properties,omitzero"`
// SegmentIDs: Manual segment IDs to assign this contact to
SegmentIDs []string `json:"segment_ids,omitzero"`
Contacts []CreateContactRequest `json:"contacts,omitzero"`
}
type CreateContactPropertyResponse ¶
type CreateContactPropertyResponse struct {
ContactProperty ContactProperty `json:"contact_property"`
}
type CreateContactRequest ¶
type CreateContactRequest struct {
// Email: The contact email address
Email string `json:"email"`
FirstName *string `json:"firstName,omitzero"`
LastName *string `json:"lastName,omitzero"`
FirstName_ *string `json:"first_name,omitzero"`
LastName_ *string `json:"last_name,omitzero"`
// Unsubscribed: Global broadcast subscription status
Unsubscribed *bool `json:"unsubscribed,omitzero"`
Properties map[string]any `json:"properties,omitzero"`
// SegmentIDs: Manual segment IDs to assign this contact to
SegmentIDs []string `json:"segment_ids,omitzero"`
}
type CreateContactResponse ¶
type CreateContactResponse struct {
Object string `json:"object"`
ID *string `json:"id,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []ContactSummary `json:"data,omitzero"`
}
type CreateInboxDraftParams ¶
type CreateInboxDraftParams struct {
To Nullable[StringList] `json:"to,omitzero"`
Cc Nullable[StringList] `json:"cc,omitzero"`
Bcc Nullable[StringList] `json:"bcc,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
// ThreadID: The thread to reply in. Send with reply_to_email_id.
ThreadID *string `json:"thread_id,omitzero"`
// ReplyToEmailID: The message to reply to. Send with thread_id.
ReplyToEmailID *string `json:"reply_to_email_id,omitzero"`
}
type CreateInboxLabelParams ¶
type CreateInboxParams ¶
type CreateInboxParams struct {
// EmailAddress: A plain address on one of your domains, such as support@example.com
EmailAddress string `json:"email_address"`
// Name: Internal name. Defaults to email_address.
Name *string `json:"name,omitzero"`
// FromName: The name recipients see. A plain name, not a Name <email> address.
FromName *string `json:"from_name,omitzero"`
// Forwarding: Not available: must be false or omitted. Inboxes receive through your domain's MX record.
Forwarding *bool `json:"forwarding,omitzero"`
}
type CreateLinkDomainRequest ¶
type CreateLinkDomainRequest struct {
// Hostname: A subdomain of one of your verified sending domains. One link domain per sending domain.
Hostname string `json:"hostname"`
}
type CreateSegmentRequest ¶
type CreateSignupFormRequest ¶
type CreateSignupFormRequest struct {
Name string `json:"name"`
// Fields: email is always included.
Fields []string `json:"fields,omitzero"`
ButtonText *string `json:"button_text,omitzero"`
ButtonColor *string `json:"button_color,omitzero"`
SuccessMessage *string `json:"success_message,omitzero"`
DoubleOptIn *bool `json:"double_opt_in,omitzero"`
// RedirectURL: Must start with http:// or https://.
RedirectURL Nullable[string] `json:"redirect_url,omitzero"`
// CaptchaEnabled: Needs turnstile_site_key and turnstile_secret_key.
CaptchaEnabled *bool `json:"captcha_enabled,omitzero"`
CaptchaProvider *string `json:"captcha_provider,omitzero"`
TurnstileSiteKey Nullable[string] `json:"turnstile_site_key,omitzero"`
// TurnstileSecretKey: Write-only. Returned forms expose turnstile_secret_configured instead.
TurnstileSecretKey Nullable[string] `json:"turnstile_secret_key,omitzero"`
BlockDisposableEmails *bool `json:"block_disposable_emails,omitzero"`
Active *bool `json:"active,omitzero"`
// ConfirmationEmailFrom: Sender of the double opt-in confirmation email. The platform address is used when this is unset or its domain is not verified.
ConfirmationEmailFrom Nullable[string] `json:"confirmation_email_from,omitzero"`
// WelcomeEmailEnabled: Send a welcome email to each new contact from this form.
WelcomeEmailEnabled *bool `json:"welcome_email_enabled,omitzero"`
// WelcomeEmailFrom: Sender of the welcome email. Its domain must be verified, or the welcome email is skipped.
WelcomeEmailFrom Nullable[string] `json:"welcome_email_from,omitzero"`
WelcomeEmailSubject Nullable[string] `json:"welcome_email_subject,omitzero"`
// WelcomeEmailMarkdown: Welcome email body as Markdown.
WelcomeEmailMarkdown Nullable[string] `json:"welcome_email_markdown,omitzero"`
}
CreateSignupFormRequest: Keys are snake_case, as in the form object. The older camelCase spelling of each key (buttonText, doubleOptIn, welcomeEmailEnabled and so on) is still
type CreateSuppressionRequest ¶
type CreateSuppressionRequest struct {
Email string `json:"email"`
Reason *string `json:"reason,omitzero"`
// Scope: all blocks every send to the address. marketing blocks marketing email only, like a recipient's own unsubscribe. An address already on the list keeps
Scope *string `json:"scope,omitzero"`
// DiagnosticCode: Optional internal note for manual suppressions
DiagnosticCode *string `json:"diagnostic_code,omitzero"`
}
type CreateTeamInviteParams ¶
type CreateTemplateRequest ¶
type CreateTemplateRequest struct {
Name string `json:"name"`
// Alias: A second handle, unique in the team, that works wherever the id does.
Alias Nullable[string] `json:"alias,omitzero"`
// From: Default sender, e.g. "Acme <orders@acme.com>". A send can override it.
From Nullable[string] `json:"from,omitzero"`
// Subject: Default subject. Can use variables. A send can override it.
Subject Nullable[string] `json:"subject,omitzero"`
// ReplyTo: Default Reply-To address or addresses. A send can override it.
ReplyTo Nullable[StringList] `json:"reply_to,omitzero"`
// HTML: The HTML body. Variables are written {{{KEY}}}, optionally with an inline fallback: {{{KEY|default}}}.
HTML *string `json:"html,omitzero"`
// Text: Plain-text body. When left out, the text part is generated from the HTML at send time. Exactly "" stops that, as in Resend; the email then carries an
Text Nullable[string] `json:"text,omitzero"`
// Markdown: Not in Resend. A Markdown body, rendered into SMTPfast's email layout. Used when html is empty.
Markdown Nullable[string] `json:"markdown,omitzero"`
// PreviewText: Not in Resend. The inbox preview line, put into the email as a hidden first line.
PreviewText Nullable[string] `json:"preview_text,omitzero"`
// Category: Not in Resend. A label for grouping templates in the dashboard.
Category Nullable[string] `json:"category,omitzero"`
Variables []TemplateVariable `json:"variables,omitzero"`
}
CreateTemplateRequest: Requires html, or markdown (an SMTPfast addition).
type CreateWebhookRequest ¶
type CreateWebhookRequest struct {
// URL: The URL that will receive webhook POST requests
URL string `json:"url"`
// Events: List of event types to subscribe to. Legacy unprefixed email aliases are accepted and normalized to Resend-style email.* event names.
Events []string `json:"events"`
// Format: Payload format. standard is the signed JSON envelope; discord and slack post readable messages to a chat webhook URL. Detected from the URL when left
Format *string `json:"format,omitzero"`
}
type DNSRecord ¶
type DNSRecord struct {
Type string `json:"type"`
Name string `json:"name"`
Value string `json:"value"`
Ttl *string `json:"ttl,omitzero"`
// Priority: Set for MX records
Priority Nullable[int64] `json:"priority,omitzero"`
// Status: The verification status that covers this record
Status *string `json:"status,omitzero"`
// Purpose: DKIM authentication, SPF authorization, DMARC policy, MAIL FROM bounce delivery, MAIL FROM SPF or Inbound mail
Purpose *string `json:"purpose,omitzero"`
Category *string `json:"category,omitzero"`
// ActualValue: GET /v1/domains/{id} only: what DNS answers now, several values joined with " | "
ActualValue Nullable[string] `json:"actual_value,omitzero"`
// LiveCheck: GET /v1/domains/{id} only: how the live value compares with the expected one. Null for the inbound MX record.
LiveCheck Nullable[string] `json:"live_check,omitzero"`
// ActualValue_: Same as actual_value, for older clients
ActualValue_ Nullable[string] `json:"actualValue,omitzero"`
// LiveCheck_: Same as live_check, for older clients
LiveCheck_ Nullable[string] `json:"liveCheck,omitzero"`
}
type DeleteContactsParams ¶
type DeleteInboxResponse ¶
type DeletedObject ¶
type Domain ¶
type Domain struct {
ID string `json:"id"`
Domain string `json:"domain"`
// Name: Same as domain. Resend calls this field name.
Name *string `json:"name,omitzero"`
// Status: GET /v1/domains/{id} answers pending for a verified domain whose required records are no longer live.
Status string `json:"status"`
// Receiving: Inbound email for the domain
Receiving *DomainReceiving `json:"receiving,omitzero"`
VerificationPhase *string `json:"verification_phase,omitzero"`
VerificationMessage *string `json:"verification_message,omitzero"`
// NextAutoCheckAt: Null once the domain is verified
NextAutoCheckAt Nullable[string] `json:"next_auto_check_at,omitzero"`
DKIMStatus *string `json:"dkim_status,omitzero"`
SPFStatus *string `json:"spf_status,omitzero"`
DMARCStatus *string `json:"dmarc_status,omitzero"`
MailFromStatus *string `json:"mail_from_status,omitzero"`
MailFromDomain Nullable[string] `json:"mail_from_domain,omitzero"`
VerifiedAt Nullable[string] `json:"verified_at,omitzero"`
Region *string `json:"region,omitzero"`
// Provider: The DNS provider found from the NS records
Provider *DomainProvider `json:"provider,omitzero"`
// Events: The verification steps and when each was done
Events []DomainEventsItem `json:"events,omitzero"`
DNSRecords []DNSRecord `json:"dns_records"`
CreatedAt string `json:"created_at"`
LastCheckedAt Nullable[string] `json:"last_checked_at,omitzero"`
}
Domain: POST /v1/domains returns id, domain, status, dns_records and created_at. GET /v1/domains/{id} adds the verification detail, a live DNS check of each r
type DomainEventsItem ¶
type DomainListItem ¶
type DomainListItem struct {
ID string `json:"id"`
Domain string `json:"domain"`
// Name: Same as domain. Resend calls this field name.
Name *string `json:"name,omitzero"`
// Status: pending, verifying, verified or failed
Status string `json:"status"`
DKIMStatus string `json:"dkim_status"`
SPFStatus string `json:"spf_status"`
DMARCStatus string `json:"dmarc_status"`
VerifiedAt *string `json:"verified_at"`
CreatedAt string `json:"created_at"`
ReceivingEnabled bool `json:"receiving_enabled"`
// ReceivingStatus: disabled, pending, active or failed
ReceivingStatus string `json:"receiving_status"`
}
DomainListItem: A domain as the list returns it. GET /v1/domains/{id} has the DNS records and verification detail.
type DomainProvider ¶
type DomainProvider struct {
ID *string `json:"id,omitzero"`
Name *string `json:"name,omitzero"`
Badge *string `json:"badge,omitzero"`
Zone *string `json:"zone,omitzero"`
}
DomainProvider: The DNS provider found from the NS records
type DomainReceiving ¶
type DomainReceiving struct {
Enabled *bool `json:"enabled,omitzero"`
Status *string `json:"status,omitzero"`
MXRecord *DomainReceivingMXRecord `json:"mx_record,omitzero"`
PublishedMX []DomainReceivingPublishedMXItem `json:"published_mx,omitzero"`
CompetingMX []string `json:"competing_mx,omitzero"`
}
type DomainReceivingMXRecord ¶
type DomainsService ¶
type DomainsService struct {
// contains filtered or unexported fields
}
DomainsService groups the domains operations.
func (*DomainsService) Claim ¶
func (s *DomainsService) Claim(ctx context.Context, params *ClaimDomainParams, opts ...RequestOption) (*ClaimDomainResponse, error)
Claim: Claim a domain held by another account (POST /v1/domains/claim).
func (*DomainsService) ConnectCloudflare ¶
func (s *DomainsService) ConnectCloudflare(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
ConnectCloudflare: Set up sending DNS on Cloudflare in one click (POST /v1/domains/{id}/domain-connect/cloudflare).
func (*DomainsService) ConnectCloudflareInbound ¶
func (s *DomainsService) ConnectCloudflareInbound(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
ConnectCloudflareInbound: Set up receiving DNS on Cloudflare in one click (POST /v1/domains/{id}/domain-connect/cloudflare-inbound).
func (*DomainsService) Create ¶
func (s *DomainsService) Create(ctx context.Context, params *AddDomainRequest, opts ...RequestOption) (*Domain, error)
Create: Add a domain (POST /v1/domains).
func (*DomainsService) Delete ¶
func (s *DomainsService) Delete(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
Delete: Delete a domain (DELETE /v1/domains/{id}).
func (*DomainsService) Get ¶
func (s *DomainsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Domain, error)
Get: Get domain details (GET /v1/domains/{id}).
func (*DomainsService) GetClaimRecord ¶
func (s *DomainsService) GetClaimRecord(ctx context.Context, query *GetDomainClaimRecordQuery, opts ...RequestOption) (*GetDomainClaimRecordResponse, error)
GetClaimRecord: Get the claim record for a domain (GET /v1/domains/claim).
func (*DomainsService) List ¶
func (s *DomainsService) List(ctx context.Context, opts ...RequestOption) (*ListDomainsResponse, error)
List: List domains (GET /v1/domains).
func (*DomainsService) Update ¶
func (s *DomainsService) Update(ctx context.Context, id string, params *UpdateDomainReceivingParams, opts ...RequestOption) (*UpdateDomainReceivingResponse, error)
Update: Turn inbound receiving on or off (PATCH /v1/domains/{id}).
func (*DomainsService) Verify ¶
func (s *DomainsService) Verify(ctx context.Context, id string, opts ...RequestOption) (*VerifyDomainResponse, error)
Verify: Verify a domain (POST /v1/domains/{id}/verify).
type DuplicateBroadcastResponse ¶
type DuplicateBroadcastResponse struct {
Broadcast Broadcast `json:"broadcast"`
}
type Email ¶
type Email struct {
ID string `json:"id"`
// From: As sent, so it can include a display name: Name <hello@yourapp.com>
From string `json:"from"`
To []string `json:"to"`
Cc []string `json:"cc"`
Bcc []string `json:"bcc"`
Subject string `json:"subject"`
// HTML: The stored body. For an API send the {{unsubscribe_url}} placeholder is filled in when the email goes out, so it appears here unreplaced; broadcast an
HTML *string `json:"html"`
// Text: The stored plain-text body, null when there was none or the retention window removed it.
Text *string `json:"text"`
CreatedAt string `json:"created_at"`
// LastEvent: The type of the newest event, or the status when the email has no events yet. Resend-compatible.
LastEvent string `json:"last_event"`
// BodyClearedAt: When the retention window removed html and text. Null while the body is kept, so null html and text with a timestamp here means the content is no long
BodyClearedAt *string `json:"body_cleared_at"`
// Source: api, smtp, dashboard, broadcast or broadcast_test
Source string `json:"source"`
// Category: Decides which suppressions apply and whether the List-Unsubscribe header went out. marketing unless the email was labelled transactional; broadcasts,
Category string `json:"category"`
Status string `json:"status"`
// ReplyTo: The Reply-To address the email was sent with, or null.
ReplyTo *string `json:"reply_to"`
// Tags: The tags given at send time, as name/value pairs. Empty when none were given.
Tags []EmailTagsItem `json:"tags"`
// MessageID: The RFC 5322 Message-ID on your sending domain, the one a recipient's server and bounce reports quote. Null until the email is sent.
MessageID *string `json:"message_id"`
// SesMessageID: The Amazon SES message id. Kept for older integrations; correlate with message_id.
SesMessageID *string `json:"ses_message_id"`
SentAt *string `json:"sent_at"`
DeliveredAt *string `json:"delivered_at"`
OpenedAt *string `json:"opened_at"`
ClickedAt *string `json:"clicked_at"`
BouncedAt *string `json:"bounced_at"`
// UnsubscribedAt: When the recipient unsubscribed through this email. status keeps its delivery value.
UnsubscribedAt *string `json:"unsubscribed_at"`
ErrorMessage *string `json:"error_message"`
// Events: Every event of the email, oldest first.
Events []EmailEventsItem `json:"events"`
}
type EmailEventsItem ¶
type EmailEventsItem struct {
// Type: queued, scheduled, sending, retrying, sent, delivered, delivery_delayed, bounced, complained, opened, clicked, failed, suppressed or unsubscribed
Type string `json:"type"`
// Metadata: Event details such as the bounce type or the clicked URL
Metadata map[string]any `json:"metadata"`
Timestamp string `json:"timestamp"`
}
type EmailList ¶
type EmailList struct {
Object string `json:"object"`
Data []EmailSummary `json:"data"`
// Page: Absent when paging with after or before
Page *int64 `json:"page,omitzero"`
Limit int64 `json:"limit"`
// Total: Emails matching the filters; with after or before, only those past that email
Total int64 `json:"total"`
HasMore bool `json:"has_more"`
}
type EmailSummary ¶
type EmailSummary struct {
ID string `json:"id"`
From string `json:"from"`
To []string `json:"to"`
Subject string `json:"subject"`
// Status: queued, scheduled, sending, sent, delivered, opened, clicked, bounced, complained, failed or canceled
Status string `json:"status"`
// Source: api, smtp, dashboard, broadcast or broadcast_test
Source string `json:"source"`
Category string `json:"category"`
CreatedAt string `json:"created_at"`
SentAt *string `json:"sent_at"`
DeliveredAt *string `json:"delivered_at"`
OpenedAt *string `json:"opened_at"`
ClickedAt *string `json:"clicked_at"`
BouncedAt *string `json:"bounced_at"`
ErrorMessage *string `json:"error_message"`
}
type EmailTagsItem ¶
type EmailsReceivingAttachmentsService ¶
type EmailsReceivingAttachmentsService struct {
// contains filtered or unexported fields
}
EmailsReceivingAttachmentsService groups the emails.receiving.attachments operations.
func (*EmailsReceivingAttachmentsService) Get ¶
func (s *EmailsReceivingAttachmentsService) Get(ctx context.Context, id string, attachmentID string, opts ...RequestOption) (*ReceivedAttachment, error)
Get: Get one attachment of a received email (GET /v1/emails/receiving/{id}/attachments/{attachment_id}).
func (*EmailsReceivingAttachmentsService) List ¶
func (s *EmailsReceivingAttachmentsService) List(ctx context.Context, id string, opts ...RequestOption) (*ListReceivedEmailAttachmentsResponse, error)
List: List attachments of a received email (GET /v1/emails/receiving/{id}/attachments).
type EmailsReceivingService ¶
type EmailsReceivingService struct {
Attachments *EmailsReceivingAttachmentsService
// contains filtered or unexported fields
}
EmailsReceivingService groups the emails.receiving operations.
func (*EmailsReceivingService) Delete ¶
func (s *EmailsReceivingService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeleteReceivedEmailResponse, error)
Delete: Delete a received email (DELETE /v1/emails/receiving/{id}).
func (*EmailsReceivingService) Get ¶
func (s *EmailsReceivingService) Get(ctx context.Context, id string, opts ...RequestOption) (*ReceivedEmail, error)
Get: Get a received email (GET /v1/emails/receiving/{id}).
func (*EmailsReceivingService) List ¶
func (s *EmailsReceivingService) List(ctx context.Context, query *ListReceivedEmailsQuery, opts ...RequestOption) (*ListReceivedEmailsResponse, error)
List: List received emails (GET /v1/emails/receiving).
func (*EmailsReceivingService) ListAll ¶
func (s *EmailsReceivingService) ListAll(ctx context.Context, query *ListReceivedEmailsQuery, opts ...RequestOption) iter.Seq2[ReceivedEmailSummary, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*EmailsReceivingService) Mark ¶
func (s *EmailsReceivingService) Mark(ctx context.Context, params *MarkReceivedEmailsParams, opts ...RequestOption) (*MarkReceivedEmailsResponse, error)
Mark: Mark received emails read or unread (PATCH /v1/emails/receiving).
func (*EmailsReceivingService) Reply ¶
func (s *EmailsReceivingService) Reply(ctx context.Context, id string, params *ReplyToReceivedEmailParams, opts ...RequestOption) (*ReplyToReceivedEmailResponse, error)
Reply: Reply to a received email (POST /v1/emails/receiving/{id}/reply).
func (*EmailsReceivingService) Update ¶
func (s *EmailsReceivingService) Update(ctx context.Context, id string, params *UpdateReceivedEmailParams, opts ...RequestOption) (*UpdateReceivedEmailResponse, error)
Update: Mark a received email read or unread (PATCH /v1/emails/receiving/{id}).
type EmailsService ¶
type EmailsService struct {
Receiving *EmailsReceivingService
// contains filtered or unexported fields
}
EmailsService groups the emails operations.
func (*EmailsService) Cancel ¶
func (s *EmailsService) Cancel(ctx context.Context, id string, opts ...RequestOption) (*CancelEmailResponse, error)
Cancel: Cancel a scheduled email (POST /v1/emails/{id}/cancel).
func (*EmailsService) Get ¶
func (s *EmailsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Email, error)
Get: Get email details (GET /v1/emails/{id}).
func (*EmailsService) GetMetrics ¶
func (s *EmailsService) GetMetrics(ctx context.Context, query *GetEmailMetricsQuery, opts ...RequestOption) (*GetEmailMetricsResponse, error)
GetMetrics: Retrieve email metrics (GET /v1/emails/metrics).
func (*EmailsService) List ¶
func (s *EmailsService) List(ctx context.Context, query *ListEmailsQuery, opts ...RequestOption) (*EmailList, error)
List: List sent emails (GET /v1/emails).
func (*EmailsService) ListAll ¶
func (s *EmailsService) ListAll(ctx context.Context, query *ListEmailsQuery, opts ...RequestOption) iter.Seq2[EmailSummary, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*EmailsService) ListClickedLinks ¶
func (s *EmailsService) ListClickedLinks(ctx context.Context, query *ListClickedLinksQuery, opts ...RequestOption) (map[string]any, error)
ListClickedLinks: List clicked links (GET /v1/emails/clicked-links).
func (*EmailsService) Send ¶
func (s *EmailsService) Send(ctx context.Context, params *SendEmailRequest, opts ...RequestOption) (*SendEmailResponse, error)
Send: Send an email (POST /v1/emails).
func (*EmailsService) SendBatch ¶
func (s *EmailsService) SendBatch(ctx context.Context, params []SendEmailRequest, opts ...RequestOption) (*BatchSendResponse, error)
SendBatch: Send a batch of emails (POST /v1/emails/batch).
func (*EmailsService) Share ¶
func (s *EmailsService) Share(ctx context.Context, id string, params *ShareEmailParams, opts ...RequestOption) (*ShareEmailResponse, error)
Share: Create a share link for a sent email (POST /v1/emails/{id}/share).
func (*EmailsService) Update ¶
func (s *EmailsService) Update(ctx context.Context, id string, params *UpdateEmailParams, opts ...RequestOption) (*UpdateEmailResponse, error)
Update: Reschedule a scheduled email (PATCH /v1/emails/{id}).
type Error ¶
type Error struct {
// Error: A human-readable error message
Error string `json:"error"`
}
type ExportContactsQuery ¶
type FormsPendingService ¶
type FormsPendingService struct {
// contains filtered or unexported fields
}
FormsPendingService groups the forms.pending operations.
func (*FormsPendingService) Approve ¶
func (s *FormsPendingService) Approve(ctx context.Context, id string, pendingID string, opts ...RequestOption) (*ApprovePendingSignupResponse, error)
Approve: Approve a pending signup (POST /v1/forms/{id}/pending/{pendingId}/approve).
func (*FormsPendingService) ApproveAll ¶
func (s *FormsPendingService) ApproveAll(ctx context.Context, id string, params *ApproveAllPendingSignupsParams, opts ...RequestOption) (*ApproveAllPendingSignupsResponse, error)
ApproveAll: Approve all pending signups (POST /v1/forms/{id}/pending/approve-all).
func (*FormsPendingService) List ¶
func (s *FormsPendingService) List(ctx context.Context, id string, query *ListPendingSignupsQuery, opts ...RequestOption) (*PendingSignupList, error)
List: List pending signups (GET /v1/forms/{id}/pending).
func (*FormsPendingService) Remove ¶
func (s *FormsPendingService) Remove(ctx context.Context, id string, pendingID string, opts ...RequestOption) (*RemovePendingSignupResponse, error)
Remove: Remove a pending signup (DELETE /v1/forms/{id}/pending/{pendingId}).
type FormsService ¶
type FormsService struct {
Pending *FormsPendingService
// contains filtered or unexported fields
}
FormsService groups the forms operations.
func (*FormsService) Create ¶
func (s *FormsService) Create(ctx context.Context, params *CreateSignupFormRequest, opts ...RequestOption) (*SignupForm, error)
Create: Create a signup form (POST /v1/forms).
func (*FormsService) Delete ¶
func (s *FormsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*SignupFormDeleted, error)
Delete: Delete a signup form (DELETE /v1/forms/{id}).
func (*FormsService) Get ¶
func (s *FormsService) Get(ctx context.Context, id string, opts ...RequestOption) (*SignupForm, error)
Get: Retrieve a signup form (GET /v1/forms/{id}).
func (*FormsService) List ¶
func (s *FormsService) List(ctx context.Context, opts ...RequestOption) (*SignupFormList, error)
List: List signup forms (GET /v1/forms).
func (*FormsService) PreviewWelcomeEmail ¶
func (s *FormsService) PreviewWelcomeEmail(ctx context.Context, id string, params *PreviewFormWelcomeEmailParams, opts ...RequestOption) (map[string]any, error)
PreviewWelcomeEmail: Preview a form's welcome email (POST /v1/forms/{id}/welcome-preview).
func (*FormsService) Update ¶
func (s *FormsService) Update(ctx context.Context, id string, params *UpdateSignupFormRequest, opts ...RequestOption) (*SignupForm, error)
Update: Update a signup form (PATCH /v1/forms/{id}).
type ForwardInboxThreadEmailParams ¶
type ForwardInboxThreadEmailParams struct {
To StringList `json:"to"`
Cc StringList `json:"cc,omitzero"`
Bcc StringList `json:"bcc,omitzero"`
HTML *string `json:"html,omitzero"`
Text *string `json:"text,omitzero"`
Subject *string `json:"subject,omitzero"`
}
type GetAnalyticsQuery ¶
type GetBroadcastAudienceQuery ¶
type GetBroadcastAudienceQuery struct {
SegmentID *string `json:"segment_id,omitzero"`
}
type GetCapabilitiesResponse ¶
type GetCapabilitiesResponse struct {
APIKeyID string `json:"api_key_id"`
// UserID: The user who created the key. Matches user_id on GET /v1/team/members.
UserID string `json:"user_id"`
Scopes []string `json:"scopes"`
TeamID *string `json:"team_id"`
TeamSendingStatus *string `json:"team_sending_status"`
Account GetCapabilitiesResponseAccount `json:"account"`
// SendChecks: Which send-time safety checks apply to this account.
SendChecks GetCapabilitiesResponseSendChecks `json:"send_checks"`
RateLimit GetCapabilitiesResponseRateLimit `json:"rate_limit"`
}
type GetCapabilitiesResponseSendChecks ¶
type GetCapabilitiesResponseSendChecks struct {
DisplayNameEnforced *bool `json:"display_name_enforced,omitzero"`
LinkScanEnforced *bool `json:"link_scan_enforced,omitzero"`
}
GetCapabilitiesResponseSendChecks: Which send-time safety checks apply to this account.
type GetContactPropertyResponse ¶
type GetContactPropertyResponse struct {
ContactProperty ContactProperty `json:"contact_property"`
}
type GetDomainClaimRecordQuery ¶
type GetDomainClaimRecordQuery struct {
Domain *string `json:"domain,omitzero"`
}
type GetDomainClaimRecordResponse ¶
type GetDomainClaimRecordResponse struct {
Domain *string `json:"domain,omitzero"`
Record *GetDomainClaimRecordResponseRecord `json:"record,omitzero"`
}
type GetEmailMetricsQuery ¶
type GetEmailMetricsQuery struct {
StartDate *string `json:"start_date,omitzero"`
EndDate *string `json:"end_date,omitzero"`
Timezone *string `json:"timezone,omitzero"`
Granularity *string `json:"granularity,omitzero"`
Metrics *string `json:"metrics,omitzero"`
Dimensions *string `json:"dimensions,omitzero"`
DomainID *string `json:"domain_id,omitzero"`
EmailID *string `json:"email_id,omitzero"`
BroadcastID *string `json:"broadcast_id,omitzero"`
}
type GetEmailMetricsResponse ¶
type GetEmailMetricsResponse struct {
Object string `json:"object"`
StartDate string `json:"start_date"`
EndDate string `json:"end_date"`
Timezone string `json:"timezone"`
Metrics []string `json:"metrics"`
Dimensions []string `json:"dimensions"`
Granularity string `json:"granularity"`
// Totals: One value per requested metric: counts are integers, rates percentages with one decimal.
Totals map[string]float64 `json:"totals"`
// Data: One row per combination of the requested dimensions, with the requested metrics. Absent when no dimensions are requested.
Data []GetEmailMetricsResponseDataItem `json:"data,omitzero"`
}
type GetEmailMetricsResponseDataItem ¶
type GetEmailMetricsResponseDataItem struct {
// Period: With the period dimension
Period Nullable[string] `json:"period,omitzero"`
// DomainID: With the domain dimension
DomainID Nullable[string] `json:"domain_id,omitzero"`
// DomainName: With the domain dimension
DomainName Nullable[string] `json:"domain_name,omitzero"`
// EmailID: With the email dimension
EmailID Nullable[string] `json:"email_id,omitzero"`
// BroadcastID: With the broadcast dimension
BroadcastID Nullable[string] `json:"broadcast_id,omitzero"`
// BroadcastName: With the broadcast dimension
BroadcastName Nullable[string] `json:"broadcast_name,omitzero"`
}
type GetWebhookDeliveryResponse ¶
type GetWebhookDeliveryResponse struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
WebhookID *string `json:"webhook_id,omitzero"`
Event *string `json:"event,omitzero"`
Status *string `json:"status,omitzero"`
Attempts *int64 `json:"attempts,omitzero"`
MaxAttempts *int64 `json:"max_attempts,omitzero"`
StatusCode Nullable[int64] `json:"status_code,omitzero"`
DurationMs Nullable[int64] `json:"duration_ms,omitzero"`
Error Nullable[string] `json:"error,omitzero"`
// Response: First 500 characters of the last response body
Response Nullable[string] `json:"response,omitzero"`
AttemptLog []GetWebhookDeliveryResponseAttemptLogItem `json:"attempt_log,omitzero"`
NextAttemptAt Nullable[string] `json:"next_attempt_at,omitzero"`
DeliveredAt Nullable[string] `json:"delivered_at,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
// Payload: The JSON body as sent
Payload *string `json:"payload,omitzero"`
}
type Inbox ¶
type Inbox struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
Name *string `json:"name,omitzero"`
EmailAddress *string `json:"email_address,omitzero"`
DomainID *string `json:"domain_id,omitzero"`
// ReceivingAddress: Always null: SMTPfast inboxes receive through your own MX record, never a forwarding address.
ReceivingAddress Nullable[any] `json:"receiving_address,omitzero"`
FromName Nullable[string] `json:"from_name,omitzero"`
// Unread: Threads in the inbox folder with at least one unread message
Unread *int64 `json:"unread,omitzero"`
// Drafts: Unsent drafts
Drafts *int64 `json:"drafts,omitzero"`
// LastReceived: When a thread in this inbox was last active
LastReceived Nullable[string] `json:"last_received,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
}
type InboxDraft ¶
type InboxDraft struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
Type *string `json:"type,omitzero"`
To Nullable[[]string] `json:"to,omitzero"`
Cc []string `json:"cc,omitzero"`
Bcc []string `json:"bcc,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
ThreadID Nullable[string] `json:"thread_id,omitzero"`
ReplyToEmailID Nullable[string] `json:"reply_to_email_id,omitzero"`
// EmailID: The queued email once sent
EmailID Nullable[string] `json:"email_id,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
// CreatedVia: Who wrote the draft. Not in Resend.
CreatedVia *string `json:"created_via,omitzero"`
// SentAt: Not in Resend
SentAt Nullable[string] `json:"sent_at,omitzero"`
// Revision: Goes up with every edit. Pass it to send or update to act only on this version. Not in Resend.
Revision *int64 `json:"revision,omitzero"`
// ThreadSubject: The subject of the thread a reply draft answers. Not in Resend.
ThreadSubject Nullable[string] `json:"thread_subject,omitzero"`
}
type InboxDraftListItem ¶
type InboxDraftListItem struct {
ID *string `json:"id,omitzero"`
Type *string `json:"type,omitzero"`
To Nullable[[]string] `json:"to,omitzero"`
Cc []string `json:"cc,omitzero"`
Bcc []string `json:"bcc,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
Snippet Nullable[string] `json:"snippet,omitzero"`
ThreadID Nullable[string] `json:"thread_id,omitzero"`
ReplyToEmailID Nullable[string] `json:"reply_to_email_id,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
// CreatedVia: Not in Resend
CreatedVia *string `json:"created_via,omitzero"`
// CreatedAt: Not in Resend
CreatedAt *string `json:"created_at,omitzero"`
// Revision: Not in Resend
Revision *int64 `json:"revision,omitzero"`
// ThreadSubject: Not in Resend
ThreadSubject Nullable[string] `json:"thread_subject,omitzero"`
}
type InboxLabel ¶
type InboxLabelRef ¶
type InboxListItem ¶
type InboxListItem struct {
ID *string `json:"id,omitzero"`
Name Nullable[string] `json:"name,omitzero"`
EmailAddress *string `json:"email_address,omitzero"`
FromName Nullable[string] `json:"from_name,omitzero"`
Unread *int64 `json:"unread,omitzero"`
LastReceived Nullable[string] `json:"last_received,omitzero"`
// DomainID: Not in Resend's list item
DomainID *string `json:"domain_id,omitzero"`
// Drafts: Not in Resend's list item
Drafts *int64 `json:"drafts,omitzero"`
// CreatedAt: Not in Resend's list item
CreatedAt *string `json:"created_at,omitzero"`
}
type InboxSentEmail ¶
type InboxSentEmail struct {
// ID: For a received message, also its id under /v1/emails/receiving
ID *string `json:"id,omitzero"`
Direction *string `json:"direction,omitzero"`
From *string `json:"from,omitzero"`
To []string `json:"to,omitzero"`
Cc []string `json:"cc,omitzero"`
Bcc []string `json:"bcc,omitzero"`
ReplyTo []string `json:"reply_to,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
MessageID Nullable[string] `json:"message_id,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Attachments []InboxSentEmailAttachmentsItem `json:"attachments,omitzero"`
Read *bool `json:"read,omitzero"`
ReceivedAt *string `json:"received_at,omitzero"`
// Status: delivered or quarantined for a received message, the send status for a sent one. Not in Resend.
Status *string `json:"status,omitzero"`
// Verdicts: SES authentication and scan verdicts of a received message (null for sent ones). Not in Resend.
Verdicts Nullable[InboxSentEmailVerdicts] `json:"verdicts,omitzero"`
// InReplyTo: Not in Resend
InReplyTo Nullable[string] `json:"in_reply_to,omitzero"`
// EmailID: Same as id; the email in GET /v1/emails/{id}
EmailID *string `json:"email_id,omitzero"`
// ThreadID: Not in Resend
ThreadID *string `json:"thread_id,omitzero"`
}
type InboxSentEmailVerdicts ¶
type InboxSentEmailVerdicts struct {
SPF Nullable[string] `json:"spf,omitzero"`
DKIM Nullable[string] `json:"dkim,omitzero"`
DMARC Nullable[string] `json:"dmarc,omitzero"`
Spam Nullable[string] `json:"spam,omitzero"`
Virus Nullable[string] `json:"virus,omitzero"`
}
InboxSentEmailVerdicts: SES authentication and scan verdicts of a received message (null for sent ones). Not in Resend.
type InboxThread ¶
type InboxThread struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
Folder *string `json:"folder,omitzero"`
Labels []InboxLabelRef `json:"labels,omitzero"`
// Read: True only when every message in the thread is read
Read *bool `json:"read,omitzero"`
// ReceivedAt: When the thread was last active. Not in Resend's thread object.
ReceivedAt *string `json:"received_at,omitzero"`
// DeleteAfter: When a thread in trash is removed. Not in Resend.
DeleteAfter Nullable[string] `json:"delete_after,omitzero"`
}
type InboxThreadEmail ¶
type InboxThreadEmail struct {
// ID: For a received message, also its id under /v1/emails/receiving
ID *string `json:"id,omitzero"`
Direction *string `json:"direction,omitzero"`
From *string `json:"from,omitzero"`
To []string `json:"to,omitzero"`
Cc []string `json:"cc,omitzero"`
Bcc []string `json:"bcc,omitzero"`
ReplyTo []string `json:"reply_to,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
MessageID Nullable[string] `json:"message_id,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Attachments []InboxThreadEmailAttachmentsItem `json:"attachments,omitzero"`
Read *bool `json:"read,omitzero"`
ReceivedAt *string `json:"received_at,omitzero"`
// Status: delivered or quarantined for a received message, the send status for a sent one. Not in Resend.
Status *string `json:"status,omitzero"`
// Verdicts: SES authentication and scan verdicts of a received message (null for sent ones). Not in Resend.
Verdicts Nullable[InboxThreadEmailVerdicts] `json:"verdicts,omitzero"`
// InReplyTo: Not in Resend
InReplyTo Nullable[string] `json:"in_reply_to,omitzero"`
}
type InboxThreadEmailVerdicts ¶
type InboxThreadEmailVerdicts struct {
SPF Nullable[string] `json:"spf,omitzero"`
DKIM Nullable[string] `json:"dkim,omitzero"`
DMARC Nullable[string] `json:"dmarc,omitzero"`
Spam Nullable[string] `json:"spam,omitzero"`
Virus Nullable[string] `json:"virus,omitzero"`
}
InboxThreadEmailVerdicts: SES authentication and scan verdicts of a received message (null for sent ones). Not in Resend.
type InboxThreadListItem ¶
type InboxThreadListItem struct {
ID *string `json:"id,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
// From: Sender of the most recent message
From Nullable[string] `json:"from,omitzero"`
To []string `json:"to,omitzero"`
Cc []string `json:"cc,omitzero"`
Bcc []string `json:"bcc,omitzero"`
Labels []InboxLabelRef `json:"labels,omitzero"`
MessageCount *int64 `json:"message_count,omitzero"`
HasAttachment *bool `json:"has_attachment,omitzero"`
HasDraft *bool `json:"has_draft,omitzero"`
Read *bool `json:"read,omitzero"`
ReceivedAt *string `json:"received_at,omitzero"`
// Folder: Not in Resend's list item
Folder *string `json:"folder,omitzero"`
// UnreadCount: Unread messages in the thread. Not in Resend.
UnreadCount *int64 `json:"unread_count,omitzero"`
// Snippet: A preview of the most recent message. Not in Resend.
Snippet Nullable[string] `json:"snippet,omitzero"`
}
type InboxesDraftsService ¶
type InboxesDraftsService struct {
// contains filtered or unexported fields
}
InboxesDraftsService groups the inboxes.drafts operations.
func (*InboxesDraftsService) Create ¶
func (s *InboxesDraftsService) Create(ctx context.Context, inboxID string, params *CreateInboxDraftParams, opts ...RequestOption) (*InboxDraft, error)
Create: Create a draft (POST /v1/inboxes/{inbox_id}/drafts).
func (*InboxesDraftsService) Delete ¶
func (s *InboxesDraftsService) Delete(ctx context.Context, inboxID string, draftID string, opts ...RequestOption) (*DeleteInboxDraftResponse, error)
Delete: Delete a draft (DELETE /v1/inboxes/{inbox_id}/drafts/{draft_id}).
func (*InboxesDraftsService) Get ¶
func (s *InboxesDraftsService) Get(ctx context.Context, inboxID string, draftID string, opts ...RequestOption) (*InboxDraft, error)
Get: Retrieve a draft (GET /v1/inboxes/{inbox_id}/drafts/{draft_id}).
func (*InboxesDraftsService) List ¶
func (s *InboxesDraftsService) List(ctx context.Context, inboxID string, query *ListInboxDraftsQuery, opts ...RequestOption) (*ListInboxDraftsResponse, error)
List: List drafts (GET /v1/inboxes/{inbox_id}/drafts).
func (*InboxesDraftsService) ListAll ¶
func (s *InboxesDraftsService) ListAll(ctx context.Context, inboxID string, query *ListInboxDraftsQuery, opts ...RequestOption) iter.Seq2[InboxDraftListItem, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*InboxesDraftsService) Send ¶
func (s *InboxesDraftsService) Send(ctx context.Context, inboxID string, draftID string, params *SendInboxDraftParams, opts ...RequestOption) (*SendInboxDraftResponse, error)
Send: Send a draft (POST /v1/inboxes/{inbox_id}/drafts/{draft_id}/send).
func (*InboxesDraftsService) Update ¶
func (s *InboxesDraftsService) Update(ctx context.Context, inboxID string, draftID string, params *UpdateInboxDraftParams, opts ...RequestOption) (*InboxDraft, error)
Update: Update a draft (PATCH /v1/inboxes/{inbox_id}/drafts/{draft_id}).
type InboxesLabelsService ¶
type InboxesLabelsService struct {
// contains filtered or unexported fields
}
InboxesLabelsService groups the inboxes.labels operations.
func (*InboxesLabelsService) Create ¶
func (s *InboxesLabelsService) Create(ctx context.Context, inboxID string, params *CreateInboxLabelParams, opts ...RequestOption) (*InboxLabel, error)
Create: Create a label (POST /v1/inboxes/{inbox_id}/labels).
func (*InboxesLabelsService) Delete ¶
func (s *InboxesLabelsService) Delete(ctx context.Context, inboxID string, labelID string, opts ...RequestOption) (*DeleteInboxLabelResponse, error)
Delete: Delete a label (DELETE /v1/inboxes/{inbox_id}/labels/{label_id}).
func (*InboxesLabelsService) Get ¶
func (s *InboxesLabelsService) Get(ctx context.Context, inboxID string, labelID string, opts ...RequestOption) (*InboxLabel, error)
Get: Retrieve a label (GET /v1/inboxes/{inbox_id}/labels/{label_id}).
func (*InboxesLabelsService) List ¶
func (s *InboxesLabelsService) List(ctx context.Context, inboxID string, opts ...RequestOption) (*ListInboxLabelsResponse, error)
List: List labels (GET /v1/inboxes/{inbox_id}/labels).
func (*InboxesLabelsService) Update ¶
func (s *InboxesLabelsService) Update(ctx context.Context, inboxID string, labelID string, params *UpdateInboxLabelParams, opts ...RequestOption) (*UpdateInboxLabelResponse, error)
Update: Update a label (PATCH /v1/inboxes/{inbox_id}/labels/{label_id}).
type InboxesService ¶
type InboxesService struct {
Threads *InboxesThreadsService
Labels *InboxesLabelsService
Drafts *InboxesDraftsService
// contains filtered or unexported fields
}
InboxesService groups the inboxes operations.
func (*InboxesService) Create ¶
func (s *InboxesService) Create(ctx context.Context, params *CreateInboxParams, opts ...RequestOption) (*Inbox, error)
Create: Create an inbox (POST /v1/inboxes).
func (*InboxesService) Delete ¶
func (s *InboxesService) Delete(ctx context.Context, inboxID string, opts ...RequestOption) (*DeleteInboxResponse, error)
Delete: Delete an inbox (DELETE /v1/inboxes/{inbox_id}).
func (*InboxesService) Get ¶
func (s *InboxesService) Get(ctx context.Context, inboxID string, opts ...RequestOption) (*Inbox, error)
Get: Retrieve an inbox (GET /v1/inboxes/{inbox_id}).
func (*InboxesService) List ¶
func (s *InboxesService) List(ctx context.Context, query *ListInboxesQuery, opts ...RequestOption) (*ListInboxesResponse, error)
List: List inboxes (GET /v1/inboxes).
func (*InboxesService) ListAll ¶
func (s *InboxesService) ListAll(ctx context.Context, query *ListInboxesQuery, opts ...RequestOption) iter.Seq2[InboxListItem, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*InboxesService) Update ¶
func (s *InboxesService) Update(ctx context.Context, inboxID string, params *UpdateInboxParams, opts ...RequestOption) (*UpdateInboxResponse, error)
Update: Update an inbox (PATCH /v1/inboxes/{inbox_id}).
type InboxesThreadsEmailsService ¶
type InboxesThreadsEmailsService struct {
// contains filtered or unexported fields
}
InboxesThreadsEmailsService groups the inboxes.threads.emails operations.
func (*InboxesThreadsEmailsService) Forward ¶
func (s *InboxesThreadsEmailsService) Forward(ctx context.Context, inboxID string, threadID string, emailID string, params *ForwardInboxThreadEmailParams, opts ...RequestOption) (*InboxSentEmail, error)
Forward: Forward a thread email (POST /v1/inboxes/{inbox_id}/threads/{thread_id}/emails/{email_id}/forward).
func (*InboxesThreadsEmailsService) Get ¶
func (s *InboxesThreadsEmailsService) Get(ctx context.Context, inboxID string, threadID string, emailID string, opts ...RequestOption) (*InboxThreadEmail, error)
Get: Retrieve a thread email (GET /v1/inboxes/{inbox_id}/threads/{thread_id}/emails/{email_id}).
func (*InboxesThreadsEmailsService) List ¶
func (s *InboxesThreadsEmailsService) List(ctx context.Context, inboxID string, threadID string, query *ListInboxThreadEmailsQuery, opts ...RequestOption) (*ListInboxThreadEmailsResponse, error)
List: List thread emails (GET /v1/inboxes/{inbox_id}/threads/{thread_id}/emails).
func (*InboxesThreadsEmailsService) ListAll ¶
func (s *InboxesThreadsEmailsService) ListAll(ctx context.Context, inboxID string, threadID string, query *ListInboxThreadEmailsQuery, opts ...RequestOption) iter.Seq2[InboxThreadEmail, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*InboxesThreadsEmailsService) Reply ¶
func (s *InboxesThreadsEmailsService) Reply(ctx context.Context, inboxID string, threadID string, emailID string, params *ReplyToInboxThreadEmailParams, opts ...RequestOption) (*InboxSentEmail, error)
Reply: Reply to a thread email (POST /v1/inboxes/{inbox_id}/threads/{thread_id}/emails/{email_id}/reply).
type InboxesThreadsService ¶
type InboxesThreadsService struct {
Emails *InboxesThreadsEmailsService
// contains filtered or unexported fields
}
InboxesThreadsService groups the inboxes.threads operations.
func (*InboxesThreadsService) Delete ¶
func (s *InboxesThreadsService) Delete(ctx context.Context, inboxID string, threadID string, opts ...RequestOption) (*DeleteInboxThreadResponse, error)
Delete: Delete a thread (DELETE /v1/inboxes/{inbox_id}/threads/{thread_id}).
func (*InboxesThreadsService) Get ¶
func (s *InboxesThreadsService) Get(ctx context.Context, inboxID string, threadID string, opts ...RequestOption) (*InboxThread, error)
Get: Retrieve a thread (GET /v1/inboxes/{inbox_id}/threads/{thread_id}).
func (*InboxesThreadsService) List ¶
func (s *InboxesThreadsService) List(ctx context.Context, inboxID string, query *ListInboxThreadsQuery, opts ...RequestOption) (*ListInboxThreadsResponse, error)
List: List threads (GET /v1/inboxes/{inbox_id}/threads).
func (*InboxesThreadsService) ListAll ¶
func (s *InboxesThreadsService) ListAll(ctx context.Context, inboxID string, query *ListInboxThreadsQuery, opts ...RequestOption) iter.Seq2[InboxThreadListItem, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*InboxesThreadsService) Update ¶
func (s *InboxesThreadsService) Update(ctx context.Context, inboxID string, threadID string, params *UpdateInboxThreadParams, opts ...RequestOption) (*InboxThread, error)
Update: Update a thread (PATCH /v1/inboxes/{inbox_id}/threads/{thread_id}).
type LinkDomain ¶
type LinkDomain struct {
Object string `json:"object"`
ID string `json:"id"`
Hostname string `json:"hostname"`
// DomainID: The sending domain the hostname sits under.
DomainID *string `json:"domain_id"`
Domain *string `json:"domain"`
// Status: pending until Cloudflare sees the CNAME record and issues the certificate, then active. failed means it will not become active without a change on you
Status string `json:"status"`
// SslStatus: The certificate status Cloudflare reports, for troubleshooting.
SslStatus *string `json:"ssl_status"`
// LastError: Why the link domain is not active yet, when Cloudflare says.
LastError *string `json:"last_error"`
DNSRecords []LinkDomainDNSRecord `json:"dns_records"`
// VerifiedAt: When it first became active.
VerifiedAt *string `json:"verified_at"`
LastCheckedAt *string `json:"last_checked_at"`
CreatedAt string `json:"created_at"`
}
LinkDomain: A custom hostname for open tracking, click tracking and unsubscribe links. While it is active, email whose From address is on the same registrable dom
type LinkDomainConnectCheck ¶
type LinkDomainConnectCheck struct {
// Available: Whether the DNS provider can add the CNAME record in one click through Domain Connect.
Available bool `json:"available"`
// Provider: The DNS provider, when discovery found one.
Provider *string `json:"provider"`
// Reason: Why one-click setup is not available, when it is not.
Reason *string `json:"reason"`
}
type LinkDomainConnectLink ¶
type LinkDomainDNSRecord ¶
type LinkDomainDNSRecord struct {
Type string `json:"type"`
Name string `json:"name"`
Value string `json:"value"`
Ttl string `json:"ttl"`
Purpose string `json:"purpose"`
// Required: The CNAME is required. A TXT record Cloudflare offers is optional: it lets the hostname activate before the CNAME is live.
Required bool `json:"required"`
// Status: pending while the link domain is not active. Once it is active the CNAME is verified (keep it: certificate renewals need it) and a TXT record is not_n
Status string `json:"status"`
}
type LinkDomainDeleted ¶
type LinkDomainError ¶
type LinkDomainList ¶
type LinkDomainList struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []LinkDomain `json:"data"`
// Available: Whether custom link domains are available on this server. When false, creating one answers 503.
Available bool `json:"available"`
// IncludedInPlan: Whether the team's plan includes custom link domains (every paid plan). When false, creating one answers 403 and mail uses smtpfa.st links, also throu
IncludedInPlan bool `json:"included_in_plan"`
}
type LinkDomainsService ¶
type LinkDomainsService struct {
// contains filtered or unexported fields
}
LinkDomainsService groups the linkDomains operations.
func (*LinkDomainsService) Create ¶
func (s *LinkDomainsService) Create(ctx context.Context, params *CreateLinkDomainRequest, opts ...RequestOption) (*LinkDomain, error)
Create: Add a link domain (POST /v1/link-domains).
func (*LinkDomainsService) Delete ¶
func (s *LinkDomainsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*LinkDomainDeleted, error)
Delete: Delete a link domain (DELETE /v1/link-domains/{id}).
func (*LinkDomainsService) Get ¶
func (s *LinkDomainsService) Get(ctx context.Context, id string, opts ...RequestOption) (*LinkDomain, error)
Get: Get a link domain (GET /v1/link-domains/{id}).
func (*LinkDomainsService) GetDomainConnect ¶
func (s *LinkDomainsService) GetDomainConnect(ctx context.Context, id string, opts ...RequestOption) (*LinkDomainConnectCheck, error)
GetDomainConnect: Check one-click DNS setup for a link domain (GET /v1/link-domains/{id}/domain-connect).
func (*LinkDomainsService) List ¶
func (s *LinkDomainsService) List(ctx context.Context, opts ...RequestOption) (*LinkDomainList, error)
List: List link domains (GET /v1/link-domains).
func (*LinkDomainsService) Refresh ¶
func (s *LinkDomainsService) Refresh(ctx context.Context, id string, opts ...RequestOption) (*LinkDomain, error)
Refresh: Refresh a link domain's status (POST /v1/link-domains/{id}/refresh).
func (*LinkDomainsService) StartDomainConnect ¶
func (s *LinkDomainsService) StartDomainConnect(ctx context.Context, id string, opts ...RequestOption) (*LinkDomainConnectLink, error)
StartDomainConnect: Set up a link domain's DNS in one click (POST /v1/link-domains/{id}/domain-connect).
type ListAPIKeysResponse ¶
type ListBroadcastClickedLinksResponse ¶
type ListBroadcastClickedLinksResponse struct {
BroadcastID string `json:"broadcast_id"`
Links []ListBroadcastClickedLinksResponseLinksItem `json:"links"`
TotalClicks int64 `json:"total_clicks"`
}
type ListBroadcastsQuery ¶
type ListClickedLinksQuery ¶
type ListContactPropertiesResponse ¶
type ListContactPropertiesResponse struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []ContactProperty `json:"data"`
}
type ListContactsQuery ¶
type ListDomainsResponse ¶
type ListDomainsResponse struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []DomainListItem `json:"data"`
}
type ListEmailsQuery ¶
type ListInboxDraftsQuery ¶
type ListInboxDraftsResponse ¶
type ListInboxDraftsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []InboxDraftListItem `json:"data,omitzero"`
}
type ListInboxLabelsResponse ¶
type ListInboxLabelsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []InboxLabel `json:"data,omitzero"`
}
type ListInboxThreadEmailsResponse ¶
type ListInboxThreadEmailsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []InboxThreadEmail `json:"data,omitzero"`
}
type ListInboxThreadsQuery ¶
type ListInboxThreadsResponse ¶
type ListInboxThreadsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []InboxThreadListItem `json:"data,omitzero"`
}
type ListInboxesQuery ¶
type ListInboxesResponse ¶
type ListInboxesResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []InboxListItem `json:"data,omitzero"`
}
type ListLogsQuery ¶
type ListLogsQuery struct {
Limit *int64 `json:"limit,omitzero"`
After *string `json:"after,omitzero"`
Before *string `json:"before,omitzero"`
Type *string `json:"type,omitzero"`
Since *string `json:"since,omitzero"`
Until *string `json:"until,omitzero"`
Recipient *string `json:"recipient,omitzero"`
Domain *string `json:"domain,omitzero"`
DomainID *string `json:"domain_id,omitzero"`
Tag *string `json:"tag,omitzero"`
EmailID *string `json:"email_id,omitzero"`
}
type ListLogsResponse ¶
type ListPendingSignupsQuery ¶
type ListReceivedEmailAttachmentsResponse ¶
type ListReceivedEmailAttachmentsResponse struct {
Object *string `json:"object,omitzero"`
Data []ReceivedAttachment `json:"data,omitzero"`
}
type ListReceivedEmailsQuery ¶
type ListReceivedEmailsResponse ¶
type ListReceivedEmailsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []ReceivedEmailSummary `json:"data,omitzero"`
// UnreadCount: Unread emails matching the same to, domain_id and q filters (not in Resend)
UnreadCount *int64 `json:"unread_count,omitzero"`
}
type ListSuppressionsQuery ¶
type ListTeamInvitesResponse ¶
type ListTeamInvitesResponse struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []TeamInvite `json:"data"`
}
type ListTeamMembersResponse ¶
type ListTeamMembersResponse struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []TeamMember `json:"data"`
}
type ListTemplatesQuery ¶
type ListWebhookDeliveriesResponse ¶
type ListWebhookDeliveriesResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []WebhookDelivery `json:"data,omitzero"`
}
type ListWebhookEventAttemptsResponse ¶
type ListWebhookEventAttemptsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []ListWebhookEventAttemptsResponseDataItem `json:"data,omitzero"`
}
type ListWebhookEventAttemptsResponseDataItem ¶
type ListWebhookEventAttemptsResponseDataItem struct {
ID *string `json:"id,omitzero"`
HTTPStatusCode Nullable[int64] `json:"http_status_code,omitzero"`
Response Nullable[string] `json:"response,omitzero"`
SentAt Nullable[string] `json:"sent_at,omitzero"`
DurationMs Nullable[int64] `json:"duration_ms,omitzero"`
}
type ListWebhookEventsQuery ¶
type ListWebhookEventsResponse ¶
type ListWebhookEventsResponse struct {
Object *string `json:"object,omitzero"`
HasMore *bool `json:"has_more,omitzero"`
Data []WebhookEventSummary `json:"data,omitzero"`
}
type ListWebhooksResponse ¶
type LogEvent ¶
type LogEvent struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
Type *string `json:"type,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
EmailID *string `json:"email_id,omitzero"`
From *string `json:"from,omitzero"`
To []string `json:"to,omitzero"`
Subject *string `json:"subject,omitzero"`
DomainID Nullable[string] `json:"domain_id,omitzero"`
Tags []LogEventTagsItem `json:"tags,omitzero"`
// Data: Event details: bounce type, clicked URL, error message, and similar
Data map[string]any `json:"data,omitzero"`
}
type LogEventTagsItem ¶
type LogsService ¶
type LogsService struct {
// contains filtered or unexported fields
}
LogsService groups the logs operations.
func (*LogsService) List ¶
func (s *LogsService) List(ctx context.Context, query *ListLogsQuery, opts ...RequestOption) (*ListLogsResponse, error)
List: List email events (GET /v1/logs).
func (*LogsService) ListAll ¶
func (s *LogsService) ListAll(ctx context.Context, query *ListLogsQuery, opts ...RequestOption) iter.Seq2[LogEvent, error]
ListAll iterates over every item of List, fetching the following pages as needed.
type Nullable ¶
type Nullable[T any] struct { Value T // Valid is false for null. Valid bool // Set is false when the field is left out (or was absent in a response). Set bool }
Nullable is a field that can be left out, set to null, or set to a value. A request leaves it out by default; Null clears the field, Value sets it.
func (Nullable[T]) MarshalJSON ¶
MarshalJSON writes null or the value.
func (*Nullable[T]) UnmarshalJSON ¶
UnmarshalJSON reads null or a value.
type Option ¶
type Option func(*core)
Option configures a Client.
func WithAPIKey ¶
WithAPIKey sets the API key. The default is the SMTPFAST_API_KEY environment variable.
func WithBaseURL ¶
WithBaseURL sets the API base URL. The default is https://smtpfa.st/api.
func WithHTTPClient ¶
WithHTTPClient sets the http.Client used for requests.
func WithMaxRetries ¶
WithMaxRetries sets how many times a failed request is retried. The default is 2.
func WithTimeout ¶
WithTimeout sets the time limit for each attempt. The default is 60 seconds.
type PendingSignup ¶
type PendingSignup struct {
ID string `json:"id"`
Email string `json:"email"`
FirstName *string `json:"first_name"`
LastName *string `json:"last_name"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
// Country: Two-letter country code, or T1 when the signup came through Tor. The IP address is not stored.
Country *string `json:"country"`
// SourceURL: The page the form was submitted on: address plus utm_* parameters only.
SourceURL *string `json:"source_url"`
// ConfirmationEmail: The confirmation email and its current status. Null when no email was queued for this signup, or for signups recorded before this was tracked.
ConfirmationEmail *PendingSignupConfirmationEmail `json:"confirmation_email"`
}
type PendingSignupConfirmationEmail ¶
type PendingSignupConfirmationEmail struct {
ID *string `json:"id,omitzero"`
Status *string `json:"status,omitzero"`
}
PendingSignupConfirmationEmail: The confirmation email and its current status. Null when no email was queued for this signup, or for signups recorded before this was tracked.
type PendingSignupList ¶
type PendingSignupList struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []PendingSignup `json:"data"`
Total int64 `json:"total"`
// UndeliverableTotal: How many of the matching signups have an undeliverable confirmation email. Approve all leaves these out.
UndeliverableTotal int64 `json:"undeliverable_total"`
// TorTotal: How many of the matching signups were submitted through Tor. Approve all leaves these out.
TorTotal int64 `json:"tor_total"`
// ApprovableTotal: How many of the matching signups Approve all would confirm.
ApprovableTotal int64 `json:"approvable_total"`
Page int64 `json:"page"`
PerPage int64 `json:"per_page"`
}
type PreviewFormWelcomeEmailParams ¶
type PreviewFormWelcomeEmailParams struct {
Subject *string `json:"subject,omitzero"`
Markdown *string `json:"markdown,omitzero"`
Sample *PreviewFormWelcomeEmailParamsSample `json:"sample,omitzero"`
}
type PublishTemplateParams ¶
type PublishTemplateParams struct {
// ExpectedUpdatedAt: Not in Resend. The updated_at you loaded.
ExpectedUpdatedAt *string `json:"expected_updated_at,omitzero"`
}
type ReceivedAttachment ¶
type ReceivedAttachment struct {
ID *string `json:"id,omitzero"`
Filename *string `json:"filename,omitzero"`
ContentType *string `json:"content_type,omitzero"`
ContentDisposition *string `json:"content_disposition,omitzero"`
ContentID Nullable[string] `json:"content_id,omitzero"`
Size *int64 `json:"size,omitzero"`
// DownloadURL: Present on the attachment endpoints; valid for 15 minutes
DownloadURL *string `json:"download_url,omitzero"`
ExpiresAt *string `json:"expires_at,omitzero"`
}
type ReceivedEmail ¶
type ReceivedEmail struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
To []string `json:"to,omitzero"`
From *string `json:"from,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
Subject *string `json:"subject,omitzero"`
Bcc []string `json:"bcc,omitzero"`
Cc []string `json:"cc,omitzero"`
ReplyTo []string `json:"reply_to,omitzero"`
ReceivedFor []string `json:"received_for,omitzero"`
MessageID *string `json:"message_id,omitzero"`
Attachments []ReceivedAttachment `json:"attachments,omitzero"`
Status *string `json:"status,omitzero"`
EnvelopeFrom Nullable[string] `json:"envelope_from,omitzero"`
EnvelopeTo []string `json:"envelope_to,omitzero"`
DomainID Nullable[string] `json:"domain_id,omitzero"`
Size Nullable[int64] `json:"size,omitzero"`
Verdicts *ReceivedEmailVerdicts `json:"verdicts,omitzero"`
InReplyTo Nullable[string] `json:"in_reply_to,omitzero"`
References []string `json:"references,omitzero"`
// ReadAt: When the message was marked read. Not in Resend.
ReadAt Nullable[string] `json:"read_at,omitzero"`
// InboxID: The inbox this copy was filed into, when its address has one. Not in Resend.
InboxID Nullable[string] `json:"inbox_id,omitzero"`
// ThreadID: The inbox thread this copy was filed into. Not in Resend.
ThreadID Nullable[string] `json:"thread_id,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
Raw Nullable[ReceivedEmailRaw] `json:"raw,omitzero"`
}
type ReceivedEmailRaw ¶
type ReceivedEmailSummary ¶
type ReceivedEmailSummary struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
To []string `json:"to,omitzero"`
From *string `json:"from,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
Subject *string `json:"subject,omitzero"`
Bcc []string `json:"bcc,omitzero"`
Cc []string `json:"cc,omitzero"`
ReplyTo []string `json:"reply_to,omitzero"`
ReceivedFor []string `json:"received_for,omitzero"`
MessageID *string `json:"message_id,omitzero"`
Attachments []ReceivedAttachment `json:"attachments,omitzero"`
Status *string `json:"status,omitzero"`
EnvelopeFrom Nullable[string] `json:"envelope_from,omitzero"`
EnvelopeTo []string `json:"envelope_to,omitzero"`
DomainID Nullable[string] `json:"domain_id,omitzero"`
Size Nullable[int64] `json:"size,omitzero"`
Verdicts *ReceivedEmailSummaryVerdicts `json:"verdicts,omitzero"`
InReplyTo Nullable[string] `json:"in_reply_to,omitzero"`
References []string `json:"references,omitzero"`
// ReadAt: When the message was marked read. Not in Resend.
ReadAt Nullable[string] `json:"read_at,omitzero"`
// InboxID: The inbox this copy was filed into, when its address has one. Not in Resend.
InboxID Nullable[string] `json:"inbox_id,omitzero"`
// ThreadID: The inbox thread this copy was filed into. Not in Resend.
ThreadID Nullable[string] `json:"thread_id,omitzero"`
}
type ReceivedEmailVerdicts ¶
type RemovePendingSignupResponse ¶
type RemovePendingSignupResponse struct {
Deleted bool `json:"deleted"`
}
type ReplyToInboxThreadEmailParams ¶
type ReplyToInboxThreadEmailParams struct {
Cc StringList `json:"cc,omitzero"`
Bcc StringList `json:"bcc,omitzero"`
HTML *string `json:"html,omitzero"`
Text *string `json:"text,omitzero"`
Subject *string `json:"subject,omitzero"`
}
type ReplyToReceivedEmailParams ¶
type ReplyToReceivedEmailParams struct {
// From: One of the team's reply addresses for this message; see the dashboard detail's reply_from
From *string `json:"from,omitzero"`
To StringList `json:"to,omitzero"`
Cc StringList `json:"cc,omitzero"`
// Subject: Defaults to Re: plus the original subject
Subject *string `json:"subject,omitzero"`
Text *string `json:"text,omitzero"`
HTML *string `json:"html,omitzero"`
}
type ReplyToReceivedEmailResponse ¶
type ReplyToReceivedEmailResponse struct {
ID *string `json:"id,omitzero"`
}
type RequestOption ¶
type RequestOption func(*requestSettings)
RequestOption changes one call.
func WithHeader ¶
func WithHeader(key, value string) RequestOption
WithHeader adds a header to one call.
func WithIdempotencyKey ¶
func WithIdempotencyKey(key string) RequestOption
WithIdempotencyKey sets the Idempotency-Key of a send, reply or forward. A retry with the same key and body returns the first answer instead of sending again. Without it, the SDK makes one per call when retries are on.
func WithRequestMaxRetries ¶
func WithRequestMaxRetries(n int) RequestOption
WithRequestMaxRetries overrides the client's retry count for one call.
func WithRequestTimeout ¶
func WithRequestTimeout(d time.Duration) RequestOption
WithRequestTimeout overrides the client's per-attempt timeout for one call.
type RetryWebhookDeliveryResponse ¶
type RetryWebhookDeliveryResponse struct {
Success *bool `json:"success,omitzero"`
Message *string `json:"message,omitzero"`
Delivery *WebhookDelivery `json:"delivery,omitzero"`
}
type RevokeAPIKeyResponse ¶
type Segment ¶
type Segment struct {
ID string `json:"id"`
Name string `json:"name"`
Description Nullable[string] `json:"description,omitzero"`
Color Nullable[string] `json:"color,omitzero"`
ContactCount *int64 `json:"contact_count,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
Object *string `json:"object,omitzero"`
}
type SegmentContactList ¶
type SegmentContactList struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []ContactListItem `json:"data"`
Segment SegmentContactListSegment `json:"segment"`
Page int64 `json:"page"`
PageSize int64 `json:"page_size"`
// Total: Contacts in the segment
Total int64 `json:"total"`
}
type SegmentList ¶
type SegmentSummary ¶
type SegmentSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Description Nullable[string] `json:"description,omitzero"`
Color Nullable[string] `json:"color,omitzero"`
ContactCount *int64 `json:"contact_count,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
}
type SegmentsContactsService ¶
type SegmentsContactsService struct {
// contains filtered or unexported fields
}
SegmentsContactsService groups the segments.contacts operations.
func (*SegmentsContactsService) List ¶
func (s *SegmentsContactsService) List(ctx context.Context, id string, query *ListSegmentContactsQuery, opts ...RequestOption) (*SegmentContactList, error)
List: List contacts in a segment (GET /v1/segments/{id}/contacts).
type SegmentsService ¶
type SegmentsService struct {
Contacts *SegmentsContactsService
// contains filtered or unexported fields
}
SegmentsService groups the segments operations.
func (*SegmentsService) Create ¶
func (s *SegmentsService) Create(ctx context.Context, params *CreateSegmentRequest, opts ...RequestOption) (*Segment, error)
Create: Create a segment (POST /v1/segments).
func (*SegmentsService) Delete ¶
func (s *SegmentsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*DeletedObject, error)
Delete: Delete a segment (DELETE /v1/segments/{id}).
func (*SegmentsService) Get ¶
func (s *SegmentsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Segment, error)
Get: Retrieve a segment (GET /v1/segments/{id}).
func (*SegmentsService) List ¶
func (s *SegmentsService) List(ctx context.Context, opts ...RequestOption) (*SegmentList, error)
List: List segments (GET /v1/segments).
func (*SegmentsService) Update ¶
func (s *SegmentsService) Update(ctx context.Context, id string, params *UpdateSegmentRequest, opts ...RequestOption) (*Segment, error)
Update: Update a segment (PATCH /v1/segments/{id}).
type SendBroadcastParams ¶
type SendBroadcastParams struct {
ScheduledAt *string `json:"scheduled_at,omitzero"`
// SendOverMinutes: Not in Resend. Spread the send evenly over this many minutes from the send time (or scheduled_at): recipient i of N goes out at start + i * window / N
SendOverMinutes *int64 `json:"send_over_minutes,omitzero"`
}
type SendBroadcastTestParams ¶
type SendBroadcastTestParams struct {
To string `json:"to"`
}
type SendEmailRequest ¶
type SendEmailRequest struct {
// Template: Send a published template instead of html and text, as in Resend. The published version is rendered with the variables, then every normal send rule ap
Template *SendEmailRequestTemplate `json:"template,omitzero"`
// Attachments: Up to 10 files, base64 encoded, 25 MB per message in total. A content_id makes the part inline: reference it from the HTML as cid:<content_id>.
Attachments []SendEmailRequestAttachmentsItem `json:"attachments,omitzero"`
// From: Sender email address (must belong to a verified domain)
From *string `json:"from,omitzero"`
// To: One recipient address, or a list of them
To StringList `json:"to"`
// Cc: Cc recipients
Cc StringList `json:"cc,omitzero"`
// Bcc: Bcc recipients
Bcc StringList `json:"bcc,omitzero"`
// ReplyTo: Reply-To address or addresses
ReplyTo StringList `json:"reply_to,omitzero"`
// Subject: Email subject line
Subject *string `json:"subject,omitzero"`
// Tags: Up to 50 name/value pairs, returned on events and webhooks and filterable in logs
Tags []SendEmailRequestTagsItem `json:"tags,omitzero"`
// Headers: Custom headers, e.g. X-Entity-Ref-ID
Headers map[string]string `json:"headers,omitzero"`
// ScheduledAt: Send later, up to 30 days ahead (ISO 8601)
ScheduledAt *string `json:"scheduled_at,omitzero"`
// Category: Defaults to marketing. Label receipts, password resets and other transactional mail transactional so a marketing opt-out does not block them; unlabell
Category *string `json:"category,omitzero"`
// TrackClicks: Not in Resend, which sets tracking per domain. Rewrite this email's links through the click tracker (true) or send them exactly as written (false). Le
TrackClicks *bool `json:"track_clicks,omitzero"`
// TrackOpens: Not in Resend. Add the open-tracking pixel to this email (true) or not (false). Left out, the account's tracking settings apply. Over SMTP, set the X-
TrackOpens *bool `json:"track_opens,omitzero"`
// HTML: HTML body of the email. Include `{{unsubscribe_url}}` (or the Resend-compatible `{{{RESEND_UNSUBSCRIBE_URL}}}`) anywhere in the body and SMTPfast subs
HTML *string `json:"html,omitzero"`
// Text: Plain text fallback body. Supports the same `{{unsubscribe_url}}` placeholder as the HTML body.
Text *string `json:"text,omitzero"`
}
SendEmailRequest: from and subject are required, unless a template supplies them. Give a body as html and/or text, or name a published template; not both.
type SendEmailRequestAttachmentsItem ¶
type SendEmailRequestAttachmentsItem struct {
Filename string `json:"filename"`
// Content: Base64-encoded file content
Content string `json:"content"`
ContentType *string `json:"content_type,omitzero"`
// ContentID: Letters, digits, . _ - with an optional @domain; sent inline as multipart/related
ContentID *string `json:"content_id,omitzero"`
// Inline: Send inline even without a content_id (a Content-ID is derived from the filename)
Inline *bool `json:"inline,omitzero"`
}
type SendEmailRequestTemplate ¶
type SendEmailRequestTemplate struct {
// ID: The template id or alias.
ID string `json:"id"`
// Variables: Values by variable key. A missing value uses the inline fallback ({{{KEY|default}}}), then the variable's fallback_value. A declared variable with nei
Variables map[string]any `json:"variables,omitzero"`
}
SendEmailRequestTemplate: Send a published template instead of html and text, as in Resend. The published version is rendered with the variables, then every normal send rule ap
type SendEmailResponse ¶
type SendEmailResponse struct {
ID string `json:"id"`
}
SendEmailResponse: The id of the accepted email, as Resend returns it. Fetch the email with GET /v1/emails/{id}.
type SendInboxDraftParams ¶
type SendInboxDraftParams struct {
// Revision: Send only if the draft is still at this revision, the one that was reviewed. Not in Resend.
Revision *int64 `json:"revision,omitzero"`
}
type SendInboxDraftResponse ¶
type SendInboxDraftResponse struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
ThreadID *string `json:"thread_id,omitzero"`
EmailID *string `json:"email_id,omitzero"`
// SentRevision: Present with warning: the revision that went out. Not in Resend.
SentRevision *int64 `json:"sent_revision,omitzero"`
// Warning: Present when the email went out but the draft changed or was claimed again while the send ran, so it was not marked sent. Not in Resend.
Warning *string `json:"warning,omitzero"`
}
type Service ¶
type Service struct {
Logs *LogsService
Emails *EmailsService
Inboxes *InboxesService
ContactProperties *ContactPropertiesService
Contacts *ContactsService
Segments *SegmentsService
Account *AccountService
Team *TeamService
Suppressions *SuppressionsService
Broadcasts *BroadcastsService
Templates *TemplatesService
Domains *DomainsService
APIKeys *APIKeysService
Webhooks *WebhooksService
Forms *FormsService
LinkDomains *LinkDomainsService
Analytics *AnalyticsService
// contains filtered or unexported fields
}
Service groups the top-level operations.
type ShareEmailParams ¶
type ShareEmailParams struct {
ExpiresIn *int64 `json:"expires_in,omitzero"`
}
type ShareEmailResponse ¶
type ShareEmailResponse struct {
}
type SignupForm ¶
type SignupForm struct {
Object string `json:"object"`
ID string `json:"id"`
Name string `json:"name"`
Fields []string `json:"fields"`
ButtonText string `json:"button_text"`
ButtonColor string `json:"button_color"`
SuccessMessage string `json:"success_message"`
DoubleOptIn bool `json:"double_opt_in"`
RedirectURL Nullable[string] `json:"redirect_url,omitzero"`
CaptchaEnabled bool `json:"captcha_enabled"`
CaptchaProvider string `json:"captcha_provider"`
TurnstileSiteKey Nullable[string] `json:"turnstile_site_key,omitzero"`
TurnstileSecretConfigured bool `json:"turnstile_secret_configured"`
BlockDisposableEmails bool `json:"block_disposable_emails"`
Active bool `json:"active"`
// ConfirmationEmailFrom: Sender of the double opt-in confirmation email. Create, retrieve and update return it; list items leave it out.
ConfirmationEmailFrom Nullable[string] `json:"confirmation_email_from,omitzero"`
// WelcomeEmailEnabled: Create, retrieve and update return it; list items leave it out.
WelcomeEmailEnabled *bool `json:"welcome_email_enabled,omitzero"`
// WelcomeEmailFrom: Create, retrieve and update return it; list items leave it out.
WelcomeEmailFrom Nullable[string] `json:"welcome_email_from,omitzero"`
// WelcomeEmailSubject: Create, retrieve and update return it; list items leave it out.
WelcomeEmailSubject Nullable[string] `json:"welcome_email_subject,omitzero"`
// WelcomeEmailMarkdown: Create, retrieve and update return it; list items leave it out.
WelcomeEmailMarkdown Nullable[string] `json:"welcome_email_markdown,omitzero"`
// WelcomeStats: Welcome emails sent and skipped for this form, and how many were delivered, opened and clicked. List items leave it out.
WelcomeStats *SignupFormWelcomeStats `json:"welcome_stats,omitzero"`
// PendingConfirmationsCount: Signups waiting on their confirmation click. List items leave it out.
PendingConfirmationsCount *int64 `json:"pending_confirmations_count,omitzero"`
// RecentPendingConfirmations: Up to 5 of the newest pending signups. List items leave it out.
RecentPendingConfirmations []SignupFormRecentPendingConfirmationsItem `json:"recent_pending_confirmations,omitzero"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type SignupFormDeleted ¶
type SignupFormList ¶
type SignupFormList struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []SignupForm `json:"data"`
}
type SignupFormRecentPendingConfirmationsItem ¶
type SignupFormRecentPendingConfirmationsItem struct {
ID *string `json:"id,omitzero"`
Email *string `json:"email,omitzero"`
FirstName Nullable[string] `json:"first_name,omitzero"`
LastName Nullable[string] `json:"last_name,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
ExpiresAt *string `json:"expires_at,omitzero"`
}
type SignupFormWelcomeStats ¶
type SignupFormWelcomeStats struct {
Sent *int64 `json:"sent,omitzero"`
Skipped *int64 `json:"skipped,omitzero"`
Delivered *int64 `json:"delivered,omitzero"`
Opened *int64 `json:"opened,omitzero"`
Clicked *int64 `json:"clicked,omitzero"`
}
SignupFormWelcomeStats: Welcome emails sent and skipped for this form, and how many were delivered, opened and clicked. List items leave it out.
type StringList ¶
type StringList []string
StringList is a list of strings that also reads a single JSON string, for fields such as to and cc that take one address or several.
func (*StringList) UnmarshalJSON ¶
func (l *StringList) UnmarshalJSON(b []byte) error
UnmarshalJSON accepts a string or an array of strings.
type Suppression ¶
type Suppression struct {
Object *string `json:"object,omitzero"`
ID string `json:"id"`
Email string `json:"email"`
Reason string `json:"reason"`
Source string `json:"source"`
// Scope: all: every send to the address is blocked. marketing: only marketing email is blocked, and email labelled transactional still goes out. A recipient's
Scope string `json:"scope"`
BounceType Nullable[string] `json:"bounce_type,omitzero"`
DiagnosticCode Nullable[string] `json:"diagnostic_code,omitzero"`
FeedbackID Nullable[string] `json:"feedback_id,omitzero"`
EmailID Nullable[string] `json:"email_id,omitzero"`
EventID Nullable[string] `json:"event_id,omitzero"`
CreatedAt string `json:"created_at"`
UpdatedAt *string `json:"updated_at,omitzero"`
Metadata map[string]any `json:"metadata,omitzero"`
RelatedEmail Nullable[map[string]any] `json:"related_email,omitzero"`
RelatedEvent Nullable[map[string]any] `json:"related_event,omitzero"`
}
type SuppressionDeleted ¶
type SuppressionDeleted struct {
Object string `json:"object"`
Suppression string `json:"suppression"`
Email string `json:"email"`
Deleted bool `json:"deleted"`
// AccountList: What happened at Amazon SES's account-level suppression list. Hard-bounce and complaint suppressions are released there too (removed, or absent when S
AccountList string `json:"account_list"`
}
type SuppressionList ¶
type SuppressionList struct {
Object string `json:"object"`
HasMore bool `json:"has_more"`
Data []Suppression `json:"data"`
Page *int64 `json:"page,omitzero"`
PageSize *int64 `json:"page_size,omitzero"`
// FilteredTotal: Suppressions matching q and reason
FilteredTotal *int64 `json:"filtered_total,omitzero"`
// Total: Every suppression of the team
Total *int64 `json:"total,omitzero"`
HardBounces *int64 `json:"hard_bounces,omitzero"`
Complaints *int64 `json:"complaints,omitzero"`
Manual *int64 `json:"manual,omitzero"`
}
type SuppressionsService ¶
type SuppressionsService struct {
// contains filtered or unexported fields
}
SuppressionsService groups the suppressions operations.
func (*SuppressionsService) AddBatch ¶
func (s *SuppressionsService) AddBatch(ctx context.Context, params *AddSuppressionsBatchParams, opts ...RequestOption) (map[string]any, error)
AddBatch: Suppress addresses in bulk (POST /v1/suppressions/batch/add).
func (*SuppressionsService) Create ¶
func (s *SuppressionsService) Create(ctx context.Context, params *CreateSuppressionRequest, opts ...RequestOption) (*Suppression, error)
Create: Create a manual suppression (POST /v1/suppressions).
func (*SuppressionsService) Delete ¶
func (s *SuppressionsService) Delete(ctx context.Context, id string, opts ...RequestOption) (*SuppressionDeleted, error)
Delete: Delete a suppression (DELETE /v1/suppressions/{id}).
func (*SuppressionsService) Get ¶
func (s *SuppressionsService) Get(ctx context.Context, id string, opts ...RequestOption) (*Suppression, error)
Get: Retrieve a suppression (GET /v1/suppressions/{id}).
func (*SuppressionsService) List ¶
func (s *SuppressionsService) List(ctx context.Context, query *ListSuppressionsQuery, opts ...RequestOption) (*SuppressionList, error)
List: List suppressions (GET /v1/suppressions).
func (*SuppressionsService) RemoveBatch ¶
func (s *SuppressionsService) RemoveBatch(ctx context.Context, params *RemoveSuppressionsBatchParams, opts ...RequestOption) (map[string]any, error)
RemoveBatch: Remove suppressions in bulk (POST /v1/suppressions/batch/remove).
type TeamInvite ¶
type TeamInvitesService ¶
type TeamInvitesService struct {
// contains filtered or unexported fields
}
TeamInvitesService groups the team.invites operations.
func (*TeamInvitesService) Create ¶
func (s *TeamInvitesService) Create(ctx context.Context, params *CreateTeamInviteParams, opts ...RequestOption) (*TeamInvite, error)
Create: Invite someone to the team (POST /v1/team/invites).
func (*TeamInvitesService) Get ¶
func (s *TeamInvitesService) Get(ctx context.Context, id string, opts ...RequestOption) (*TeamInvite, error)
Get: Retrieve a pending invitation (GET /v1/team/invites/{id}).
func (*TeamInvitesService) List ¶
func (s *TeamInvitesService) List(ctx context.Context, opts ...RequestOption) (*ListTeamInvitesResponse, error)
List: List pending invitations (GET /v1/team/invites).
func (*TeamInvitesService) Revoke ¶
func (s *TeamInvitesService) Revoke(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
Revoke: Revoke an invitation (DELETE /v1/team/invites/{id}).
type TeamMember ¶
type TeamMember struct {
Object string `json:"object"`
// ID: The membership ID
ID string `json:"id"`
UserID string `json:"user_id"`
Email string `json:"email"`
Name Nullable[string] `json:"name,omitzero"`
Role string `json:"role"`
// CanManageBilling: Always true for owners
CanManageBilling bool `json:"can_manage_billing"`
// CreatedAt: When they joined
CreatedAt string `json:"created_at"`
}
type TeamMembersService ¶
type TeamMembersService struct {
// contains filtered or unexported fields
}
TeamMembersService groups the team.members operations.
func (*TeamMembersService) List ¶
func (s *TeamMembersService) List(ctx context.Context, opts ...RequestOption) (*ListTeamMembersResponse, error)
List: List team members (GET /v1/team/members).
func (*TeamMembersService) Remove ¶
func (s *TeamMembersService) Remove(ctx context.Context, id string, opts ...RequestOption) (map[string]any, error)
Remove: Remove a member (DELETE /v1/team/members/{id}).
func (*TeamMembersService) Update ¶
func (s *TeamMembersService) Update(ctx context.Context, id string, params *UpdateTeamMemberParams, opts ...RequestOption) (map[string]any, error)
Update: Change a member's role or billing access (PATCH /v1/team/members/{id}).
type TeamService ¶
type TeamService struct {
Members *TeamMembersService
Invites *TeamInvitesService
// contains filtered or unexported fields
}
TeamService groups the team operations.
type Template ¶
type Template struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
// CurrentVersionID: Id of the published version; null until the first publish.
CurrentVersionID Nullable[string] `json:"current_version_id,omitzero"`
Alias Nullable[string] `json:"alias,omitzero"`
Name *string `json:"name,omitzero"`
Status *string `json:"status,omitzero"`
PublishedAt Nullable[string] `json:"published_at,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
From Nullable[string] `json:"from,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
ReplyTo Nullable[[]string] `json:"reply_to,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
Variables []TemplateVariable `json:"variables,omitzero"`
// HasUnpublishedVersions: The draft differs from the published version. Always true before the first publish.
HasUnpublishedVersions *bool `json:"has_unpublished_versions,omitzero"`
// PreviewText: Not in Resend.
PreviewText Nullable[string] `json:"preview_text,omitzero"`
// Markdown: Not in Resend.
Markdown Nullable[string] `json:"markdown,omitzero"`
// Category: Not in Resend.
Category Nullable[string] `json:"category,omitzero"`
}
type TemplateDeleted ¶
type TemplateError ¶
type TemplateError struct {
StatusCode *int64 `json:"statusCode,omitzero"`
// Name: validation_error, not_found or conflict
Name *string `json:"name,omitzero"`
Message *string `json:"message,omitzero"`
Error *string `json:"error,omitzero"`
}
TemplateError: Resend's error shape, plus error with the same text as message.
type TemplateList ¶
type TemplateList struct {
Object string `json:"object"`
Data []TemplateSummary `json:"data"`
HasMore bool `json:"has_more"`
}
type TemplateRef ¶
type TemplateRef struct {
ID *string `json:"id,omitzero"`
Object *string `json:"object,omitzero"`
// UpdatedAt: Not in Resend. The revision this write created.
UpdatedAt *string `json:"updated_at,omitzero"`
// Status: Not in Resend.
Status *string `json:"status,omitzero"`
// PublishedAt: Not in Resend.
PublishedAt Nullable[string] `json:"published_at,omitzero"`
// HasUnpublishedVersions: Not in Resend.
HasUnpublishedVersions *bool `json:"has_unpublished_versions,omitzero"`
}
TemplateRef: Resend's { id, object }. Create, update and publish also return the fields below (not in Resend): updated_at is the revision that write set, to pass a
type TemplateSummary ¶
type TemplateSummary struct {
ID *string `json:"id,omitzero"`
Name *string `json:"name,omitzero"`
Status *string `json:"status,omitzero"`
PublishedAt Nullable[string] `json:"published_at,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
Alias Nullable[string] `json:"alias,omitzero"`
// Subject: Not in Resend.
Subject Nullable[string] `json:"subject,omitzero"`
// Category: Not in Resend.
Category Nullable[string] `json:"category,omitzero"`
// HasUnpublishedVersions: Not in Resend's list rows.
HasUnpublishedVersions *bool `json:"has_unpublished_versions,omitzero"`
}
type TemplateVariable ¶
type TemplateVariable struct {
ID *string `json:"id,omitzero"`
// Key: Use it in the content as {{{KEY}}}. Letters, digits and underscores. FIRST_NAME, LAST_NAME, EMAIL, UNSUBSCRIBE_URL, RESEND_UNSUBSCRIBE_URL, contact an
Key string `json:"key"`
Type string `json:"type"`
// FallbackValue: Used when a send gives no value. Must match the type. Without one, every send must pass a value for this variable or it answers 422.
FallbackValue Nullable[any] `json:"fallback_value,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
UpdatedAt *string `json:"updated_at,omitzero"`
}
type TemplatesService ¶
type TemplatesService struct {
// contains filtered or unexported fields
}
TemplatesService groups the templates operations.
func (*TemplatesService) Create ¶
func (s *TemplatesService) Create(ctx context.Context, params *CreateTemplateRequest, opts ...RequestOption) (*TemplateRef, error)
Create: Create a template (POST /v1/templates).
func (*TemplatesService) Delete ¶
func (s *TemplatesService) Delete(ctx context.Context, id string, opts ...RequestOption) (*TemplateDeleted, error)
Delete: Delete a template (DELETE /v1/templates/{id}).
func (*TemplatesService) Duplicate ¶
func (s *TemplatesService) Duplicate(ctx context.Context, id string, opts ...RequestOption) (*TemplateRef, error)
Duplicate: Duplicate a template (POST /v1/templates/{id}/duplicate).
func (*TemplatesService) Get ¶
func (s *TemplatesService) Get(ctx context.Context, id string, opts ...RequestOption) (*Template, error)
Get: Get a template (GET /v1/templates/{id}).
func (*TemplatesService) List ¶
func (s *TemplatesService) List(ctx context.Context, query *ListTemplatesQuery, opts ...RequestOption) (*TemplateList, error)
List: List templates (GET /v1/templates).
func (*TemplatesService) ListAll ¶
func (s *TemplatesService) ListAll(ctx context.Context, query *ListTemplatesQuery, opts ...RequestOption) iter.Seq2[TemplateSummary, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*TemplatesService) Publish ¶
func (s *TemplatesService) Publish(ctx context.Context, id string, params *PublishTemplateParams, opts ...RequestOption) (*TemplateRef, error)
Publish: Publish a template (POST /v1/templates/{id}/publish).
func (*TemplatesService) Update ¶
func (s *TemplatesService) Update(ctx context.Context, id string, params *UpdateTemplateRequest, opts ...RequestOption) (*TemplateRef, error)
Update: Update a template (PATCH /v1/templates/{id}).
type TestWebhookResponse ¶
type TestWebhookResponse struct {
// Success: Whether the test payload was delivered successfully
Success *bool `json:"success,omitzero"`
// Status: HTTP status code returned by the webhook endpoint, null when it did not answer
Status Nullable[int64] `json:"status,omitzero"`
Message *string `json:"message,omitzero"`
Delivery *WebhookDelivery `json:"delivery,omitzero"`
}
type UpdateAPIKeyParams ¶
type UpdateAPIKeyResponse ¶
type UpdateBroadcastRequest ¶
type UpdateBroadcastRequest struct {
Name *string `json:"name,omitzero"`
Audience *string `json:"audience,omitzero"`
// SegmentID: Required when audience is segment
SegmentID *string `json:"segment_id,omitzero"`
// AudienceMeta: Details of the audience, such as the segment_id
AudienceMeta map[string]any `json:"audience_meta,omitzero"`
// TemplateID: Not in Resend, and only on create (PATCH ignores it). Start from a template (id or alias): its current content, as the template editor shows it, is co
TemplateID *string `json:"template_id,omitzero"`
From *string `json:"from,omitzero"`
ReplyTo Nullable[string] `json:"reply_to,omitzero"`
Subject *string `json:"subject,omitzero"`
PreviewText Nullable[string] `json:"preview_text,omitzero"`
// Markdown: Markdown body. Must include {{unsubscribe_url}} or {{{RESEND_UNSUBSCRIBE_URL}}} before sending.
Markdown *string `json:"markdown,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
TrackOpens *bool `json:"track_opens,omitzero"`
TrackClicks *bool `json:"track_clicks,omitzero"`
// SendOverMinutes: Not in Resend. Spread the send evenly over this many minutes from the send time (or scheduled_at): recipient i of N goes out at start + i * window / N
SendOverMinutes Nullable[int64] `json:"send_over_minutes,omitzero"`
}
type UpdateContactPropertyParams ¶
type UpdateContactPropertyParams struct {
// FallbackValue: The new fallback; null clears it. key and type cannot change.
FallbackValue any `json:"fallback_value"`
}
type UpdateContactPropertyResponse ¶
type UpdateContactPropertyResponse struct {
ContactProperty ContactProperty `json:"contact_property"`
}
type UpdateContactRequest ¶
type UpdateContactRequest struct {
FirstName *string `json:"firstName,omitzero"`
LastName *string `json:"lastName,omitzero"`
FirstName_ *string `json:"first_name,omitzero"`
LastName_ *string `json:"last_name,omitzero"`
Unsubscribed *bool `json:"unsubscribed,omitzero"`
Properties map[string]any `json:"properties,omitzero"`
// SegmentIDs: Replace this contact's manual segment assignments
SegmentIDs []string `json:"segment_ids,omitzero"`
}
type UpdateDomainReceivingParams ¶
type UpdateDomainReceivingParams struct {
ReceivingEnabled bool `json:"receiving_enabled"`
}
type UpdateDomainReceivingResponse ¶
type UpdateDomainReceivingResponse struct {
ID *string `json:"id,omitzero"`
Receiving *DomainReceiving `json:"receiving,omitzero"`
}
type UpdateEmailParams ¶
type UpdateEmailParams struct {
// ScheduledAt: New send time in ISO 8601. Must be in the future and within 30 days.
ScheduledAt string `json:"scheduled_at"`
}
type UpdateEmailResponse ¶
type UpdateInboxDraftParams ¶
type UpdateInboxDraftParams struct {
To Nullable[StringList] `json:"to,omitzero"`
Cc Nullable[StringList] `json:"cc,omitzero"`
Bcc Nullable[StringList] `json:"bcc,omitzero"`
Subject Nullable[string] `json:"subject,omitzero"`
HTML Nullable[string] `json:"html,omitzero"`
Text Nullable[string] `json:"text,omitzero"`
// Revision: Only write if the draft is still at this revision. Not in Resend.
Revision *int64 `json:"revision,omitzero"`
}
type UpdateInboxLabelParams ¶
type UpdateInboxParams ¶
type UpdateInboxResponse ¶
type UpdateInboxThreadParams ¶
type UpdateInboxThreadParams struct {
Read *bool `json:"read,omitzero"`
Folder *string `json:"folder,omitzero"`
// LabelID: Apply this label of the same inbox
LabelID *string `json:"label_id,omitzero"`
// RemoveLabelID: Remove this label. Not in Resend.
RemoveLabelID *string `json:"remove_label_id,omitzero"`
}
type UpdateReceivedEmailParams ¶
type UpdateReceivedEmailParams struct {
Read bool `json:"read"`
}
type UpdateSegmentRequest ¶
type UpdateSignupFormRequest ¶
type UpdateSignupFormRequest struct {
Name *string `json:"name,omitzero"`
Fields []string `json:"fields,omitzero"`
ButtonText *string `json:"button_text,omitzero"`
ButtonColor *string `json:"button_color,omitzero"`
SuccessMessage *string `json:"success_message,omitzero"`
DoubleOptIn *bool `json:"double_opt_in,omitzero"`
RedirectURL Nullable[string] `json:"redirect_url,omitzero"`
CaptchaEnabled *bool `json:"captcha_enabled,omitzero"`
CaptchaProvider *string `json:"captcha_provider,omitzero"`
TurnstileSiteKey Nullable[string] `json:"turnstile_site_key,omitzero"`
// TurnstileSecretKey: Write-only. Omit to keep the existing secret.
TurnstileSecretKey Nullable[string] `json:"turnstile_secret_key,omitzero"`
BlockDisposableEmails *bool `json:"block_disposable_emails,omitzero"`
Active *bool `json:"active,omitzero"`
// ConfirmationEmailFrom: Sender of the double opt-in confirmation email. The platform address is used when this is unset or its domain is not verified.
ConfirmationEmailFrom Nullable[string] `json:"confirmation_email_from,omitzero"`
// WelcomeEmailEnabled: Send a welcome email to each new contact from this form.
WelcomeEmailEnabled *bool `json:"welcome_email_enabled,omitzero"`
// WelcomeEmailFrom: Sender of the welcome email. Its domain must be verified, or the welcome email is skipped.
WelcomeEmailFrom Nullable[string] `json:"welcome_email_from,omitzero"`
WelcomeEmailSubject Nullable[string] `json:"welcome_email_subject,omitzero"`
// WelcomeEmailMarkdown: Welcome email body as Markdown.
WelcomeEmailMarkdown Nullable[string] `json:"welcome_email_markdown,omitzero"`
}
UpdateSignupFormRequest: Only the fields sent change. Keys are snake_case, as in the form object. The older camelCase spelling of each key (buttonText, doubleOptIn, welcomeEma
type UpdateTeamMemberParams ¶
type UpdateTemplateRequest ¶
type UpdateTemplateRequest struct {
Name *string `json:"name,omitzero"`
// Alias: A second handle, unique in the team, that works wherever the id does.
Alias Nullable[string] `json:"alias,omitzero"`
// From: Default sender, e.g. "Acme <orders@acme.com>". A send can override it.
From Nullable[string] `json:"from,omitzero"`
// Subject: Default subject. Can use variables. A send can override it.
Subject Nullable[string] `json:"subject,omitzero"`
// ReplyTo: Default Reply-To address or addresses. A send can override it.
ReplyTo Nullable[StringList] `json:"reply_to,omitzero"`
// HTML: The HTML body. Variables are written {{{KEY}}}, optionally with an inline fallback: {{{KEY|default}}}.
HTML Nullable[string] `json:"html,omitzero"`
// Text: Plain-text body. When left out, the text part is generated from the HTML at send time. Exactly "" stops that, as in Resend; the email then carries an
Text Nullable[string] `json:"text,omitzero"`
// Markdown: Not in Resend. A Markdown body, rendered into SMTPfast's email layout. Used when html is empty.
Markdown Nullable[string] `json:"markdown,omitzero"`
// PreviewText: Not in Resend. The inbox preview line, put into the email as a hidden first line.
PreviewText Nullable[string] `json:"preview_text,omitzero"`
// Category: Not in Resend. A label for grouping templates in the dashboard.
Category Nullable[string] `json:"category,omitzero"`
Variables Nullable[[]TemplateVariable] `json:"variables,omitzero"`
// ExpectedUpdatedAt: Not in Resend. The updated_at you loaded. If the template changed since, the update is refused with 409 revision_conflict instead of overwriting the n
ExpectedUpdatedAt *string `json:"expected_updated_at,omitzero"`
}
UpdateTemplateRequest: Any field of CreateTemplateRequest. Only the fields sent change; variables, when sent, replace the whole list.
type UpdateWebhookRequest ¶
type UpdateWebhookRequest struct {
URL *string `json:"url,omitzero"`
// Events: List of event types to subscribe to. Legacy unprefixed email aliases are accepted and normalized to Resend-style email.* event names.
Events []string `json:"events,omitzero"`
// Active: Set to false to pause delivery without deleting the webhook
Active *bool `json:"active,omitzero"`
Format *string `json:"format,omitzero"`
}
type Usage ¶
type Usage struct {
Object string `json:"object"`
Emails UsageEmails `json:"emails"`
Contacts UsageContacts `json:"contacts"`
Segments UsageSegments `json:"segments"`
// Broadcasts: Broadcasts queued, scheduled or sent this month
Broadcasts UsageBroadcasts `json:"broadcasts"`
// AICredits: Not offered: always 0, with a null next_increase_at
AICredits UsageAICredits `json:"ai_credits"`
// AutomationRuns: Not offered: always 0
AutomationRuns UsageAutomationRuns `json:"automation_runs"`
// Domains: A null limit means no cap
Domains UsageDomains `json:"domains"`
// RateLimit: Per API key; null for a dashboard session
RateLimit *UsageRateLimit `json:"rate_limit"`
}
type UsageAICredits ¶
type UsageAICredits struct {
Used int64 `json:"used"`
Limit int64 `json:"limit"`
NextIncreaseAt *string `json:"next_increase_at"`
}
UsageAICredits: Not offered: always 0, with a null next_increase_at
type UsageAutomationRuns ¶
type UsageAutomationRuns struct {
Used int64 `json:"used"`
Limit int64 `json:"limit"`
ResetsAt string `json:"resets_at"`
}
UsageAutomationRuns: Not offered: always 0
type UsageBroadcasts ¶
UsageBroadcasts: Broadcasts queued, scheduled or sent this month
type UsageContacts ¶
type UsageDomains ¶
UsageDomains: A null limit means no cap
type UsageEmails ¶
type UsageEmails struct {
// Daily: The last 24 hours. There is no daily cap, so limit and resets_at are null.
Daily UsageEmailsDaily `json:"daily"`
// Monthly: This month. Received mail does not count, so used equals sent.
Monthly UsageEmailsMonthly `json:"monthly"`
Credits UsageEmailsCredits `json:"credits"`
// EffectiveRemaining: What can still be sent before a send is refused: the monthly allowance left plus credits
EffectiveRemaining int64 `json:"effective_remaining"`
}
type UsageEmailsCredits ¶
type UsageEmailsCredits struct {
// Balance: Prepaid credits
Balance int64 `json:"balance"`
}
type UsageEmailsDaily ¶
type UsageEmailsDaily struct {
Used int64 `json:"used"`
Limit *int64 `json:"limit"`
Sent int64 `json:"sent"`
Received int64 `json:"received"`
ResetsAt *string `json:"resets_at"`
}
UsageEmailsDaily: The last 24 hours. There is no daily cap, so limit and resets_at are null.
type UsageEmailsMonthly ¶
type UsageEmailsMonthly struct {
Used int64 `json:"used"`
Limit int64 `json:"limit"`
Sent int64 `json:"sent"`
Received int64 `json:"received"`
ResetsAt string `json:"resets_at"`
}
UsageEmailsMonthly: This month. Received mail does not count, so used equals sent.
type UsageRateLimit ¶
type UsageRateLimit struct {
// Limit: Requests allowed per duration
Limit int64 `json:"limit"`
Duration string `json:"duration"`
}
UsageRateLimit: Per API key; null for a dashboard session
type UsageSegments ¶
type VerifyDomainResponse ¶
type VerifyDomainResponse struct {
Domain *string `json:"domain,omitzero"`
Status *string `json:"status,omitzero"`
VerificationPhase *string `json:"verification_phase,omitzero"`
Checks *VerifyDomainResponseChecks `json:"checks,omitzero"`
MailFromDomain Nullable[string] `json:"mail_from_domain,omitzero"`
SesConfigured *bool `json:"ses_configured,omitzero"`
// DKIMCheckRestarted: True when the email provider had stopped checking DKIM and this request restarted the check.
DKIMCheckRestarted *bool `json:"dkim_check_restarted,omitzero"`
Message *string `json:"message,omitzero"`
}
type Webhook ¶
type Webhook struct {
ID string `json:"id"`
URL string `json:"url"`
Events []string `json:"events"`
Active bool `json:"active"`
Format *string `json:"format,omitzero"`
// Secret: The signing secret. Returned once, in the create response.
Secret *string `json:"secret,omitzero"`
CreatedAt string `json:"created_at"`
UpdatedAt *string `json:"updated_at,omitzero"`
}
Webhook: List and read responses also carry createdAt and updatedAt in camelCase for older clients.
type WebhookDelivery ¶
type WebhookDelivery struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
WebhookID *string `json:"webhook_id,omitzero"`
Event *string `json:"event,omitzero"`
Status *string `json:"status,omitzero"`
Attempts *int64 `json:"attempts,omitzero"`
MaxAttempts *int64 `json:"max_attempts,omitzero"`
StatusCode Nullable[int64] `json:"status_code,omitzero"`
DurationMs Nullable[int64] `json:"duration_ms,omitzero"`
Error Nullable[string] `json:"error,omitzero"`
// Response: First 500 characters of the last response body
Response Nullable[string] `json:"response,omitzero"`
AttemptLog []WebhookDeliveryAttemptLogItem `json:"attempt_log,omitzero"`
NextAttemptAt Nullable[string] `json:"next_attempt_at,omitzero"`
DeliveredAt Nullable[string] `json:"delivered_at,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
}
type WebhookEvent ¶
type WebhookEvent struct {
Object *string `json:"object,omitzero"`
ID *string `json:"id,omitzero"`
Type *string `json:"type,omitzero"`
CreatedAt *string `json:"created_at,omitzero"`
Status *string `json:"status,omitzero"`
NextAttemptAt Nullable[string] `json:"next_attempt_at,omitzero"`
// Payload: The body that was sent, parsed as JSON
Payload any `json:"payload,omitzero"`
}
type WebhookEventSummary ¶
type WebhookUpdated ¶
type WebhookUpdated struct {
ID string `json:"id"`
URL string `json:"url"`
Events []string `json:"events"`
Format string `json:"format"`
Active bool `json:"active"`
}
WebhookUpdated: The update response has no timestamps; fetch the webhook for those.
type WebhooksDeliveriesService ¶
type WebhooksDeliveriesService struct {
// contains filtered or unexported fields
}
WebhooksDeliveriesService groups the webhooks.deliveries operations.
func (*WebhooksDeliveriesService) Get ¶
func (s *WebhooksDeliveriesService) Get(ctx context.Context, id string, deliveryID string, opts ...RequestOption) (*GetWebhookDeliveryResponse, error)
Get: Get a webhook delivery (GET /v1/webhooks/{id}/deliveries/{delivery_id}).
func (*WebhooksDeliveriesService) List ¶
func (s *WebhooksDeliveriesService) List(ctx context.Context, id string, query *ListWebhookDeliveriesQuery, opts ...RequestOption) (*ListWebhookDeliveriesResponse, error)
List: List webhook deliveries (GET /v1/webhooks/{id}/deliveries).
func (*WebhooksDeliveriesService) ListAll ¶
func (s *WebhooksDeliveriesService) ListAll(ctx context.Context, id string, query *ListWebhookDeliveriesQuery, opts ...RequestOption) iter.Seq2[WebhookDelivery, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*WebhooksDeliveriesService) Retry ¶
func (s *WebhooksDeliveriesService) Retry(ctx context.Context, id string, deliveryID string, opts ...RequestOption) (*RetryWebhookDeliveryResponse, error)
Retry: Retry a webhook delivery (POST /v1/webhooks/{id}/deliveries/{delivery_id}/retry).
type WebhooksEventsAttemptsService ¶
type WebhooksEventsAttemptsService struct {
// contains filtered or unexported fields
}
WebhooksEventsAttemptsService groups the webhooks.events.attempts operations.
func (*WebhooksEventsAttemptsService) List ¶
func (s *WebhooksEventsAttemptsService) List(ctx context.Context, id string, eventID string, opts ...RequestOption) (*ListWebhookEventAttemptsResponse, error)
List: List the attempts of a webhook event (GET /v1/webhooks/{id}/events/{event_id}/attempts).
type WebhooksEventsService ¶
type WebhooksEventsService struct {
Attempts *WebhooksEventsAttemptsService
// contains filtered or unexported fields
}
WebhooksEventsService groups the webhooks.events operations.
func (*WebhooksEventsService) Get ¶
func (s *WebhooksEventsService) Get(ctx context.Context, id string, eventID string, opts ...RequestOption) (*WebhookEvent, error)
Get: Retrieve a webhook event (GET /v1/webhooks/{id}/events/{event_id}).
func (*WebhooksEventsService) List ¶
func (s *WebhooksEventsService) List(ctx context.Context, id string, query *ListWebhookEventsQuery, opts ...RequestOption) (*ListWebhookEventsResponse, error)
List: List webhook events (GET /v1/webhooks/{id}/events).
func (*WebhooksEventsService) ListAll ¶
func (s *WebhooksEventsService) ListAll(ctx context.Context, id string, query *ListWebhookEventsQuery, opts ...RequestOption) iter.Seq2[WebhookEventSummary, error]
ListAll iterates over every item of List, fetching the following pages as needed.
func (*WebhooksEventsService) Replay ¶
func (s *WebhooksEventsService) Replay(ctx context.Context, id string, eventID string, opts ...RequestOption) (*ReplayWebhookEventResponse, error)
Replay: Replay a webhook event (POST /v1/webhooks/{id}/events/{event_id}/replay).
type WebhooksService ¶
type WebhooksService struct {
Deliveries *WebhooksDeliveriesService
Events *WebhooksEventsService
// contains filtered or unexported fields
}
WebhooksService groups the webhooks operations.
func (*WebhooksService) Create ¶
func (s *WebhooksService) Create(ctx context.Context, params *CreateWebhookRequest, opts ...RequestOption) (*Webhook, error)
Create: Create webhook (POST /v1/webhooks).
func (*WebhooksService) Delete ¶
func (s *WebhooksService) Delete(ctx context.Context, id string, opts ...RequestOption) (*Success, error)
Delete: Delete webhook (DELETE /v1/webhooks/{id}).
func (*WebhooksService) Get ¶
func (s *WebhooksService) Get(ctx context.Context, id string, opts ...RequestOption) (*Webhook, error)
Get: Get webhook (GET /v1/webhooks/{id}).
func (*WebhooksService) List ¶
func (s *WebhooksService) List(ctx context.Context, opts ...RequestOption) (*ListWebhooksResponse, error)
List: List webhooks (GET /v1/webhooks).
func (*WebhooksService) Replace ¶
func (s *WebhooksService) Replace(ctx context.Context, id string, params *UpdateWebhookRequest, opts ...RequestOption) (*WebhookUpdated, error)
Replace: Update webhook (PUT /v1/webhooks/{id}).
func (*WebhooksService) RotateSigningSecret ¶
func (s *WebhooksService) RotateSigningSecret(ctx context.Context, id string, opts ...RequestOption) (*RotateWebhookSigningSecretResponse, error)
RotateSigningSecret: Rotate a webhook signing secret (POST /v1/webhooks/{id}/signing-secret/rotate).
func (*WebhooksService) Test ¶
func (s *WebhooksService) Test(ctx context.Context, id string, opts ...RequestOption) (*TestWebhookResponse, error)
Test: Test webhook (POST /v1/webhooks/{id}/test).
func (*WebhooksService) Update ¶
func (s *WebhooksService) Update(ctx context.Context, id string, params *UpdateWebhookRequest, opts ...RequestOption) (*WebhookUpdated, error)
Update: Update webhook (PATCH /v1/webhooks/{id}).