Go
Changelog
Every release of the package, newest first.
0.1.0
Calendar.ListCalendarLogins,CreateCalendarLogin,RevokeCalendarLoginandCreateCalendarLoginProfileLinkmanage calendar sign-ins, through/calendar/logins. A calendar sign-in belongs to a person, not to an address: its username iscal-and ten letters and digits, never an address, and it signs calendar and contacts apps in over CalDAV and CardDAV to that person’s calendars, the calendars and address books shared with them and their contacts, even when they hold no address at all. Mail apps refuse it and it never sends.CreateCalendarLoginreturns thepassword, shown this once,serverswith thecaldavandcarddavservers, and an Apple configuration profile inappleProfilewith CalDAV and CardDAV only, andCreateCalendarLoginProfileLinkmakes a one-time link that sets one up on an Apple device. Your own takeaccount:readandaccount:write, andnextmail.WithMemberonListCalendarLogins, or"member"in the body of the two that create, reaches a member’s withmembers:write. Neither of those two is retried.constants.SecurityEventKindsCalendarLoginCreated("calendar-login-created") andconstants.SecurityEventKindsCalendarLoginRevoked("calendar-login-revoked") are two more kinds in the security log, and thedetailof an entry carrieslogin, the username of the sign-in it is about.- To-dos: a to-do list is a calendar of kind
todos(constants.CalendarKindsTodos), and its items are RFC 5545 to-dos that calendar apps such as Reminders, Thunderbird and tasks.org sync over CalDAV.Calendar.ListTodos,ListAllTodosandIterateTodosread them throughGET /calendar/todos, filtered bynextmail.WithCalendarIDs,nextmail.WithState(open,doneorall, theconstants.TodoStatesvalues),nextmail.WithDueBeforeandnextmail.WithDueAfter.GetTodo,CreateTodo,UpdateTodoandDeleteTodowork on one, andDeleteTodoanswers with how many to-dos itremoved. A to-do has atitle,notes, astatusamong theconstants.TodoStatusesvalues,startanddueas a day or a moment withallDayandtimezone,completedAt,priority,percentComplete,categories, theparentIdof the to-do it is a step of and therecurrenceit repeats by. Checking off a repeating to-do moves it to its next date. They needcalendar:readandcalendar:write, andCreateTodois not retried after a network failure. Calendar.ListCalendarstakesnextmail.WithKindand lists your to-do lists withconstants.CalendarKindsTodos, andCalendar.CreateCalendartakes"kind"to make one. Members, colours, order and deleting work on to-do lists as they do on calendars.Calendar.DeleteCalendartakesnextmail.WithNotifyGuests: left out ortrue, the guests of every upcoming meeting you organised in the calendar are sent a cancellation, asCancelEventdoes, andfalsedeletes it without telling anyone. The answer carriescancelledMeetings. Sending the cancellations needsemails:sendas well.Threads.ListAutomationsreads which automations ran on a thread and what they did, throughGET /threads/{id}/automations, withthreads:readandautomations:read: a[]nextmail.Object, newest first, each with theautomationit was (id,nameandstatus), itsstatusandtrigger, the case the email matched inmatch(the address or domain that received it, the sender entry and the filters that held, or null), themessagesof the thread it started from or sent, each with aroleamong theconstants.AutomationThreadRolesValues, and every step it ran insteps, with the step as the version defines it.LiveEvents.Streamfollows the mailbox as it changes, over the server-sent events ofGET /live-events, withthreads:read: onenextmail.LiveEventwithID,Type,OccurredAtandDataeach time a message is filed or sent, a conversation changes or is deleted, or the delivery of a sent email moves on, of the kinds inconstants.LiveEventTypesValues. It takesnextmail.WithTypes,nextmail.WithAddressandnextmail.WithLastEventID, and returns a*nextmail.LiveEventStream: range over itsAll(), or callNext,EventandErr. Leaving the loop ofAll(),Closeor cancelling the context closes it without an error.- The stream never ends by itself. It opens again after the server closes it and resumes through
Last-Event-ID, retries a network failure, a 408, a 429 and a 5xx from a second doubling to 30 seconds, waits as long asRetry-Afterasks up to 5 minutes, and reopens a connection silent for 60 seconds. When the server can no longer replay from where it left off, it delivers an event whoseTypeisnextmail.LiveEventReset, with itsreasoninData. A 400, 401, 403, 404 or 422 ends it with the*nextmail.ErrorthatErrreturns. Threads.WaitForEmailholds the request open until a message that matches arrives and returns it, the way a script waits for a sign-in code.nextmail.WithFromAddressandnextmail.WithSubjectmatch text in the sender and in the subject,nextmail.WithAddresskeeps the mail of one address,nextmail.WithSincesets the earliest arrival, andnextmail.WithWaitSecondshow long to wait, from 0 to 60 seconds and 30 when left out. It answersmessage_waitwith themessage_arrival, or null when nothing arrived in time, andwaitedMs. The call is given that wait plus 15 seconds, so the client timeout does not cut it short.constants.AddressForwardStatusesBounced("bounced") is a forwarding destination whose server refused forwarded mail for good, so nothing is forwarded to it until it confirms again. A route that forwards to one readsconstants.AddressRouteInactiveReasonsForwardBounced("forward_bounced"). Asking a bounced destination again sends it a new confirmation.- A traffic entry and a routed message carry
verdicts["arc"]: the ARC verdict for the servers that forwarded the message on its way in,pass,fail,noneortemperror, andnilon an entry written before ARC was checked. Calendar.ListCalendars,GetCalendar,CreateCalendar,UpdateCalendarandDeleteCalendarmanage your calendars: the ones you keep, with your default one among them, and the ones other members of the workspace gave you access to, each with its own"color"and"position"and akind, one of theconstants.CalendarKindsvalues. Deleting a calendar deletes its events, and your default calendar cannot be deleted.Calendar.SetCalendarMemberandRemoveCalendarMembergive a member"read"or"write"access to a calendar you keep, theconstants.CollectionAccessLevelsvalues, andaccesson a calendar, one of theconstants.CollectionRightsvalues, says what you may do with it.SetCalendarMemberis retried after a network failure, since setting the same access twice leaves the same member, andCreateCalendaris not.- Calendar events and occurrences carry
calendarId.Calendar.CreateEventtakes"calendarId"to put the event in a calendar andUpdateEventtakes it to move one,ListEvents,ListAllEventsandIterateEventstakenextmail.WithCalendarIDsto keep only some calendars,CreateFeedtakes"calendarId"to publish one calendar and every feed says which, andImportIcstakesnextmail.WithCalendarIDfor the calendar the events go into, which every import reports. Contacts.ListAddressBookslists your address book and the ones other members gave you access to, each withaccess, one of theconstants.CollectionRightsvalues.Contacts.SetAddressBookMemberandRemoveAddressBookMembergive a member"read"or"write"access to yours, theconstants.CollectionAccessLevelsvalues, andSetAddressBookMemberis retried after a network failure.ListCards,ListAllCardsandIterateCardstakenextmail.WithAddressBookto read one you are a member of, andCreateCardtakes"addressBook"to add to one you may write.Traffic.List,ListAllandIterateread the traffic log: one entry for each message and recipient at each step it took in or out of the workspace, newest first, kept for 30 days. They takeWithDomainID,WithDirection,WithOutcomes,WithAddress,WithRecipient,WithSinceandWithUntil. Outbound entries needemails:readand inbound onesthreads:read.Emails.SendRawsends an RFC 5322 message you built yourself, as written:rawis its bytes as a[]byteor anio.Reader, encoded for you, or base64 text, up to 10 MB. The sender is its From header and the recipients its To, Cc and Bcc headers, unlessto,ccorbccgive the envelope. It takes the scheduling, tracking, signature, tag and lane options ofSend, honoursnextmail.WithIdempotencyKey, and never sends a Bcc header.- The
email_receivedtrigger of an automation takessenders, the addresses or domains its mail has to come from, where a domain covers its subdomains. Left out or empty, mail from anybody starts it. Settings.UpdatetakeslabelAlerts, andSettings.Getreturns it: label ids under each workspace id whose mail still alerts you while labelled mail stays out of your inbox.MailboxProvidersOpenemailandMailServicesOpenemail("openemail"): the provider of a mailbox on OpenEmail and thesentWithof a message sent with it.sentWithstays empty, rather than naming Outlook or Gmail, when another mail service signed the message and the only hint is that it passed through Microsoft’s or Google’s servers on the way or was written in the Outlook app.ShareLinks.List,ListAllandIterateread the templates, forms and automations the workspace shares at a public link, the newest first, with how often each page was opened and each item copied, and takenextmail.WithKind,nextmail.WithLimitandnextmail.WithCursor, where the kind is one of theconstants.ShareKindsvalues.ShareLinks.Getreads the link of one item, named by its kind and its id,ShareLinks.Setmakes it public or changes"copyable", andShareLinks.Deletemakes it private again.Setis retried after a network failure, since an item keeps one link however often it is shared, andDeleteis not. A private item answers 404share_link_not_found.Shared.Getreads what the public page of a link shows, from the token at its end and from any workspace, andShared.Copycopies the item into this workspace as a draft.Copyis never retried, because a second call makes a second copy. An item its owner shares to look at only answers 403share_not_copyable, and a link that no longer works answers 404shared_item_not_found.Tasks.List,ListAllandIteratetakenextmail.WithChatIDto read only the tasks made in one assistant chat, the ones the chat shows above its messages, as the Tasks page does when a chat’s task is opened. A chat belongs to one person, so the id of a chat you cannot open lists no tasks.
0.0.3
- Withdraws v0.0.2, which declared another module path and so never installed as
nextmail.sh, and this release itself, sogo get nextmail.shinstalls 0.0.1. Nothing else changed.
0.0.1
The first release of the Go SDK: the module nextmail.sh, with the package nextmail. It needs Go 1.24 or later and nothing outside the standard library. It has a method for each of the 746 methods of the TypeScript SDK, in the same 53 namespaces and under the same names in Go’s casing, as fields of the client: client.Emails.Send, client.Threads.List, client.Domains.Verify. They cover everything from sending and reading mail to contacts, broadcasts, automations, the calendar, booking pages, tasks and the settings of a workspace, and a parity check proves that each one sends the same request as its TypeScript twin.
nextmail.New()readsNEXTMAIL_API_KEY,NEXTMAIL_ACCESS_TOKENandNEXTMAIL_BASE_URL, and takesWithAPIKey,WithAccessToken,WithAccessTokenFunc,WithBaseURL,WithHTTPClient,WithTimeout,WithMaxRetries,WithUserAgentandWithHeader. It never fails: a missing or malformed credential is reported byclient.Err()and by the first call.- Every method takes a
context.Contextfirst, which cancels the call or gives it a deadline. Request bodies arenextmail.Bodymaps that keep the field names of the API, options are functions such asnextmail.WithLimitandnextmail.WithCursor, and results arenextmail.Objectvalues with readers such asString,Int,Bool,TimeandObject. - Every paginated resource has
Listfor one page,ListAllfor every item as a slice, andIterate, which fetches the next page only when it gets there. Range over itsAll(), or callNext,ItemandErrin a plain loop. - Failures come back as
*nextmail.Errorvalues withStatus,Type,Code,Param,DocURL,RequestID,RetryAfter,FieldsandBody, anderrors.Ismatches them against sentinels such asErrNotFound,ErrValidation,ErrRateLimited,ErrStepUpRequired,ErrNetworkandErrTimeout. A mistake in the call itself matchesErrInvalidArgumentand is returned before anything is sent. - Reads, sends and every write that is safe to repeat are retried on 408, 500, 502, 503 and 504 with backoff, and on a 429 only when its
Retry-Afteris a minute or less. Every send carries an idempotency key that its retries reuse, andnextmail.WithIdempotencyKeysets your own. - An OAuth access token works in place of an API key, given as it is or by a function that runs before every request, so the token can be renewed without a new client. When a change made with a token needs a verification code, the error matches
ErrStepUpRequired, andclient.Security.BeginStepUpandVerifyStepUpprovide one. - Every workspace is the same kind, the one that holds the free address included. That address sends only the mail a person writes in the app, so a send from it with an API key or an access token is refused with
from_address_forbidden. nextmail.VerifyWebhookSignaturechecks a webhook delivery in constant time, refuses one more than five minutes old and returns the event.nextmail.NewTempMailbuilds a client for disposable inboxes that needs no credential, andclient.Requestcalls an endpoint no method wraps, with the credential, timeout and retries of the client.nextmail.ResolveLanguage,LanguageByCode,IsRTLLanguage,IsAPIKey,IsAccessTokenandIsSealedare the helpers of the TypeScript SDK, and theconstantspackage holds the sets of values the API uses, such as webhook events, scopes and statuses.- A client is safe for concurrent use. It sends a credential over plain
http:only to a server on this machine, its default HTTP client follows no redirects, and printing a client, an option or an error never shows a credential. - API keys begin
nm_live_ornm_test_, and temporary inbox tokensnm_inbox_. The client refuses a key of any other shape. Account.SetPhoto,Contacts.SetPhoto,Domains.SetAddressPhoto,Bookings.UploadBackground,Branding.UploadImageandTemplates.UploadImagetake images up to 100 MB, wait for them as long asFiles.Uploaddoes, and takenextmail.WithCrop: the part of the image to keep, as anextmail.ImageCrop, sent as thecropquery parameter.Emails.ListEventsByMessageID,ListAllEventsByMessageIDandIterateEventsByMessageIDread the event trail of a sent email found by the Message-ID header it went out with, 1 to 998 characters with or without its angle brackets, for a caller that holds that header and not themsg_id, such as a reply or a bounce report that quotes it. They takenextmail.WithAddress,nextmail.WithLimitandnextmail.WithCursorasListEventsdoes and needemails:read, and a Message-ID that no message the key reaches went out with is a 404.ProviderImports.List,ListAllandIteratetakenextmail.WithSource, one of theconstants.ProviderImportProvidersvalues,nextmail.WithStatus, one of theconstants.ImportHistoryStatusesgroups, andnextmail.WithSearch, up to 320 characters, the filtersImports.Listtakes, sent with every page. An import from a provider never pauses, sopausedanswers an empty page.Emails.ListEvents,ListAllEventsandIterateEventstakenextmail.WithMessageID, 1 to 998 characters: the trail answers only when the send went out with that Message-ID header, with or without its angle brackets, and is a 404 otherwise. The send id is still required.Files.CreateLinktakesnextmail.WithReuse:truehands back the working public link the file already has, with its own domain and download count, instead of making another, and a file with none gets a new one. A link handed back answers 200 and a new one 201.Keys.Create,UpdateandDelete,Keys.Rotatefor any key but the caller, andWorkspaces.OfferOwnership,WithdrawOwnershipOffer,Account.AcceptOwnershipOfferandDeclineOwnershipOfferrefuse an API key with 403console_only, an error that matchesnextmail.ErrPermission. The console confirms these changes with a verification code, which a key cannot give, so they are made there. A key still rotates its own secret withKeys.RotateorMe.Rotate, and revokes keys withKeys.Revoke.AppHost.Get,SetandVerifyreportsender, where the emails sent to the people of the workspace come from: a map withaddress,domainandwaitingOn.waitingOnislogoorsigning, theconstants.AppHostSenderWaitsvalues, until they come fromnoreply@the domain of the live web app address, and then null.senderis null on the free plan and until an address on a verified domain of the workspace is live.- Every address from
Addresses.List,ListAllandIteratereportsrole, one of theconstants.AddressRolesvalues:owneron every address for an API key, andmemberorviewerfor an app a member connected. A key narrowed to particular addresses or domains lists only the addresses and domains it covers, and the free address of the person the key acts for is listed, withroleowner, by a key of the workspace it belongs to. Chats.ListMessages,ListAllMessagesandIterateMessagesread the messages of a chat, from the first unlessnextmail.WithOrderisdesc, one of theconstants.ChatMessageOrdersvalues. Each message has itstextand itsparts, of the kinds inconstants.ChatMessagePartTypes: the words, the tools the assistant called with their arguments, results and status, one of theconstants.ChatToolCallStatusesvalues, and the files. A tool result the caller may not read comes back redacted.Chats.SendMessagesays something in a chat, or starts one under a new id, and returns the chat turn once the assistant has answered. Itsstatus, one of theconstants.ChatTurnStatusesvalues, isawaiting_approvalwhen a call that changes something waits inpendingToolCalls, whichChats.ApproveToolCall, with optional"args", orChats.DenyToolCallanswers, and"regenerate": trueanswers the last message again.Chats.StopTurnstops the assistant and answersstoppedoridle, theconstants.ChatStopStatusesvalues, and a stopped turn says why instopReason, one of theconstants.ChatStopReasonsvalues."attachments"takes up to 4 files by"fileId"or inline, where bytes in"content"are encoded for you. None of the four is retried. The refusals arechat_busy,approval_pending,tool_not_offered,ai_quota_exceeded,ai_not_configuredandassistant_unavailable.- A turn runs for at most 240 seconds, so
Chats.SendMessage,ApproveToolCallandDenyToolCallwait at least 5 minutes for it, or the client timeout when that is longer, as uploads wait at least 10.nextmail.WithTimeoutsets another wait for one call, and zero waits as long as it takes. Members.GetDirectorySyncreads directory sync (SCIM), through which a company directory adds people to the workspace and takes them out again, andMembers.ConnectDirectorySyncturns it on and returns its token once.Members.DisconnectDirectorySyncturns it off,Members.ListDirectoryPeoplereads who the directory synced, from 1 withnextmail.WithStartIndexandnextmail.WithCount, each in one of theconstants.DirectoryPersonStatesstates, andMembers.SetDirectoryDefaultRoleandSetDirectoryGroupRolechoose the roles it gives. They take the role as a*string, where nil gives the built-in Member role or no role from the group. Only the owner or a role holdingworkspace:managereaches them, every change asks an OAuth access token for a verification code, and the refusals areplan_required,role_not_foundanddirectory_sync_not_connected.Security.GetPolicyreads whether the workspace requires two-factor sign-in and whether the person behind the client meets it, with no scope.Security.UpdatePolicysets"requireTwoFactor", withmembers:writeand a verification code.Workspaces.GetOwnershipOffer,OfferOwnershipandWithdrawOwnershipOfferlet the owner offer the workspace to one of its members, andAccount.ListOwnershipOffers,AcceptOwnershipOfferandDeclineOwnershipOfferanswer the offers made to the person. Offering and accepting ask for a verification code. The refusals areownership_offer_not_found,ownership_not_eligible,ownership_changed,domain_moving,two_factor_requiredandworkspace_allowance_reached.Account.SetNamechanges the name of the person.Account.ListPushDevices,RemovePushDeviceandSendTestPushread the phones that get the person’s notifications, each with aplatformfromconstants.PushPlatforms, stop one, and send a test.Account.EndConnectedAppElevationmakes a connected app ask for verification codes again.DNSConnections.Startreturns the link that connects a Cloudflare account to the workspace in a browser. It asks an OAuth access token for a verification code, and a server that cannot connect a provider answersdns_unavailable.Domains.CreateMailAppProfileLinkmakes a one-time link that sets an address up on an iPhone, iPad or Mac with a new app password. It needsmembers:writeand a verification code, and past 10 links an hour it isprofile_link_rate_limited.Domains.StartGravatarPublishreturns the link that publishes the photo of an address to Gravatar, refused withphoto_requiredandgravatar_not_configured.Threads.SetReplyingandClearReplyingshow the team who is writing a reply.Threads.ListTrackingreads the tracking report of every tracked message sent in a thread, andThreads.GetDeliverycounts what bounced, was refused or was held back, both narrowed bynextmail.WithAddress.Threads.ListFileLinks,ListAllFileLinksandIterateFileLinksread the download links one message carried, withnextmail.WithIncludeRevoked.Threads.Countstakesnextmail.WithHideLabelled.Senders.GetAvatardownloads the picture of a sender as bytes, andSenders.GetandResearchreportavatarUrlandavatarKind, one of theconstants.SenderAvatarKindsvalues.Emails.SendandSendBatchtake"isForward","originalMessage", the quoted history of a forward or a reply, and"encryption", a map with"format": "pgp-mime","sealedAt"and"sealedTo"for a message you sealed yourself with OpenPGP.Emails.Translatetakes"skipQuoted"and reportsquotedHistoryKept. An attachment ofEmails.Sendcan also be a map with"url"and optionally"filename"and"contentType", a file the server fetches once.Emails.ListEvents,ListAllEvents,IterateEventsandGetTracking, and the opens and clicks methods ofTracking, takenextmail.WithAddress.Tracking.List,ListAllandIteratetakenextmail.WithOffsetMinutes, andTracking.GetStatsreportsdownloads, the files that went out as download links and how often they were fetched.Templates.UpdateandReplaceContenttake"expectedUpdatedAt", andTemplates.Publishtakesnextmail.WithExpectedUpdatedAt: theupdatedAtof the version you read, which refuses a change saved in between with 409version_conflict. Every template version reportsupdatedAt.Drafts.CreateandUpdatetake"attachments", up to 20 files inline or by"fileId", where bytes in"content"are encoded for you, andDrafts.Getreports thefileIdof each file.- Filters:
nextmail.WithRuleIDsonRules.ListRuns,ListAllRunsandIterateRuns,nextmail.WithAudienceIDonContacts.List,ListAllandIterate,nextmail.WithFromandnextmail.WithToonContacts.Activity,nextmail.WithInactiveDaysonAudiences.ListContacts,ListAllContactsandIterateContacts,nextmail.WithSinceandnextmail.WithUntilonAudiences.Growth,Forms.AnalyticsandBookings.Analytics,nextmail.WithSinceonBroadcasts.AnalyticsandBroadcasts.Stats,nextmail.WithSource,nextmail.WithStatus, one of theconstants.ImportHistoryStatusesgroups, andnextmail.WithSearchonImports.List,ListAllandIterate, andnextmail.WithFromAddressonSignatures.List,ListAllandIterate. Contacts.SetAudiencesandAudiences.AddContacttake"createContact": true, which saves an address that is not a contact yet as one first and then needscontacts:write. Through an app a member connected, an address another member saved is a 409contact_existsthere and onContacts.Save.- Scopes:
Addresses.List,ListAllandIterateneedemails:read, oremails:sendin its place.Audiences.ListContacts,ListAllContactsandIterateContactsneedcontacts:readas well asaudiences:read.Emails.Compose,Rewrite,SuggestSubjectandTranslatetakedrafts:writein place ofemails:send.Domains.GetMailAppSettingsandListAppPasswordsneedthreads:read, andDomains.UpdateMailAppSettingsneedsthreads:readanddomains:write.Domains.CreateAddressasks an OAuth access token for a verification code when it chooses where the mail goes or deletion on expiry. Domains.CreateAddressandDomains.UpdateAddresstake"expiresAt"and"onExpiry", one of theconstants.AddressExpiryActionsvalues, and every address reports them withexpiredAt. From itsexpiresAtan address takes no mail and sends none, a send from it is refused with 403address_expired, and within a minute it is switched off, or deleted with the conversations delivered to it whenonExpiryisdelete. A laterexpiresAt, nil or"enabled": trueturns a stopped address back on.constants.WebhookEventsAddressExpiredis the eventaddress.expired.- The
constants.DomainAddressDestinationsvalues gainwebhookandgroup. The same two methods take"webhookId"for a webhook destination,"tapWebhookIds"to copy every message to up to 5 endpoints, and"groupPosting", one of theconstants.AddressGroupPostingPoliciesvalues, and"groupKeepCopy"for a group, and every address reports them. The refusals arewebhook_not_foundandtoo_many_taps. constants.WebhookEventsEmailRoutedis the eventemail.routed: a message that arrived at an address whose destination iswebhook, or that a route of its domain sent to a webhook, was kept for 30 days instead of being filed. It goes only to the endpoint the address or route names and to the taps of the address, and always carriescontentandraw.routedBysays which sent it, with itskindone of theconstants.WebhookRoutedSourcesvalues,recipientkeeps the plus tag andverdictsare what the receiving server found. Anemail.receivedevent carriestap, true when an endpoint gets the message as a tap of the address rather than through its subscription.Domains.ListRoutes,ListAllRoutesandIterateRoutesread the pattern routes of a domain in the order they are tried, andDomains.CreateRoute,GetRoute,UpdateRouteandDeleteRoutemanage them: a route catches mail to addresses nobody created whose local part matches itspattern, such assupport-*, and delivers it to an address, forwards it once the destination confirms, posts it to a webhook asemail.routedor reads it on another domain, as theconstants.AddressRouteActionsvalues say.activeandinactiveReason, one of theconstants.AddressRouteInactiveReasonsvalues, say whether a route takes mail now. A domain holds at most 100 routes, and the refusals areinvalid_route_pattern,route_pattern_taken,route_target_not_foundandroute_limit_reached.Domains.TestRouteanswers which step decides mail to an address without sending anything, one of theconstants.AddressRouteTestStepsvalues, with the route that decided and where the mail would end up.Domains.ListGroupMembers,ListAllGroupMembersandIterateGroupMembersread the group members of a group address, andDomains.AddGroupMembersandRemoveGroupMemberchange them. A group member is an address of the workspace or an address at another provider, which confirms by email first, as theconstants.GroupMemberKindsvalues say. A group holds at most 1,000 group members and groups nest at most 3 deep, and the refusals arenot_a_group,group_member_limit,group_member_not_foundandgroup_nesting_too_deep.Domains.Updatetakes"aliasOf", which makes the domain an alias of another domain of the workspace, and every domain reportsaliasOfandaliases. The refusals arealias_not_allowed,alias_chainandalias_has_addresses, and creating an address on an alias is refused withalias_has_addresses.Domains.UpdateAddressLimitstakesreceiving.storageBytes, a storage quota for one address from 1 MiB to 1 TiB, andDomains.GetAddressLimitsreports it. A message that would take the address past its quota gets a permanent bounce (5.2.2), and deleting mail for good makes room again.Domains.GetAddressLimitsalso reports what the address keeps inusage.storage, withbytesandmessages: every message filed in its mailbox since storage counting began, with its kept original when it keeps originals. Mail stored before then and mail routed to a webhook are not counted.Webhooks.ListDeadLetters,ListAllDeadLettersandIterateDeadLettersread the events an endpoint gave up on: each event whose last automatic attempt failed, with how many times it was tried, the last answer and that attempt.nextmail.WithStatusreads theopenones by default, orreplayed,discardedorall, theconstants.WebhookDeadLetterFiltersvalues. A dead letter is kept 30 days.Webhooks.ReplayDeadLetterssends up to 100 open dead letters again in one call, the named ones or the oldest, and answers with anoutcomefor each, one of theconstants.WebhookDeadLetterReplayOutcomesvalues. A delivered one is closed asreplayed.Webhooks.DiscardDeadLettercloses one without sending it, and one already replayed is 409dead_letter_resolved.Webhooks.CreateandWebhooks.Updatetake"retryPolicy", one of theconstants.WebhookRetryPoliciesvalues:standardtries a failed delivery up to 8 times over about 27 and a half hours, andextendedup to 16 times over about 3 days. They also take"includeRaw": true, which needsthreads:read, and every endpoint reports both.Threads.GetRawMessagedownloads the source of one message asmessage/rfc822bytes, ready to save as an.emlfile. It is the message byte for byte as it arrived when the address hadkeepOriginalon, and otherwise a source rebuilt from the stored message, the same bytes the IMAP server gives a mail app. TheX-Message-Sourceresponse header says which, one of theconstants.RawMessageSourcesvalues.Domains.CreateAddressandDomains.UpdateAddresstake"keepOriginal": true, and every address reports it. While it is on, each message the address receives is also kept byte for byte as it arrived, and it is deleted with its message.- An
email.receivedevent to an endpoint withincludeRawon carriesdata.raw: a link that downloads the message source for an hour, itssizeand itssource,originalorrebuilt. Domains.GetAddressLimitsandDomains.UpdateAddressLimitsread and change what one address may send and receive: a hold that pauses or disables sending or receiving, caps per hour, per 24 hours and per month on messages and recipients, recipients per message, and lists of allowed and blocked recipients and allowed senders, with the usage so far. Theconstants.AddressHoldsvalues list the holds.Domains.GetandDomains.Updategive each DNS recordfound, what public DNS answers at that name now, andproblem, with acodefrom theconstants.DomainRecordProblemsvalues and amessageto show a person.Domains.Updatetakes"autodiscovery": true, which offers the SRV and TXT records that let mail, calendar and contacts apps find the servers from an address on the domain alone, listed inautodiscoveryRecords.Webhooks.CreateandWebhooks.Updatetake"includeContent": true, which puts the message into everyemail.receivedevent asdata.content: the text, the HTML up to 512 KiB and each attachment with a link that downloads it for an hour. Turning it on needsthreads:read.- A connected mailbox can be the sender of
Emails.Sendwith an API key, of broadcasts, automations and sign-up forms, and a key or an app can send from the free address of the person it acts for. Only that person may send as a free address. Threads.Countsleaves labelled mail out ofteam.assignedandteam.unassigned, as the inbox does, unless the person has chosen to show labelled mail in the inbox.List,ListAllandIterateofDomains,Members,Keys,WebhooksandRules, andConnectedMailboxes.List, takenextmail.WithQ, which searches every field a person reads on the row: names, addresses, ids, scopes, events, condition values. Every word has to appear, ignoring case and accents, and close spellings count when nothing matches exactly.Rules.Statsreads how the rules did inside a window: messages matched and failed, a series of buckets, the matches of each rule, the actions taken, the failures and the senders matched most.nextmail.WithRuleIDscounts some rules only.Billing.Getreportsusage.addressChecks, the deep address checks used this calendar month against what the plan includes, andBilling.ListPlanseach plan’smonthlyAddressChecks.Tools.CheckAddressandTools.CheckAddresseswith the deep check first use the deep checks the plan includes each month (10 on Free, 100 on Starter, 500 on Business, 1,000 on Enterprise), then pay as you go at $1.50 per 100 addresses.- An automation branch can check the contact’s address:
{"kind": "address_check", "mailbox": ..., "accept": ...}, withacceptfromconstants.AutomationAddressAcceptsValues(). - A send leaves out an address whose domain takes no mail, and one the check on sending finds has no mailbox. Each shows as
suppressed, with anemail.suppressedwebhook that names the reason, never as a bounce. - Forms check the address of every sign-up:
Forms.Subscriberefuses one whose domain takes no mail with the field errorundeliverable.refuseDisposablein the settings also refuses throwaway addresses (disposable),checkMailboxruns a deep check on every sign-up and refuses a missing mailbox (mailbox_not_found), and a refused address that looks like a typo carriessuggestion.