Skip to the documentation
Go

Changelog

Every release of the package, newest first.

0.1.0

  • Calendar.ListCalendarLogins, CreateCalendarLogin, RevokeCalendarLogin and CreateCalendarLoginProfileLink manage calendar sign-ins, through /calendar/logins. A calendar sign-in belongs to a person, not to an address: its username is cal- 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. CreateCalendarLogin returns the password, shown this once, servers with the caldav and carddav servers, and an Apple configuration profile in appleProfile with CalDAV and CardDAV only, and CreateCalendarLoginProfileLink makes a one-time link that sets one up on an Apple device. Your own take account:read and account:write, and nextmail.WithMember on ListCalendarLogins, or "member" in the body of the two that create, reaches a member’s with members:write. Neither of those two is retried.
  • constants.SecurityEventKindsCalendarLoginCreated ("calendar-login-created") and constants.SecurityEventKindsCalendarLoginRevoked ("calendar-login-revoked") are two more kinds in the security log, and the detail of an entry carries login, 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, ListAllTodos and IterateTodos read them through GET /calendar/todos, filtered by nextmail.WithCalendarIDs, nextmail.WithState (open, done or all, the constants.TodoStates values), nextmail.WithDueBefore and nextmail.WithDueAfter. GetTodo, CreateTodo, UpdateTodo and DeleteTodo work on one, and DeleteTodo answers with how many to-dos it removed. A to-do has a title, notes, a status among the constants.TodoStatuses values, start and due as a day or a moment with allDay and timezone, completedAt, priority, percentComplete, categories, the parentId of the to-do it is a step of and the recurrence it repeats by. Checking off a repeating to-do moves it to its next date. They need calendar:read and calendar:write, and CreateTodo is not retried after a network failure.
  • Calendar.ListCalendars takes nextmail.WithKind and lists your to-do lists with constants.CalendarKindsTodos, and Calendar.CreateCalendar takes "kind" to make one. Members, colours, order and deleting work on to-do lists as they do on calendars.
  • Calendar.DeleteCalendar takes nextmail.WithNotifyGuests: left out or true, the guests of every upcoming meeting you organised in the calendar are sent a cancellation, as CancelEvent does, and false deletes it without telling anyone. The answer carries cancelledMeetings. Sending the cancellations needs emails:send as well.
  • Threads.ListAutomations reads which automations ran on a thread and what they did, through GET /threads/{id}/automations, with threads:read and automations:read: a []nextmail.Object, newest first, each with the automation it was (id, name and status), its status and trigger, the case the email matched in match (the address or domain that received it, the sender entry and the filters that held, or null), the messages of the thread it started from or sent, each with a role among the constants.AutomationThreadRolesValues, and every step it ran in steps, with the step as the version defines it.
  • LiveEvents.Stream follows the mailbox as it changes, over the server-sent events of GET /live-events, with threads:read: one nextmail.LiveEvent with ID, Type, OccurredAt and Data each 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 in constants.LiveEventTypesValues. It takes nextmail.WithTypes, nextmail.WithAddress and nextmail.WithLastEventID, and returns a *nextmail.LiveEventStream: range over its All(), or call Next, Event and Err. Leaving the loop of All(), Close or 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 as Retry-After asks 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 whose Type is nextmail.LiveEventReset, with its reason in Data. A 400, 401, 403, 404 or 422 ends it with the *nextmail.Error that Err returns.
  • Threads.WaitForEmail holds the request open until a message that matches arrives and returns it, the way a script waits for a sign-in code. nextmail.WithFromAddress and nextmail.WithSubject match text in the sender and in the subject, nextmail.WithAddress keeps the mail of one address, nextmail.WithSince sets the earliest arrival, and nextmail.WithWaitSeconds how long to wait, from 0 to 60 seconds and 30 when left out. It answers message_wait with the message_arrival, or null when nothing arrived in time, and waitedMs. 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 reads constants.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, none or temperror, and nil on an entry written before ARC was checked.
  • Calendar.ListCalendars, GetCalendar, CreateCalendar, UpdateCalendar and DeleteCalendar manage 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 a kind, one of the constants.CalendarKinds values. Deleting a calendar deletes its events, and your default calendar cannot be deleted. Calendar.SetCalendarMember and RemoveCalendarMember give a member "read" or "write" access to a calendar you keep, the constants.CollectionAccessLevels values, and access on a calendar, one of the constants.CollectionRights values, says what you may do with it. SetCalendarMember is retried after a network failure, since setting the same access twice leaves the same member, and CreateCalendar is not.
  • Calendar events and occurrences carry calendarId. Calendar.CreateEvent takes "calendarId" to put the event in a calendar and UpdateEvent takes it to move one, ListEvents, ListAllEvents and IterateEvents take nextmail.WithCalendarIDs to keep only some calendars, CreateFeed takes "calendarId" to publish one calendar and every feed says which, and ImportIcs takes nextmail.WithCalendarID for the calendar the events go into, which every import reports.
  • Contacts.ListAddressBooks lists your address book and the ones other members gave you access to, each with access, one of the constants.CollectionRights values. Contacts.SetAddressBookMember and RemoveAddressBookMember give a member "read" or "write" access to yours, the constants.CollectionAccessLevels values, and SetAddressBookMember is retried after a network failure. ListCards, ListAllCards and IterateCards take nextmail.WithAddressBook to read one you are a member of, and CreateCard takes "addressBook" to add to one you may write.
  • Traffic.List, ListAll and Iterate read 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 take WithDomainID, WithDirection, WithOutcomes, WithAddress, WithRecipient, WithSince and WithUntil. Outbound entries need emails:read and inbound ones threads:read.
  • Emails.SendRaw sends an RFC 5322 message you built yourself, as written: raw is its bytes as a []byte or an io.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, unless to, cc or bcc give the envelope. It takes the scheduling, tracking, signature, tag and lane options of Send, honours nextmail.WithIdempotencyKey, and never sends a Bcc header.
  • The email_received trigger of an automation takes senders, 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.Update takes labelAlerts, and Settings.Get returns it: label ids under each workspace id whose mail still alerts you while labelled mail stays out of your inbox.
  • MailboxProvidersOpenemail and MailServicesOpenemail ("openemail"): the provider of a mailbox on OpenEmail and the sentWith of a message sent with it.
  • sentWith stays 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, ListAll and Iterate read 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 take nextmail.WithKind, nextmail.WithLimit and nextmail.WithCursor, where the kind is one of the constants.ShareKinds values. ShareLinks.Get reads the link of one item, named by its kind and its id, ShareLinks.Set makes it public or changes "copyable", and ShareLinks.Delete makes it private again. Set is retried after a network failure, since an item keeps one link however often it is shared, and Delete is not. A private item answers 404 share_link_not_found.
  • Shared.Get reads what the public page of a link shows, from the token at its end and from any workspace, and Shared.Copy copies the item into this workspace as a draft. Copy is never retried, because a second call makes a second copy. An item its owner shares to look at only answers 403 share_not_copyable, and a link that no longer works answers 404 shared_item_not_found.
  • Tasks.List, ListAll and Iterate take nextmail.WithChatID to 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, so go get nextmail.sh installs 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() reads NEXTMAIL_API_KEY, NEXTMAIL_ACCESS_TOKEN and NEXTMAIL_BASE_URL, and takes WithAPIKey, WithAccessToken, WithAccessTokenFunc, WithBaseURL, WithHTTPClient, WithTimeout, WithMaxRetries, WithUserAgent and WithHeader. It never fails: a missing or malformed credential is reported by client.Err() and by the first call.
  • Every method takes a context.Context first, which cancels the call or gives it a deadline. Request bodies are nextmail.Body maps that keep the field names of the API, options are functions such as nextmail.WithLimit and nextmail.WithCursor, and results are nextmail.Object values with readers such as String, Int, Bool, Time and Object.
  • Every paginated resource has List for one page, ListAll for every item as a slice, and Iterate, which fetches the next page only when it gets there. Range over its All(), or call Next, Item and Err in a plain loop.
  • Failures come back as *nextmail.Error values with Status, Type, Code, Param, DocURL, RequestID, RetryAfter, Fields and Body, and errors.Is matches them against sentinels such as ErrNotFound, ErrValidation, ErrRateLimited, ErrStepUpRequired, ErrNetwork and ErrTimeout. A mistake in the call itself matches ErrInvalidArgument and 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-After is a minute or less. Every send carries an idempotency key that its retries reuse, and nextmail.WithIdempotencyKey sets 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, and client.Security.BeginStepUp and VerifyStepUp provide 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.VerifyWebhookSignature checks a webhook delivery in constant time, refuses one more than five minutes old and returns the event.
  • nextmail.NewTempMail builds a client for disposable inboxes that needs no credential, and client.Request calls an endpoint no method wraps, with the credential, timeout and retries of the client.
  • nextmail.ResolveLanguage, LanguageByCode, IsRTLLanguage, IsAPIKey, IsAccessToken and IsSealed are the helpers of the TypeScript SDK, and the constants package 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_ or nm_test_, and temporary inbox tokens nm_inbox_. The client refuses a key of any other shape.
  • Account.SetPhoto, Contacts.SetPhoto, Domains.SetAddressPhoto, Bookings.UploadBackground, Branding.UploadImage and Templates.UploadImage take images up to 100 MB, wait for them as long as Files.Upload does, and take nextmail.WithCrop: the part of the image to keep, as a nextmail.ImageCrop, sent as the crop query parameter.
  • Emails.ListEventsByMessageID, ListAllEventsByMessageID and IterateEventsByMessageID read 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 the msg_ id, such as a reply or a bounce report that quotes it. They take nextmail.WithAddress, nextmail.WithLimit and nextmail.WithCursor as ListEvents does and need emails:read, and a Message-ID that no message the key reaches went out with is a 404.
  • ProviderImports.List, ListAll and Iterate take nextmail.WithSource, one of the constants.ProviderImportProviders values, nextmail.WithStatus, one of the constants.ImportHistoryStatuses groups, and nextmail.WithSearch, up to 320 characters, the filters Imports.List takes, sent with every page. An import from a provider never pauses, so paused answers an empty page.
  • Emails.ListEvents, ListAllEvents and IterateEvents take nextmail.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.CreateLink takes nextmail.WithReuse: true hands 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, Update and Delete, Keys.Rotate for any key but the caller, and Workspaces.OfferOwnership, WithdrawOwnershipOffer, Account.AcceptOwnershipOffer and DeclineOwnershipOffer refuse an API key with 403 console_only, an error that matches nextmail.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 with Keys.Rotate or Me.Rotate, and revokes keys with Keys.Revoke.
  • AppHost.Get, Set and Verify report sender, where the emails sent to the people of the workspace come from: a map with address, domain and waitingOn. waitingOn is logo or signing, the constants.AppHostSenderWaits values, until they come from noreply@ the domain of the live web app address, and then null. sender is null on the free plan and until an address on a verified domain of the workspace is live.
  • Every address from Addresses.List, ListAll and Iterate reports role, one of the constants.AddressRoles values: owner on every address for an API key, and member or viewer for 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, with role owner, by a key of the workspace it belongs to.
  • Chats.ListMessages, ListAllMessages and IterateMessages read the messages of a chat, from the first unless nextmail.WithOrder is desc, one of the constants.ChatMessageOrders values. Each message has its text and its parts, of the kinds in constants.ChatMessagePartTypes: the words, the tools the assistant called with their arguments, results and status, one of the constants.ChatToolCallStatuses values, and the files. A tool result the caller may not read comes back redacted.
  • Chats.SendMessage says something in a chat, or starts one under a new id, and returns the chat turn once the assistant has answered. Its status, one of the constants.ChatTurnStatuses values, is awaiting_approval when a call that changes something waits in pendingToolCalls, which Chats.ApproveToolCall, with optional "args", or Chats.DenyToolCall answers, and "regenerate": true answers the last message again. Chats.StopTurn stops the assistant and answers stopped or idle, the constants.ChatStopStatuses values, and a stopped turn says why in stopReason, one of the constants.ChatStopReasons values. "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 are chat_busy, approval_pending, tool_not_offered, ai_quota_exceeded, ai_not_configured and assistant_unavailable.
  • A turn runs for at most 240 seconds, so Chats.SendMessage, ApproveToolCall and DenyToolCall wait at least 5 minutes for it, or the client timeout when that is longer, as uploads wait at least 10. nextmail.WithTimeout sets another wait for one call, and zero waits as long as it takes.
  • Members.GetDirectorySync reads directory sync (SCIM), through which a company directory adds people to the workspace and takes them out again, and Members.ConnectDirectorySync turns it on and returns its token once. Members.DisconnectDirectorySync turns it off, Members.ListDirectoryPeople reads who the directory synced, from 1 with nextmail.WithStartIndex and nextmail.WithCount, each in one of the constants.DirectoryPersonStates states, and Members.SetDirectoryDefaultRole and SetDirectoryGroupRole choose 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 holding workspace:manage reaches them, every change asks an OAuth access token for a verification code, and the refusals are plan_required, role_not_found and directory_sync_not_connected.
  • Security.GetPolicy reads whether the workspace requires two-factor sign-in and whether the person behind the client meets it, with no scope. Security.UpdatePolicy sets "requireTwoFactor", with members:write and a verification code.
  • Workspaces.GetOwnershipOffer, OfferOwnership and WithdrawOwnershipOffer let the owner offer the workspace to one of its members, and Account.ListOwnershipOffers, AcceptOwnershipOffer and DeclineOwnershipOffer answer the offers made to the person. Offering and accepting ask for a verification code. The refusals are ownership_offer_not_found, ownership_not_eligible, ownership_changed, domain_moving, two_factor_required and workspace_allowance_reached.
  • Account.SetName changes the name of the person. Account.ListPushDevices, RemovePushDevice and SendTestPush read the phones that get the person’s notifications, each with a platform from constants.PushPlatforms, stop one, and send a test. Account.EndConnectedAppElevation makes a connected app ask for verification codes again.
  • DNSConnections.Start returns 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 answers dns_unavailable.
  • Domains.CreateMailAppProfileLink makes a one-time link that sets an address up on an iPhone, iPad or Mac with a new app password. It needs members:write and a verification code, and past 10 links an hour it is profile_link_rate_limited. Domains.StartGravatarPublish returns the link that publishes the photo of an address to Gravatar, refused with photo_required and gravatar_not_configured.
  • Threads.SetReplying and ClearReplying show the team who is writing a reply. Threads.ListTracking reads the tracking report of every tracked message sent in a thread, and Threads.GetDelivery counts what bounced, was refused or was held back, both narrowed by nextmail.WithAddress. Threads.ListFileLinks, ListAllFileLinks and IterateFileLinks read the download links one message carried, with nextmail.WithIncludeRevoked. Threads.Counts takes nextmail.WithHideLabelled.
  • Senders.GetAvatar downloads the picture of a sender as bytes, and Senders.Get and Research report avatarUrl and avatarKind, one of the constants.SenderAvatarKinds values.
  • Emails.Send and SendBatch take "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.Translate takes "skipQuoted" and reports quotedHistoryKept. An attachment of Emails.Send can also be a map with "url" and optionally "filename" and "contentType", a file the server fetches once.
  • Emails.ListEvents, ListAllEvents, IterateEvents and GetTracking, and the opens and clicks methods of Tracking, take nextmail.WithAddress. Tracking.List, ListAll and Iterate take nextmail.WithOffsetMinutes, and Tracking.GetStats reports downloads, the files that went out as download links and how often they were fetched.
  • Templates.Update and ReplaceContent take "expectedUpdatedAt", and Templates.Publish takes nextmail.WithExpectedUpdatedAt: the updatedAt of the version you read, which refuses a change saved in between with 409 version_conflict. Every template version reports updatedAt.
  • Drafts.Create and Update take "attachments", up to 20 files inline or by "fileId", where bytes in "content" are encoded for you, and Drafts.Get reports the fileId of each file.
  • Filters: nextmail.WithRuleIDs on Rules.ListRuns, ListAllRuns and IterateRuns, nextmail.WithAudienceID on Contacts.List, ListAll and Iterate, nextmail.WithFrom and nextmail.WithTo on Contacts.Activity, nextmail.WithInactiveDays on Audiences.ListContacts, ListAllContacts and IterateContacts, nextmail.WithSince and nextmail.WithUntil on Audiences.Growth, Forms.Analytics and Bookings.Analytics, nextmail.WithSince on Broadcasts.Analytics and Broadcasts.Stats, nextmail.WithSource, nextmail.WithStatus, one of the constants.ImportHistoryStatuses groups, and nextmail.WithSearch on Imports.List, ListAll and Iterate, and nextmail.WithFromAddress on Signatures.List, ListAll and Iterate.
  • Contacts.SetAudiences and Audiences.AddContact take "createContact": true, which saves an address that is not a contact yet as one first and then needs contacts:write. Through an app a member connected, an address another member saved is a 409 contact_exists there and on Contacts.Save.
  • Scopes: Addresses.List, ListAll and Iterate need emails:read, or emails:send in its place. Audiences.ListContacts, ListAllContacts and IterateContacts need contacts:read as well as audiences:read. Emails.Compose, Rewrite, SuggestSubject and Translate take drafts:write in place of emails:send. Domains.GetMailAppSettings and ListAppPasswords need threads:read, and Domains.UpdateMailAppSettings needs threads:read and domains:write. Domains.CreateAddress asks an OAuth access token for a verification code when it chooses where the mail goes or deletion on expiry.
  • Domains.CreateAddress and Domains.UpdateAddress take "expiresAt" and "onExpiry", one of the constants.AddressExpiryActions values, and every address reports them with expiredAt. From its expiresAt an address takes no mail and sends none, a send from it is refused with 403 address_expired, and within a minute it is switched off, or deleted with the conversations delivered to it when onExpiry is delete. A later expiresAt, nil or "enabled": true turns a stopped address back on. constants.WebhookEventsAddressExpired is the event address.expired.
  • The constants.DomainAddressDestinations values gain webhook and group. The same two methods take "webhookId" for a webhook destination, "tapWebhookIds" to copy every message to up to 5 endpoints, and "groupPosting", one of the constants.AddressGroupPostingPolicies values, and "groupKeepCopy" for a group, and every address reports them. The refusals are webhook_not_found and too_many_taps.
  • constants.WebhookEventsEmailRouted is the event email.routed: a message that arrived at an address whose destination is webhook, 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 carries content and raw. routedBy says which sent it, with its kind one of the constants.WebhookRoutedSources values, recipient keeps the plus tag and verdicts are what the receiving server found. An email.received event carries tap, true when an endpoint gets the message as a tap of the address rather than through its subscription.
  • Domains.ListRoutes, ListAllRoutes and IterateRoutes read the pattern routes of a domain in the order they are tried, and Domains.CreateRoute, GetRoute, UpdateRoute and DeleteRoute manage them: a route catches mail to addresses nobody created whose local part matches its pattern, such as support-*, and delivers it to an address, forwards it once the destination confirms, posts it to a webhook as email.routed or reads it on another domain, as the constants.AddressRouteActions values say. active and inactiveReason, one of the constants.AddressRouteInactiveReasons values, say whether a route takes mail now. A domain holds at most 100 routes, and the refusals are invalid_route_pattern, route_pattern_taken, route_target_not_found and route_limit_reached. Domains.TestRoute answers which step decides mail to an address without sending anything, one of the constants.AddressRouteTestSteps values, with the route that decided and where the mail would end up.
  • Domains.ListGroupMembers, ListAllGroupMembers and IterateGroupMembers read the group members of a group address, and Domains.AddGroupMembers and RemoveGroupMember change them. A group member is an address of the workspace or an address at another provider, which confirms by email first, as the constants.GroupMemberKinds values say. A group holds at most 1,000 group members and groups nest at most 3 deep, and the refusals are not_a_group, group_member_limit, group_member_not_found and group_nesting_too_deep.
  • Domains.Update takes "aliasOf", which makes the domain an alias of another domain of the workspace, and every domain reports aliasOf and aliases. The refusals are alias_not_allowed, alias_chain and alias_has_addresses, and creating an address on an alias is refused with alias_has_addresses.
  • Domains.UpdateAddressLimits takes receiving.storageBytes, a storage quota for one address from 1 MiB to 1 TiB, and Domains.GetAddressLimits reports 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.GetAddressLimits also reports what the address keeps in usage.storage, with bytes and messages: 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, ListAllDeadLetters and IterateDeadLetters read 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.WithStatus reads the open ones by default, or replayed, discarded or all, the constants.WebhookDeadLetterFilters values. A dead letter is kept 30 days.
  • Webhooks.ReplayDeadLetters sends up to 100 open dead letters again in one call, the named ones or the oldest, and answers with an outcome for each, one of the constants.WebhookDeadLetterReplayOutcomes values. A delivered one is closed as replayed. Webhooks.DiscardDeadLetter closes one without sending it, and one already replayed is 409 dead_letter_resolved.
  • Webhooks.Create and Webhooks.Update take "retryPolicy", one of the constants.WebhookRetryPolicies values: standard tries a failed delivery up to 8 times over about 27 and a half hours, and extended up to 16 times over about 3 days. They also take "includeRaw": true, which needs threads:read, and every endpoint reports both.
  • Threads.GetRawMessage downloads the source of one message as message/rfc822 bytes, ready to save as an .eml file. It is the message byte for byte as it arrived when the address had keepOriginal on, and otherwise a source rebuilt from the stored message, the same bytes the IMAP server gives a mail app. The X-Message-Source response header says which, one of the constants.RawMessageSources values.
  • Domains.CreateAddress and Domains.UpdateAddress take "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.received event to an endpoint with includeRaw on carries data.raw: a link that downloads the message source for an hour, its size and its source, original or rebuilt.
  • Domains.GetAddressLimits and Domains.UpdateAddressLimits read 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. The constants.AddressHolds values list the holds.
  • Domains.Get and Domains.Update give each DNS record found, what public DNS answers at that name now, and problem, with a code from the constants.DomainRecordProblems values and a message to show a person.
  • Domains.Update takes "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 in autodiscoveryRecords.
  • Webhooks.Create and Webhooks.Update take "includeContent": true, which puts the message into every email.received event as data.content: the text, the HTML up to 512 KiB and each attachment with a link that downloads it for an hour. Turning it on needs threads:read.
  • A connected mailbox can be the sender of Emails.Send with 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.Counts leaves labelled mail out of team.assigned and team.unassigned, as the inbox does, unless the person has chosen to show labelled mail in the inbox.
  • List, ListAll and Iterate of Domains, Members, Keys, Webhooks and Rules, and ConnectedMailboxes.List, take nextmail.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.Stats reads 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.WithRuleIDs counts some rules only.
  • Billing.Get reports usage.addressChecks, the deep address checks used this calendar month against what the plan includes, and Billing.ListPlans each plan’s monthlyAddressChecks. Tools.CheckAddress and Tools.CheckAddresses with 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": ...}, with accept from constants.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 an email.suppressed webhook that names the reason, never as a bounce.
  • Forms check the address of every sign-up: Forms.Subscribe refuses one whose domain takes no mail with the field error undeliverable. refuseDisposable in the settings also refuses throwaway addresses (disposable), checkMailbox runs a deep check on every sign-up and refuses a missing mailbox (mailbox_not_found), and a refused address that looks like a typo carries suggestion.