Emails
Every operation in this group: what it accepts, what it returns and the errors it can answer with.
Operations
Send, schedule, cancel and retrieve.
POST/emails
Send an email
Sends now, or schedules with scheduledAt. Answers 200 when the message has already gone and 202 when something still has to happen to it, so a caller may branch on the status code. Honours Idempotency-Key.
The body can come from html, text, a stored template, or an existing draftId: one of the four, never two. originalMessage is quoted below it, and is enough on its own for a forward with nothing added.
Add translate to send it in the recipient's language rather than yours. It is resolved at accept time, before any record of the message exists, so a scheduled send carries the words that were approved and a translation that could not be produced refuses the send rather than delivering the original. Works with template, which is the useful case: the rendered output is what gets translated. See the Languages section, and POST /emails/translate to show somebody the result first.
Headers
Idempotency-KeystringMakes a retry safe. Reusing one with a different body is a 422.
Up to 255 charactersPattern^[A-Za-z0-9_.:-]+$
Request body
fromstring | objectRequiredSender as
[email protected],Acme Billing <[email protected]>or{ email, name }. It must be an address the key may send as, otherwise 403from_address_forbidden.emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
to(string | object)[]RequiredOne recipient or a list.
to,ccandbcctogether hold at most 50 addresses, and more is a 422too_many_recipients.1 to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
cc(string | object)[]Copy recipients, counted toward the 50 recipient ceiling.
Up to 50 itemsDefault[]emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
bcc(string | object)[]Blind copy recipients, counted toward the 50 recipient ceiling.
Up to 50 itemsDefault[]emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
replyTostring | objectWritten into the
Reply-Toheader.emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
subjectstringAt most 998 characters. Falls back to the template or draft subject when empty.
Up to 998 charactersDefault""htmlstringHTML body, at most 1,000,000 characters.
Up to 1000000 characterstextstringPlain text body, at most 1,000,000 characters.
Up to 1000000 characterstemplateobjectA stored template by id or slug. Omitting
versionresolves whatever is published at that moment, so pin it when somebody else owns the copy.idstringRequired- 1 to 128 characters
versioninteger- More than 0At most 100000
propsRecord<string, any>slotsRecord<string, any>
translateobject{ to, from?, includeOriginal?, subject? }.totakes a code, an English name or an endonym.includeOriginalandsubjectboth default to true.tostringRequired- 2 to 60 characters
fromstring- 2 to 60 characters
includeOriginalboolean- Default
true subjectboolean- Default
true
headersRecord<string, string>Custom headers limited to
X-*,List-*,Reply-To,Precedence,Auto-Submitted,Importance,PriorityandFeedback-ID. Anything the server sets itself is a 422reserved_header.Default{}attachmentsobject[]Up to 20 files, in three forms.
{ filename, content, contentType? }carries the file as base64, up to 10 MB for all of them together.{ url, filename?, contentType? }names a file at an https address, which is fetched once when the message is accepted, within 15 seconds and the 25 MB the message has room for; the name and type default to the last part of the path and the type the server answered with, and an address that cannot be fetched is a 422attachment_unreachable.{ fileId }names a file uploaded withPOST /files, up to 100 MB. A file given as base64 or byurlis kept with the message until it goes out, so it is never fetched twice and a retry of the send carries the same bytes.Up to 20 itemsDefault[]filenamestringRequired- 1 to 255 characters
contentstringRequired- 1 to 13981022 charactersPattern
^[A-Za-z0-9+/=\r\n]+$ contentTypestring- Up to 255 charactersPattern
^[\w.+-]+\/[\w.+-]+(?:[ \t]*;[ \t]*[\w.+-]+=(?:"[^"\r\n]*"|[\w.+-]+))*$
attachmentDeliverystringHow the files in
attachmentstravel.mimecarries them inside the message, the way mail always has, so files that come to more than 25 MB together are refused.linkuploads each file and puts a download link in the body in its place, so the message itself stays small.autolinks when the files together come to more than 25 MB, or to more than 2 MB when thefromdomain has an active files domain, and carries them inside the message otherwise. Left out, the sender's mailbox setting applies, and that defaults toauto. A download link uses the files domain when thefromdomain has one active and the default Nextmail host otherwise.One of"mime""link""auto"threadIdstringFiles the sent message into an existing thread.
Up to 256 charactersdraftIdstringSends an existing draft as written. Cannot be combined with
templateortranslate.Up to 256 charactersisForwardbooleanSends it as a forward, the way Forward in the app does: a signature it carries is the one the
fromaddress keeps for replies and forwards, as when the message answers a thread. Leave it out, andoriginalMessagetoo, to send a saved forward bydraftId: that draft quotes the email it forwards and brings its files by itself, and either field turns that off.originalMessagestringThe HTML of the email being forwarded or answered, put below the body as its quoted history, the way the app sends it. The signature goes above it. When this send is tracked, the open pixels of earlier mail are taken out of it and its links are never rewritten for click tracking, and when opens are tracked the pixel of this send goes after it. It counts as the body when
htmlandtextare left out, as for a forward with nothing added.Up to 1000000 charactersencryptionobjectMarks the message as one you sealed yourself, as the app does:
htmlortextthen holds one armored OpenPGP message and nothing else, and it goes out as PGP/MIME exactly as sealed, with no signature, tracking or rewriting.sealedAtis when you sealed it andsealedTothe address and key fingerprint of everyone it was sealed for. Nextmail never holds a private or public key for this and cannot seal or open the message, so seal it with your own OpenPGP library for the recipients' public keys and your own. It cannot be combined withtemplate,draftId,translate,originalMessageorattachments, which is a 422invalid_parameter, and once it is accepted its wording and recipients can no longer be edited.formatstringRequired- One of
"pgp-mime" sealedAtstringRequired- 1 to 64 characters
sealedToobject[]Required- 1 to 50 items
addressstringRequired- 3 to 320 characters
fingerprintstringRequired- 1 to 128 characters
scheduledAtstringA
Date, an ISO 8601 instant or a duration such asPT1HorP2D. At least one second and at most 365 days out.3 to 64 charactersfollowUpAtstringAsks to be reminded if nobody replies: an ISO 8601 instant, or a duration from now such as
P3D, later than the time the message goes out and at most 365 days out. If no real reply has arrived by then, the thread returns to the top of the inbox, unread, with a push.GET /follow-upslists the reminders andDELETE /follow-ups/{id}cancels one.3 to 64 characterscancellableForSecondsintegerAn undo window from 0 to 900 seconds on an immediate send. Refused alongside
scheduledAt, which is already cancellable until it goes.At least 0At most 900Default0trackingobjectOpen and link tracking for this send alone. A field left out takes the
fromaddress's own setting, then its domain's catch-all's when the catch-all caught that address rather than it being one you created, and is off when neither sets it. Set them per address withPATCH /settings?address=.opensbooleanclicksboolean
signaturebooleanAn
htmlbody goes out exactly as written, so it carries a signature only when this istrue, while atext-only body carries one unless this isfalse. When it is added it is the default signature of thefromaddress: the one it keeps for replies when the message answers a thread (threadIdor anIn-Reply-Toheader), and the one for new mail otherwise. An address with no signature of its own takes its domain catch-all's when the catch-all caught that address, else the Nextmail footer unless that address turned the footer off.signatureIdpicks another signature of the address. Template sends and encrypted sends never carry one.signatureIdstringAdds one particular signature of the
fromaddress in place of its default, by the idGET /signaturesreturns. It signs anhtmlbody too, sosignature: trueis not needed with it, and it cannot be combined withsignature: false. An id that is not a signature of thefromaddress is a 422invalid_parameter. When the signature is deleted before a scheduled message goes out, the message carries the default of the address instead.1 to 64 charactersstreamstringThe lane the message travels in.
transactional, the default, is for mail one person is waiting for, such as a password reset, a receipt or a code.broadcastis for newsletters and other mail to many people at once. Each lane has its own queue and its own reputation, so a newsletter never holds up or harms app mail, and the broadcast lane pauses itself when too many of its messages bounce or are reported as spam. A message sent to a paused lane is a 409stream_paused.On the broadcast lane, a message to one recipient that sets no
List-Unsubscribeheader of its own carriesList-UnsubscribeandList-Unsubscribe-Postfor one-click unsubscribe. Whoever uses it joins the unsubscribe list (GET /suppressions/unsubscribes), and broadcast lane mail is not sent to anybody on that list: the recipient is markedsuppressedandemail.suppressedsays why. Transactional mail still reaches them.One of"transactional""broadcast"tagsRecord<string, string>Up to 10 tags, keys of 1 to 64 letters, digits,
_or-, values up to 256 characters. Echoed back on every read.Default{}
Returns
Errors
- 409
domain_not_sendable: thefromdomain is known to this workspace but its signing records are not in DNS yet, so nothing was accepted. Ortranslation_not_configured: this workspace has no AI configured, sotranslatecannot be honoured.- 429
send_quota_exceeded: this workspace has spent the daily or monthly send allowance of its plan. On a free plan the daily allowance counts the sends of every free workspace of its owner together. The daily allowance resets at midnight UTC and the monthly one on the first of the month, andGET /limitsshows both. Orai_quota_exceeded: withtranslate, this workspace has used today's AI actions. Nothing was sent, and it resets at midnight UTC.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.- 503
The translator did not answer. Nothing was sent; the request is worth retrying.
The errors every operation can return400401403404422500Error catalog
Also available in
- TypeScript
emails.send()- Python
emails.send()- Ruby
emails.send- PHP
emails->send- Go
Emails.Send- Java
emails().send- C#
Emails.SendAsync- CLI
nextmail emails send- MCP
replyToEmailsendEmail
GET/emails
List sent messages
Newest first, a page at a time. A key limited to particular addresses or domains lists only the messages sent from addresses it covers, and that filter runs before the page is cut, so every page but the last is full.
Requires the emails:read scope.
Query parameters
statusstringOne or more of the values an email's
statustakes, comma-separated.bounced,partiallists every message that did not reach everybody it went to.fromstringA bare sending address such as
[email protected], matched exactly and case insensitively. A display name form does not match.broadcastIdstringOnly the copies of one broadcast, a
brd_id fromPOST /broadcasts. Every person a broadcast reaches gets a message of their own, so this is the list of who it went to and what happened to each copy. An id that names no broadcast answers an empty page.1 to 64 charactersscheduledFromstringOnly messages scheduled for this instant or later, ISO 8601 with a zone. With
scheduledToandstatus=scheduled,queuedit lists what is waiting to go out in a window, as the calendar of the app does. A message with noscheduledAtis left out.Formatdate-timescheduledTostringOnly messages scheduled for this instant or earlier.
scheduledFromafterscheduledTois a 422invalid_parameter.Formatdate-timesincestringOnly messages made at this instant or later, ISO 8601 with a zone.
Formatdate-timeuntilstringOnly messages made before this instant.
sinceafteruntilis a 422invalid_parameter.Formatdate-timerecipientstringOnly messages that went to this address, as a to, cc or bcc recipient. The whole address, matched exactly.
Up to 320 characterstagstringOnly messages sent with this tag:
namefor any value, orname:valuefor one value, astagsonPOST /emailsset them. Tags are stored encrypted, so the match is exact and case-sensitive.Up to 330 characterslimitintegerRows per page, a whole number from 1 to 100, defaulting to 25. Outside that range is a 422.
At least 1At most 100Default25cursorstringA message id. Keyset, not offset.
Returns
A page of messages, newest first.
Errors
The errors every operation can return400401403404422429500Error catalog
Also available in
- TypeScript
emails.list()emails.listAll()emails.iterate()- Python
emails.list()emails.list_all()emails.iterate()- Ruby
emails.listemails.list_allemails.iterate- PHP
emails->listemails->listAllemails->iterate- Go
Emails.ListEmails.ListAllEmails.Iterate- Java
emails().listemails().listAllemails().iterate- C#
Emails.ListAsyncEmails.ListAllAsyncEmails.IterateAsync- CLI
nextmail emails list- MCP
listSentEmails
POST/emails/raw
Send a raw email
Sends a message you built yourself, as raw: the bytes of an RFC 5322 message, base64-encoded. It goes out as written, with its own headers, threading, attachments, calendar parts and signed or encrypted parts, through the same checks as POST /emails: the address the key may send as, the send allowance, the address limits, suppressions and the lane. Answers 200 when the message has already gone and 202 when it is queued or scheduled. Honours Idempotency-Key, which covers the bytes too.
The sender is the address in its From header, and from may only repeat it. The recipients are its To, Cc and Bcc headers, unless to, cc or bcc are given: then those are the envelope, as with SMTP, and the headers are left as written. A Bcc header never leaves, and neither do Authentication-Results and ARC- headers, which only the receiving side may write. A message without a Message-ID or a Date gets one. A bare line feed is sent as CRLF.
It carries no signature unless signature is true or signatureId names one, and its links and opens are tracked as the from address is set to, or as tracking says, except when the message is signed or encrypted, which is never rewritten. A raw message can be scheduled with scheduledAt, and until it goes its recipients and its time can change but its wording cannot (raw_message_locked). A refused message is a 422: invalid_parameter when raw is not base64, is not a message with a From address, names no recipient, or from is not its From address, with param naming the field; message_too_large over the raw limit; too_many_recipients past 50; and idempotency_key_reuse when the key went with a different message. The largest raw message the API takes is 10 MB; SMTP with an API key takes 25 MB.
Headers
Idempotency-KeystringMakes a retry safe. Reusing one with different bytes or options is a 422.
Up to 255 charactersPattern^[A-Za-z0-9_.:-]+$
Request body
rawstringRequiredThe message: the bytes of an RFC 5322 message, base64-encoded, at most 10 MB once decoded. Line breaks inside the base64 are allowed.
1 to 14348938 charactersfromstring | objectThe address in the From header of the message, to make sure it is the one sending. Leave it out to send as that address; anything else is a 422
invalid_parameter.emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
to(string | object)[]The envelope, as SMTP RCPT TO: give
to,ccorbccand they replace the recipients the headers name, and the headers go out as written. Left out, the message goes to its To, Cc and Bcc headers. At most 50 recipients together.Up to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
cc(string | object)[]Copy recipients of the envelope. See
to.Up to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
bcc(string | object)[]Blind copy recipients of the envelope. See
to. A Bcc header in the message is never sent.Up to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
threadIdstringFiles the sent copy into an existing thread. Left out, the In-Reply-To and References headers decide, as for mail that arrives.
Up to 256 charactersscheduledAtstringA
Date, an ISO 8601 instant or a duration such asPT1HorP2D. At least one second and at most 365 days out. The bytes are kept until then.3 to 64 charactersfollowUpAtstringAsks to be reminded if nobody replies, as on
send: later than the time the message goes out and at most 365 days out.3 to 64 characterscancellableForSecondsintegerAn undo window from 0 to 900 seconds on an immediate send. Refused alongside
scheduledAt.At least 0At most 900Default0trackingobjectOpen and link tracking for this send alone. A field left out takes the setting of the From address. A signed or encrypted message is never rewritten, so it is never tracked.
opensbooleanclicksboolean
signaturebooleanAdds the default signature of the From address to the message when true. A raw message carries none otherwise, and a signed or encrypted message is never rewritten.
signatureIdstringAdds one particular signature of the From address, by the id
GET /signaturesreturns. It cannot be combined withsignature: false.1 to 64 charactersstreamstringThe lane the message travels in,
transactional(the default) orbroadcast, as onPOST /emails.One of"transactional""broadcast"tagsRecord<string, string>Up to 10 tags, keys of 1 to 64 letters, digits,
_or-, values up to 256 characters. Echoed back on every read.Default{}
Returns
Errors
- 409
domain_not_sendable: the domain of the From address is known to this workspace but its signing records are not in DNS yet, so nothing was accepted. Orstream_paused: the lane it would travel in is paused.- 429
send_quota_exceeded: this workspace has spent the daily or monthly send allowance of its plan. The daily allowance resets at midnight UTC and the monthly one on the first of the month, andGET /limitsshows both.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.
The errors every operation can return400401403404422500Error catalog
Also available in
- TypeScript
emails.sendRaw()- Python
emails.send_raw()- Ruby
emails.send_raw- PHP
emails->sendRaw- Go
Emails.SendRaw- Java
emails().sendRaw- C#
Emails.SendRawAsync- CLI
nextmail emails send-raw
POST/emails/batch
Send up to 100 messages
Per item, never all-or-nothing: a batch that rolled back on one bad address would make the caller's retry a question of which messages had already gone. Honours Idempotency-Key.
Headers
Idempotency-KeystringMakes a retry of the whole batch safe. Each message is keyed as the key, a slash and its index, so a retry with the same key replays the messages that already went, with
replayed: true, and sends only the rest. Reusing it with a different message at an index refuses that item withidempotency_key_reuse.Up to 255 charactersPattern^[A-Za-z0-9_.:-]+$
Request body
emailsSendEmailRequest[]- Up to 100 items
Returns
Per-item results, in the order the messages were sent.
Errors
- 429
This workspace has spent the monthly send allowance of its plan, which counts sends from this workspace alone. It resets on the first of the month.
rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.
The errors every operation can return400401403404422500Error catalog
Also available in
POST/emails/translate
Translate a message without sending it
The same round trip translate makes on a send, stopped one step early. The same function produces both, so what this shows is what would go out.
No scope of its own, deliberately. It grants nothing a sender could not already do, and a scope nobody can tell apart from emails:send on a consent screen makes every other scope on that list mean slightly less. As in the composer of the app, drafts:write does in place of emails:send.
To translate a message somebody received, as the app does when you read one in another language, send its html with skipQuoted: true. The quoted history below the message is then left as it is, at the end of html and in its own language, and quotedHistoryKept says whether there was any. A call that sets skipQuoted: true also works with threads:read, the scope that reads that mail in the first place.
The body is capped at the same megabyte the send path allows, but translation itself refuses anything over 30,000 characters with translation_too_long. That is a refusal and not a truncation on purpose: half a translated message has no seam to show where it stopped, and the person reading acts on the half they were given.
Requires the emails:send scope, or drafts:write in its place.
Request body
htmlstringHTML body to translate. Only the content inside
<body>is sent to the model when the markup is a full document.Up to 1000000 characterstextstringPlain text body to translate. Translated separately when given alongside
html.Up to 1000000 characterssubjectstringSubject line to translate, at most 998 characters.
Up to 998 characterstostringRequiredTarget language as a code (
de), English name (German) or endonym (Deutsch). An unrecognised value is a 422invalid_parameteronto.2 to 60 charactersfromstringThe language you wrote in. Stating it skips the detection call.
2 to 60 charactersincludeOriginalbooleanDefaults to true, placing your original text below the translation under a caption in the target language.
DefaulttrueskipQuotedbooleanTrue translates
htmlwithout the quoted history below it, the replies a message quotes inblockquoteor a quoted section, and puts that history back at the end ofhtmlas it was. Left out or false, everything inhtmlis translated. It changes nothing intext.
Returns
The translation. Nothing was sent.
Errors
- 409
This workspace has no AI configured, so nothing can be translated.
- 429
ai_quota_exceeded: this workspace has used today's AI actions. It resets at midnight UTC.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.- 503
The translator did not answer. Nothing was sent; the request is worth retrying.
The errors every operation can return400401403404422500Error catalog
Also available in
POST/emails/check
Check how a message would be rated, without sending it
Scores a message the way a receiving mailbox would, before you send it: a spam score, a phishing score and an AI-writing score, each 0 to 100, with the signals behind them. Run it while someone writes, or before an automated send, and fix what it names.
The same checks score every message that arrives in a mailbox on Nextmail, so what you see here is what a recipient on Nextmail sees in Details. It cannot know a recipient's own filter, sender history or reputation, so a low score is a good sign and not a delivery guarantee.
No scope of its own, for the same reason as the translation preview: it grants nothing a sender could not already do. It spends no AI action and never calls a model.
Requires the emails:send scope.
Request body
fromstringThe address it will be sent from.
Up to 320 charactersfromNamestringThe display name it will carry. A name that claims another address or a known brand raises the phishing score.
Up to 320 charactersreplyTostringA Reply-To on a different domain raises the phishing score.
Up to 320 characterssubjectstringSubject line, at most 998 characters.
Up to 998 charactersDefault""htmlstringHTML body. Links and images are read from it.
Up to 200000 characterstextstringPlain text body. Taken from
htmlwhen left out.Up to 200000 charactersreplyingbooleanTrue when it answers an existing thread. A
Re:subject on a message that answers nothing raises the spam score.attachmentNamesstring[]File names, so an attachment that can run code is caught.
Up to 100 items
Returns
The scores. Nothing was stored or sent.
Errors
The errors every operation can return400401403404422429500Error catalog
Also available in
- TypeScript
emails.check()- Python
emails.check()- Ruby
emails.check- PHP
emails->check- Go
Emails.Check- Java
emails().check- C#
Emails.CheckAsync- CLI
nextmail emails check- MCP
checkEmail
GET/emails/{id}
Retrieve a message
A key that holds emails:send but not emails:read may read the messages it sent itself, so it can follow what became of them, as the composer of the app follows a message it just sent. It gets them without tracking, and any other message is a 404.
Requires the emails:read scope.
Path parameters
idstringRequiredThe send id,
msg_followed by 24 hex characters, as returned bysend.
Returns
The message, with per-recipient state.
Errors
The errors every operation can return400401403404422429500Error catalog
Also available in
- TypeScript
emails.get()- Python
emails.get()- Ruby
emails.get- PHP
emails->get- Go
Emails.Get- Java
emails().get- C#
Emails.GetAsync- CLI
nextmail emails get- MCP
getSentEmail
PATCH/emails/{id}
Change a message that has not gone yet
Moves it with scheduledAt, and changes what it says or who it goes to with subject, html, text, from, to, cc and bcc, while it is still queued or scheduled. Send any of them together. A recipient list replaces the stored one whole, and from is checked as it is on a send, so it has to be an address the key may send as. A message that was translated when it was accepted keeps its wording, and one that was encrypted keeps its wording and its recipients: cancel it and send again instead.
Path parameters
idstringRequiredThe
msg_send id to move.
Request body
scheduledAtstringWhen it goes out instead: an ISO 8601 instant, or a duration such as
PT2H, up to a year out.3 to 64 characterssubjectstringThe new subject, up to 998 characters.
Up to 998 charactershtmlstringThe new HTML body.
Up to 1000000 characterstextstringThe new plain text body.
Up to 1000000 charactersfromstringThe address it goes out as, checked as it is on a send.
3 to 320 charactersto(string | object)[]Replaces the stored recipients whole. So do
ccandbcc.1 to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
cc(string | object)[]Replaces the copied recipients.
Up to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
bcc(string | object)[]Replaces the blind copied recipients.
Up to 50 itemsemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
Returns
The message as it is now.
Errors
- 409
email_not_cancellable: it has already gone or was cancelled.translation_locked: it was translated when it was accepted, so its wording cannot change.
The errors every operation can return400401403404422429500Error catalog
Also available in
- TypeScript
emails.reschedule()emails.update()- Python
emails.reschedule()emails.update()- Ruby
emails.rescheduleemails.update- PHP
emails->rescheduleemails->update- Go
Emails.RescheduleEmails.Update- Java
emails().rescheduleemails().update- C#
Emails.RescheduleAsyncEmails.UpdateAsync- CLI
nextmail emails reschedulenextmail emails update- MCP
rescheduleEmailupdateScheduledEmail
POST/emails/{id}/cancel
Cancel a message
Idempotent: cancelling twice returns the same cancelled message. A 409 means it has already gone and cannot be un-sent.
An app a member connected cancels any message that went out from an address the member reaches, whoever sent it, as the calendar of the app does with a scheduled message. A key or app limited to particular addresses reaches only messages sent from them, and any other message is a 404.
Path parameters
idstringRequiredThe
msg_send id to cancel.
Returns
Cancelled.
Errors
- 409
No longer cancellable.
The errors every operation can return400401403404422429500Error catalog
Also available in
- TypeScript
emails.cancel()- Python
emails.cancel()- Ruby
emails.cancel- PHP
emails->cancel- Go
Emails.Cancel- Java
emails().cancel- C#
Emails.CancelAsync- CLI
nextmail emails cancel- MCP
cancelEmail
GET/emails/{id}/events
What happened to a message
The event trail, oldest first, one page at a time. Nothing is dropped from it: a tracked message records an event for every counted open, click and download, so a widely read message runs to many pages, and following nextCursor while hasMore is true reaches the newest event.
Requires the emails:read scope.
Path parameters
idstringRequiredThe
msg_send id whose trail to read.
Query parameters
limitintegerRows per page, 1 to 100.
At least 1At most 100Default25cursorstringAn event id. Keyset, not offset: pass the previous page's
nextCursor. One that names nothing in this list is a 400invalid_cursor.addressstringAnswer only when the message was sent from this address, the address filter of the tracking page. A message sent from another address, or an address the key does not reach, is a 404.
3 to 320 charactersmessageIdstringAnswer only when the message went out with this Message-ID header, with or without its angle brackets, the header the app reads a trail by. A message that went out with another one, or has not gone out yet, is a 404.
GET /emails/eventsfinds the trail by this header alone.1 to 998 characters
Returns
A page of the event trail, oldest first.
Errors
The errors every operation can return400401403404422429500Error catalog
Also available in
- TypeScript
emails.listEvents()emails.listAllEvents()emails.iterateEvents()- Python
emails.list_events()emails.list_all_events()emails.iterate_events()- Ruby
emails.list_eventsemails.list_all_eventsemails.iterate_events- PHP
emails->listEventsemails->listAllEventsemails->iterateEvents- Go
Emails.ListEventsEmails.ListAllEventsEmails.IterateEvents- Java
emails().listEventsemails().listAllEventsemails().iterateEvents- C#
Emails.ListEventsAsyncEmails.ListAllEventsAsyncEmails.IterateEventsAsync- CLI
nextmail emails list-events- MCP
listEmailEvents
GET/emails/events
What happened to a message, found by its Message-ID
The event trail GET /emails/{id}/events serves, for a caller that holds the Message-ID header a message went out with and not its msg_ id, such as a reply or a bounce report that quotes it. It is the header the app reads a trail by. Oldest first, one page at a time, and nothing is dropped from it, so following nextCursor while hasMore is true reaches the newest event.
A key or an app limited to particular addresses reaches only the messages sent from the addresses it covers, as on GET /emails/{id}/events.
Requires the emails:read scope.
Query parameters
messageIdstringRequiredThe Message-ID header the message went out with, with or without its angle brackets. A message gets one when it goes out, so one that has not gone out yet cannot be found by it, and a Message-ID no message of this workspace went out with is a 404.
1 to 998 characterslimitintegerRows per page, 1 to 100.
At least 1At most 100Default25cursorstringAn event id. Keyset, not offset: pass the previous page's
nextCursor. One that names nothing in this list is a 400invalid_cursor.addressstringAnswer only when the message was sent from this address, the address filter of the tracking page. A message sent from another address, or an address the key does not reach, is a 404.
3 to 320 characters
Returns
A page of the event trail of the message that went out with that Message-ID, oldest first.
Errors
- 404
No message this key reaches went out with that Message-ID. That covers a Message-ID no message of this workspace went out with, and a message sent from another address than
addressor from one the key does not reach.- 422
invalid_parameter, withparamnaming the field:messageIdis missing, empty or longer than 998 characters, orlimit,cursororaddressis outside the bounds given for it.
The errors every operation can return400401403429500Error catalog
Also available in
- TypeScript
emails.listEventsByMessageId()emails.listAllEventsByMessageId()emails.iterateEventsByMessageId()- Python
emails.list_events_by_message_id()emails.list_all_events_by_message_id()emails.iterate_events_by_message_id()- Ruby
emails.list_events_by_message_idemails.list_all_events_by_message_idemails.iterate_events_by_message_id- PHP
emails->listEventsByMessageIdemails->listAllEventsByMessageIdemails->iterateEventsByMessageId- Go
Emails.ListEventsByMessageIDEmails.ListAllEventsByMessageIDEmails.IterateEventsByMessageID- Java
emails().listEventsByMessageIdemails().listAllEventsByMessageIdemails().iterateEventsByMessageId- C#
Emails.ListEventsByMessageIdAsyncEmails.ListAllEventsByMessageIdAsyncEmails.IterateEventsByMessageIdAsync- CLI
nextmail emails list-events-by-message-id- MCP
listEmailEvents
GET/threads/{id}/delivery
Whether the mail sent in a thread arrived
What became of the mail this workspace sent in the thread, counted over every recipient of every message: how many bounced, reported it as spam, could not be sent to, or were held back by the suppression list, and how many messages reached only some of their recipients. It is the delivery warning the app shows on a thread. A thread with no trouble answers zeroes beside the number of recipients, and a thread this workspace sent nothing in answers zero recipients. GET /emails/{id}/events tells the story of one message.
A key or an app limited to particular addresses counts only the messages sent from the addresses it covers.
Requires the emails:read scope.
Path parameters
idstringRequiredThe thread, as
GET /threadsreturns it.
Query parameters
addressstringCount only the messages sent from this address. One the key does not reach counts nothing rather than failing.
3 to 320 characters
Returns
The counts for the thread.
Errors
The errors every operation can return400401403404422429500Error catalog
Also available in
POST/emails/compose
Write an email with AI
Writes the body of an email from prompt, an instruction or a few rough notes, in the style of the mail this workspace has sent before, as the composer of the app does. Give threadId to write a reply: the messages of that thread are read as context, which also needs threads:read. Give draft, the body written so far, to have prompt change it instead, and withSubject to get a subject as well. Give send, the send options as they stand, to let prompt change them too, as the describe bar of the composer does: the recipients, when it sends, tracking, the signature, the language, the address it goes out as (give from and send.fromOptions) and end-to-end encryption (give send.encrypt). Give templates: true to let prompt switch it to one of the workspace's published templates, which needs templates:read, and files: true to let it attach files the workspace holds, which needs files:read. The answer then carries send with only what changed, in the shape POST /emails takes, and times are read in timeZone or the time zone of the account. Nothing is saved or sent: pass the result to POST /emails or POST /drafts. It spends one AI action. As in the composer of the app, someone who may write drafts but not send can use it too.
Requires the emails:send scope, or drafts:write in its place.
Request body
promptstringRequiredWhat to write: an instruction, a rough draft or a few notes. With
draft, what to change in it, and it may be empty to have the draft finished as it is.Up to 20000 characterssubjectstringThe subject so far, if there is one.
Up to 998 charactersfromstringThe address it goes out as, so it is written as that address.
1 to 320 characterstemplatestringThe id of the template the email uses now. Its body is then the template, so
promptleaves the body alone.1 to 128 characterstemplatesbooleanLet
promptswitch the email to one of the workspace's published templates, which needstemplates:read. The answer names it intemplate.filesbooleanLet
promptattach files the workspace holds, which needsfiles:read. The answer lists them inattach, each ready to send as{ "fileId": id }.withSubjectbooleanAlso write a subject. The answer then carries
subject: a new one when there was none orpromptasks for one, otherwise the one given.draftstringThe body written so far, as text or Markdown.
promptthen says what to change, andbodycomes back as the whole draft with that change made.Up to 20000 characterstostring[]Who it goes to, so the greeting and tone fit.
Up to 50 itemsccstring[]Who is copied.
Up to 50 itemsbccstring[]Who is blind copied.
Up to 50 itemssendobjectThe send options as they stand. Give it, even empty, to let
promptchange them: the answer then carriessendwith what changed.scheduledAtstringWhen it is set to send, as an ISO-8601 time, or null when it sends right away.
Can be nullUp to 64 characterstrackingobjectWhether opens and clicks are tracked as it stands.
opensbooleanclicksboolean
signaturebooleanWhether the signature is added as it stands.
translateobjectThe language it is translated into as it stands, or null when it is not.
Can be nulltostringRequiredA language code such as
de, or a language name.2 to 60 characters
fromOptionsstring[]The addresses it may go out as.
promptcan then move it to one of them, and the answer names it insend.from.Up to 100 itemsencryptbooleanWhether it is encrypted end to end as it stands. Give it only when every recipient can receive encrypted mail, so
promptcan turn encryption on or off.
timeZonestringThe IANA time zone to read times in, such as
Europe/Berlin. Without it, the time zone in the account settings.1 to 64 charactersthreadIdstringA thread to reply in. Its messages are read as context, and it needs
threads:read.1 to 200 characters
Returns
The body that was written.
Errors
- 409
ai_not_configured: AI writing is not available on this server.- 429
ai_quota_exceeded: this workspace has used the AI actions of its plan for today. Nothing was written, and it resets at midnight UTC.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.
The errors every operation can return400401403404422500Error catalog
Also available in
- TypeScript
emails.compose()- Python
emails.compose()- Ruby
emails.compose- PHP
emails->compose- Go
Emails.Compose- Java
emails().compose- C#
Emails.ComposeAsync- CLI
nextmail emails compose- MCP
composeEmail
POST/emails/rewrite
Rewrite part of an email with AI
Rewrites a subject or a body and answers with up to five different versions, as the rewrite menu of the composer does. action is shorten, lengthen, rephrase, formal, casual or custom, which needs instruction to say what to change. Give threadId when the text is a reply, so the rewrite fits the conversation: its messages are read as context, which also needs threads:read. Nothing is saved. It spends one AI action. As in the composer of the app, someone who may write drafts but not send can use it too.
Requires the emails:send scope, or drafts:write in its place.
Request body
targetstringbodyorsubject. Defaults tobody.One of"subject""body"Default"body"textstringRequiredThe subject or body to rewrite.
1 to 100000 charactersactionstringRequiredWhat to do:
shorten,lengthen,rephrase,formal,casualorcustom.One of"shorten""lengthen""rephrase""formal""casual""custom"instructionstringWhat to change, up to 500 characters. Required with
custom.Up to 500 characterscountintegerHow many versions, 1 to 5. Defaults to 3.
At least 1At most 5Default3threadIdstringThe thread the text replies in, read as context.
1 to 200 characters
Returns
The versions, best first.
Errors
- 409
ai_not_configured: AI writing is not available on this server.- 429
ai_quota_exceeded: this workspace has used the AI actions of its plan for today. Nothing was written, and it resets at midnight UTC.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.
The errors every operation can return400401403404422500Error catalog
Also available in
- TypeScript
emails.rewrite()- Python
emails.rewrite()- Ruby
emails.rewrite- PHP
emails->rewrite- Go
Emails.Rewrite- Java
emails().rewrite- C#
Emails.RewriteAsync- CLI
nextmail emails rewrite- MCP
rewriteEmail
POST/emails/subject
Suggest a subject line
Reads the body of an email and suggests a short subject for it, under 100 characters, in the style of the mail this workspace has sent. Nothing is saved. It spends one AI action. As in the composer of the app, someone who may write drafts but not send can use it too.
Requires the emails:send scope, or drafts:write in its place.
Request body
messagestringRequiredThe body of the email, as text or HTML.
1 to 100000 characters
Returns
The suggested subject.
Errors
- 409
ai_not_configured: AI writing is not available on this server.- 429
ai_quota_exceeded: this workspace has used the AI actions of its plan for today. Nothing was written, and it resets at midnight UTC.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.
The errors every operation can return400401403404422500Error catalog
Also available in
POST/emails/scan
Scan an email for phishing, fraud and prompt injection
Reads an email with the model that checks every message arriving in a mailbox on Nextmail, and answers what it found. Send the message as raw, the whole MIME source, on its own, or as subject, html or text, with from and fromName when you have them.
Six signals come back, each a probability from 0 to 1: credentials (it asks for a sign-in, a code, a recovery phrase or card details), payment (a fee, gift cards, crypto or new bank details), lure (click to claim a prize or a refund, or to fix an account), impersonation (it claims to be a bank, a delivery company, a service, an office or the reader's boss, from an address on an unrelated domain), pressure (a threat or a deadline) and injection (text aimed at an AI assistant or agent rather than at a person). verdict reads them as the mailbox does. It is phishing when the email asks for something and pretends to be someone it is not, and a mailbox files it in Spam at a confidence of 0.85 or more. It is suspicious when the email carries instructions for an AI, asks under pressure or pretends strongly, and safe otherwise. injection is true from 0.5: hand such an email to an agent as data, never as instructions.
The model reads the subject, the sender, up to 10 links, the first 2,000 characters of the visible text and what the HTML hides in comments, with every other address masked. Sender authentication cannot be checked on an email you pass in, so it is read as unknown. Nothing is stored but a hash of what the model read and its answer, kept 7 days for this workspace alone, so the same email gets the same answer.
Every 100 scans spend one AI action. The AI actions the plan includes each day come first, and past them pay as you go bills scans like any other AI action, $0.05 per 1,000 scans. A scan the model did not answer is not counted. A key that may read mail, send it or write drafts can scan.
Requires the threads:read scope, or emails:send or drafts:write in its place.
Request body
rawstringThe whole message as MIME source, headers included. Send it on its own.
Up to 5000000 characterssubjectstringThe subject line.
Up to 998 charactersfromstringThe address it came from.
Up to 320 charactersfromNamestringThe name it came under, which the impersonation signal reads.
Up to 320 charactershtmlstringThe HTML body. Its links and what it hides in comments are read too.
Up to 1000000 characterstextstringThe plain text body, read when there is no html.
Up to 1000000 characters
Returns
What the scan found.
Errors
- 429
ai_quota_exceeded: the scans would pass the AI actions of the day and pay as you go cannot cover them. Nothing was scanned, and the allowance resets at midnight UTC.rate_limited: the workspace's keys and apps together made more requests in 60 seconds than its limit, 1,000 on Starter, 5,000 on Pro and 10,000 on Max, unless the workspace has a limit of its own. Wait for the seconds inRetry-After. A request refused this way is not billed. Answered requests are billed at theapiRequestsrate of the plan while pay as you go is on. Per 1,000,000 requests that is $0.50 on Starter, $0.30 on Pro and $0.20 on Max.- 503
email_scan_unavailable: the model did not answer in time, so the scan was not counted. Try again in a moment.
The errors every operation can return400401403404422500Error catalog
Also available in
- TypeScript
emails.scan()- Python
emails.scan()- Ruby
emails.scan- PHP
emails->scan- Go
Emails.Scan- Java
emails().scan- C#
Emails.ScanAsync- CLI
nextmail emails scan
Objects
BatchSendItemobject
indexintegerRequiredWhere the message sat in
emails.At least 0statusstringRequired- One of
"ok""error" emailobjectThe message, when
statusisok.objectstring- One of
"email" idstringThe durable handle,
msg_+ 24 hex.statusstringWhere the message is in its life.
sentmeans it left: the sending service took it, which is not yet delivery, and a bounce reported afterwards still moves it on.bouncedmeans every recipient it went to bounced, so nobody has it, and each entry inrecipientscarries the reason.partialmeans some recipients have it and some do not, whether the transport stopped part way or some of them bounced later; retrying is wrong, because the ones who have it cannot be un-sent.One of"queued""scheduled""sending""sent""partial""bounced""cancelled""failed"modestring- One of
"live""test" fromstringsubjectstring- Can be null
messageIdstringRFC 5322 Message-ID. Null until the MIME exists. Do NOT correlate on it: the header is rewritten on the way out, so the value here appears in no bounce or delivery report and a match on it never fires. A delivery event names the send by its
id, asemailId.Can be nullthreadIdstring- Can be null
transportstringHow the bytes left, once they have. Null until dispatch.
testis what a message sent with annm_test_key records: it was accepted and every recipient marked delivered, but nothing was carried.devis not a way of sending either: it is what a message records where nothing is configured to carry mail, having been built and sent nowhere.connectedmeans it left through the outgoing server of a connected mailbox, such as Gmail, and not through Nextmail.Can be nullOne of"ses""test""dev""connected"attemptsintegerlastErrorstring- Can be null
scheduledAtstring- Can be nullFormat
date-time cancellableUntilstring- Can be nullFormat
date-time sentAtstring- Can be nullFormat
date-time tagsRecord<string, string>broadcastIdstringThe
brd_broadcast this message is one copy of, or null for a message sent on its own.GET /emails?broadcastId=lists every copy of one broadcast.Can be nullsourcestring- One of
"api""oauth""composer""mcp""ai""form""mail-app""booking" streamstringThe lane the message travels in:
transactionalfor app mail,broadcastfor newsletters and every copy of a broadcast.One of"transactional""broadcast"createdAtstring- Format
date-time recipientsobject[]Returned on retrieval only.
emailstringnamestring- Can be null
kindstring- One of
"to""cc""bcc" statusstringuncertainis real and is shown as itself: a transport that failed part-way cannot say which recipients it reached, and calling those delivered or failed would both be guesses.suppressedis decided before dispatch rather than reported afterwards: the address bounced or complained in this workspace before, so this copy was never offered to the transport. A message whose recipients are all suppressed fails outright.One of"pending""delivered""failed""bounced""complained""suppressed""uncertain"errorstring- Can be null
deliveredAtstring- Can be nullFormat
date-time
translationobjectPresent only when the message was translated, and only on responses that carry the stored request, which are the send itself and a retrieval. A list row does not fetch it, so its absence there says nothing either way.
languagestringThe resolved target code:
de,pt-BR.languageNamestringIts English name.
detectedSourceLanguagestringStated or detected. Null when detection abstained.
Can be nullsubjectbooleanWhether the subject was translated too.
includeOriginalbooleanWhether the sender's own words went below the translation.
trackingTrackingreplayedbooleanTrue when an
Idempotency-Keyreplayed an earlier send of this item.
errorobjectWhy the message was refused, when
statusiserror: the fields of a whole-request error, withoutrequestId.typestringRequired- One of
"invalid_request_error""authentication_error""permission_error""not_found_error""conflict_error""validation_error""rate_limit_error""api_error" codestringRequiredmessagestringRequiredparamstringThe offending field, dotted.
BatchSendResultobject
objectstringRequired- One of
"list" dataBatchSendItem[]RequiredOne entry per message, in the order they were sent.
sentintegerRequiredHow many messages were accepted.
At least 0failedintegerRequiredHow many were refused. Their entries say why.
At least 0
Emailobject
objectstring- One of
"email" idstringThe durable handle,
msg_+ 24 hex.statusstringWhere the message is in its life.
sentmeans it left: the sending service took it, which is not yet delivery, and a bounce reported afterwards still moves it on.bouncedmeans every recipient it went to bounced, so nobody has it, and each entry inrecipientscarries the reason.partialmeans some recipients have it and some do not, whether the transport stopped part way or some of them bounced later; retrying is wrong, because the ones who have it cannot be un-sent.One of"queued""scheduled""sending""sent""partial""bounced""cancelled""failed"modestring- One of
"live""test" fromstringsubjectstring- Can be null
messageIdstringRFC 5322 Message-ID. Null until the MIME exists. Do NOT correlate on it: the header is rewritten on the way out, so the value here appears in no bounce or delivery report and a match on it never fires. A delivery event names the send by its
id, asemailId.Can be nullthreadIdstring- Can be null
transportstringHow the bytes left, once they have. Null until dispatch.
testis what a message sent with annm_test_key records: it was accepted and every recipient marked delivered, but nothing was carried.devis not a way of sending either: it is what a message records where nothing is configured to carry mail, having been built and sent nowhere.connectedmeans it left through the outgoing server of a connected mailbox, such as Gmail, and not through Nextmail.Can be nullOne of"ses""test""dev""connected"attemptsintegerlastErrorstring- Can be null
scheduledAtstring- Can be nullFormat
date-time cancellableUntilstring- Can be nullFormat
date-time sentAtstring- Can be nullFormat
date-time tagsRecord<string, string>broadcastIdstringThe
brd_broadcast this message is one copy of, or null for a message sent on its own.GET /emails?broadcastId=lists every copy of one broadcast.Can be nullsourcestring- One of
"api""oauth""composer""mcp""ai""form""mail-app""booking" streamstringThe lane the message travels in:
transactionalfor app mail,broadcastfor newsletters and every copy of a broadcast.One of"transactional""broadcast"createdAtstring- Format
date-time recipientsobject[]Returned on retrieval only.
emailstringnamestring- Can be null
kindstring- One of
"to""cc""bcc" statusstringuncertainis real and is shown as itself: a transport that failed part-way cannot say which recipients it reached, and calling those delivered or failed would both be guesses.suppressedis decided before dispatch rather than reported afterwards: the address bounced or complained in this workspace before, so this copy was never offered to the transport. A message whose recipients are all suppressed fails outright.One of"pending""delivered""failed""bounced""complained""suppressed""uncertain"errorstring- Can be null
deliveredAtstring- Can be nullFormat
date-time
translationobjectPresent only when the message was translated, and only on responses that carry the stored request, which are the send itself and a retrieval. A list row does not fetch it, so its absence there says nothing either way.
languagestringThe resolved target code:
de,pt-BR.languageNamestringIts English name.
detectedSourceLanguagestringStated or detected. Null when detection abstained.
Can be nullsubjectbooleanWhether the subject was translated too.
includeOriginalbooleanWhether the sender's own words went below the translation.
trackingTracking
EmailCheckobject
How a receiving mailbox would likely rate this message, scored from its own content before it is sent. Every score runs 0 to 100, and higher means more of the thing it names. Nothing is stored and nothing is sent.
objectstringRequired- One of
"email_check" spamobjectRequiredSpam-like traits in the subject, wording and links: capitals, stacked exclamation marks, stock spam phrases, money or prize bait, link shorteners, an image with almost no text, and a
Re:subject on a message that answers nothing.scoreintegerRequired- At least 0At most 100
levelstringRequiredmediumfrom 35,highfrom 60.One of"low""medium""high"signalsstring[]RequiredWhat raised the score, heaviest first, as stable ids such as
spam-phrasesorlink-shortener.
phishingobjectRequiredWhat a phishing filter would object to: link text that names a different site, links to a bare IP address, pressure to verify or pay, an attachment that can run code, and a display name that claims another address or a known brand. Sender authentication is taken as passing, since the message will be signed for your domain.
scoreintegerRequired- At least 0At most 100
levelstringRequiredcautionfrom 30,dangerfrom 60.One of"clear""caution""danger"signalsstring[]Requiredreasonsstring[]RequiredOne plain sentence per signal, heaviest first.
aiobjectRequiredHow much the wording reads as written by a language model, from habits such as stock phrasing, even sentence lengths and markdown. Quoted history and the signature are cut first. It is a score, not a probability, and nobody can prove who wrote a sentence.
scoreintegerRequiredNull when the message was not judged;
skippedsays why.Can be nullAt least 0At most 100levelstringRequired- One of
"unknown""unremarkable""possible""likely" signalsstring[]Requiredreasonsstring[]RequiredwordsintegerRequiredWords of your own prose that were read.
skippedstringRequiredtoo-shortunder 40 words. Null when it was scored.Can be nullOne of"too-short""encrypted""bulk"
EmailCompositionobject
objectstringRequired- One of
"composition" bodystringRequiredThe body that was written, or with
draftthe whole draft after the change. Text, with Markdown only for links, bold and lists.subjectstringThe subject, when you asked with
withSubject.sendobjectWhen you gave
send: only the send optionspromptchanged, empty when it changed none.nulltakes an option away.tostring[]The whole To list after the change.
ccstring[]The whole Cc list after the change.
bccstring[]The whole Bcc list after the change.
scheduledAtstringWhen to send it, or
nullto send it right away.Can be nullFormatdate-timetrackingobjectWhether to track opens and link clicks.
opensbooleanclicksboolean
signaturebooleanWhether to add the signature.
translateobjectThe language to send it in, or
nullto send it untranslated.Can be nulltostringRequiredA language code, such as
de.
fromstringThe address to send it from instead, one of
send.fromOptions.encryptbooleanWhether to encrypt it end to end, when you gave
send.encrypt.
templateobjectThe template to send it with instead, when you gave
templates: trueandpromptasked for one. Its body replacesbody.idstringRequirednamestringRequired
attachobject[]Files the workspace holds to attach, when you gave
files: trueandpromptasked for them. Send each as{ "fileId": id }inattachments.idstringRequiredThe file, as
GET /files/{id}reads it.filenamestringRequiredcontentTypestringRequiredsizeintegerRequiredIn bytes.
attachMissingstring[]What
promptasked to attach that matched no file the workspace holds, aspromptnamed it.notestringA short sentence when part of
promptcannot be done this way, such as adding somebody whose address it was not given.sourcesobject[]The knowledge base items the draft drew on, when it used any: pinned notes at the levels of the sending address, and the passages that matched the request.
idstringThe knowledge item, as
GET /knowledge/{id}reads it.titlestringkindstring- One of
"note""file""link" scopestringThe level it sits at: empty for the whole workspace,
@and a domain, or an address.urlstringThe page a link item reads, or null.
Can be null
EmailListobject
objectstring- One of
"list" dataEmail[]hasMorebooleannextCursorstring- Can be null
EmailRewriteobject
objectstringRequired- One of
"rewrite" targetstringRequired- One of
"subject""body" variationsstring[]RequiredDifferent versions of the text, never the original itself.
EmailScanobject
objectstringRequired- One of
"email_scan" verdictstringRequiredWhat the scan found, read from the signals.
One of"phishing""suspicious""safe"confidencenumberRequiredHow sure the scan is of the verdict, from 0 to 1. A mailbox files
phishingin Spam from 0.85.At least 0At most 1reasonstringRequiredThe reason for the verdict, in a sentence.
categorystringRequiredmarketingfor mail that promotes or sells to many people,otherfor the rest, or null when the model did not say.Can be nullOne of"marketing""other"injectionbooleanRequiredTrue when the email carries instructions aimed at an AI assistant or agent, the
injectionsignal at 0.5 or more.signalsobjectRequiredcredentialsnumberRequiredIt asks the reader to sign in, verify or unlock an account, or to give a password, a code, a recovery phrase or card or bank details.
At least 0At most 1paymentnumberRequiredIt asks the reader to pay a fee, buy gift cards or crypto, or send money to new bank details.
At least 0At most 1lurenumberRequiredIt urges the reader to click to claim a prize, points, a refund or money, or to fix a blocked, expiring or compromised account.
At least 0At most 1impersonationnumberRequiredIt claims to be a bank, a payment service, a delivery company, an online service, a government office or the reader's boss, while the sender's address belongs to an unrelated domain.
At least 0At most 1pressurenumberRequiredIt threatens a loss or sets a deadline to rush the reader.
At least 0At most 1injectionnumberRequiredIt holds text aimed at an AI assistant or agent rather than at a person: instructions to ignore earlier instructions, to send, forward or reveal mail or data, or to call tools, or chat markers.
At least 0At most 1
Eventobject
objectstring- One of
"event" idstringtypestringDotted, such as
email.accepted,email.sent,email.delivered,email.bouncedoremail.opened.dataobjectWhatever the event recorded. An empty object when it carries nothing.
createdAtstring- Format
date-time
EventListobject
objectstring- One of
"list" dataEvent[]hasMorebooleanTrue when another page follows. Pass
nextCursorback ascursorto read it.nextCursorstringThe id of the last row on this page, or null on the last page.
Can be null
Languageobject
codestringRequiredBCP-47. What every endpoint here accepts and returns.
labelstringRequiredThe English name: "Brazilian Portuguese".
nativestringRequiredThe endonym, in its own script. Show this first.
flagstringRequiredTwo regional-indicator codepoints. A scanning aid beside the native name, never an identifier. Never show it on its own.
rtlbooleanRequiredRight-to-left. A translated body for one of these is wrapped in
dir="rtl"before it is sent, because a client that inherits direction renders it backwards otherwise.
SendEmailRequestobject
fromstring | objectRequiredemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
to(string | object)[]Required- 1 to 50 items
emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
cc(string | object)[]- Up to 50 itemsDefault
[]emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
bcc(string | object)[]- Up to 50 itemsDefault
[]emailstringRequired- Up to 320 characters
namestring- Up to 128 characters
replyTostring | objectemailstringRequired- Up to 320 characters
namestring- Up to 128 characters
subjectstring- Up to 998 charactersDefault
"" htmlstring- Up to 1000000 characters
textstring- Up to 1000000 characters
templateobjectidstringRequired- 1 to 128 characters
versioninteger- More than 0At most 100000
propsRecord<string, any>slotsRecord<string, any>
translateobjecttostringRequired- 2 to 60 characters
fromstring- 2 to 60 characters
includeOriginalboolean- Default
true subjectboolean- Default
true
headersRecord<string, string>- Default
{} attachmentsobject[]Up to 20 files, in three forms.
{ filename, content, contentType? }carries the file as base64, up to 10 MB for all of them together.{ url, filename?, contentType? }names a file at an https address, which is fetched once when the message is accepted, within 15 seconds and the 25 MB the message has room for; the name and type default to the last part of the path and the type the server answered with, and an address that cannot be fetched is a 422attachment_unreachable.{ fileId }names a file uploaded withPOST /files, up to 100 MB. A file given as base64 or byurlis kept with the message until it goes out, so it is never fetched twice and a retry of the send carries the same bytes.Up to 20 itemsDefault[]filenamestringRequired- 1 to 255 characters
contentstringRequired- 1 to 13981022 charactersPattern
^[A-Za-z0-9+/=\r\n]+$ contentTypestring- Up to 255 charactersPattern
^[\w.+-]+\/[\w.+-]+(?:[ \t]*;[ \t]*[\w.+-]+=(?:"[^"\r\n]*"|[\w.+-]+))*$
attachmentDeliverystringHow the files in
attachmentstravel.mimecarries them inside the message, the way mail always has, so files that come to more than 25 MB together are refused.linkuploads each file and puts a download link in the body in its place, so the message itself stays small.autolinks when the files together come to more than 25 MB, or to more than 2 MB when thefromdomain has an active files domain, and carries them inside the message otherwise. Left out, the sender's mailbox setting applies, and that defaults toauto. A download link uses the files domain when thefromdomain has one active and the default Nextmail host otherwise.One of"mime""link""auto"threadIdstring- Up to 256 characters
draftIdstring- Up to 256 characters
isForwardbooleanSends it as a forward, the way Forward in the app does: a signature it carries is the one the
fromaddress keeps for replies and forwards, as when the message answers a thread. Leave it out, andoriginalMessagetoo, to send a saved forward bydraftId: that draft quotes the email it forwards and brings its files by itself, and either field turns that off.originalMessagestringThe HTML of the email being forwarded or answered, put below the body as its quoted history, the way the app sends it. The signature goes above it. When this send is tracked, the open pixels of earlier mail are taken out of it and its links are never rewritten for click tracking, and when opens are tracked the pixel of this send goes after it. It counts as the body when
htmlandtextare left out, as for a forward with nothing added.Up to 1000000 charactersencryptionobjectMarks the message as one you sealed yourself, as the app does:
htmlortextthen holds one armored OpenPGP message and nothing else, and it goes out as PGP/MIME exactly as sealed, with no signature, tracking or rewriting.sealedAtis when you sealed it andsealedTothe address and key fingerprint of everyone it was sealed for. Nextmail never holds a private or public key for this and cannot seal or open the message, so seal it with your own OpenPGP library for the recipients' public keys and your own. It cannot be combined withtemplate,draftId,translate,originalMessageorattachments, which is a 422invalid_parameter, and once it is accepted its wording and recipients can no longer be edited.formatstringRequired- One of
"pgp-mime" sealedAtstringRequired- 1 to 64 characters
sealedToobject[]Required- 1 to 50 items
addressstringRequired- 3 to 320 characters
fingerprintstringRequired- 1 to 128 characters
scheduledAtstring- 3 to 64 characters
followUpAtstringAsks to be reminded if nobody replies: an ISO 8601 instant, or a duration from now such as
P3D, later than the time the message goes out and at most 365 days out. If no real reply has arrived by then, the thread returns to the top of the inbox, unread, with a push.GET /follow-upslists the reminders andDELETE /follow-ups/{id}cancels one.3 to 64 characterscancellableForSecondsinteger- At least 0At most 900Default
0 trackingobjectOpen and link tracking for this send alone. A field left out takes the
fromaddress's own setting, then its domain's catch-all's when the catch-all caught that address rather than it being one you created, and is off when neither sets it. Set them per address withPATCH /settings?address=.opensbooleanclicksboolean
signaturebooleanAn
htmlbody goes out exactly as written, so it carries a signature only when this istrue, while atext-only body carries one unless this isfalse. When it is added it is the default signature of thefromaddress: the one it keeps for replies when the message answers a thread (threadIdor anIn-Reply-Toheader), and the one for new mail otherwise. An address with no signature of its own takes its domain catch-all's when the catch-all caught that address, else the Nextmail footer unless that address turned the footer off.signatureIdpicks another signature of the address. Template sends and encrypted sends never carry one.signatureIdstringAdds one particular signature of the
fromaddress in place of its default, by the idGET /signaturesreturns. It signs anhtmlbody too, sosignature: trueis not needed with it, and it cannot be combined withsignature: false. An id that is not a signature of thefromaddress is a 422invalid_parameter. When the signature is deleted before a scheduled message goes out, the message carries the default of the address instead.1 to 64 charactersstreamstringThe lane the message travels in.
transactional, the default, is for mail one person is waiting for, such as a password reset, a receipt or a code.broadcastis for newsletters and other mail to many people at once. Each lane has its own queue and its own reputation, so a newsletter never holds up or harms app mail, and the broadcast lane pauses itself when too many of its messages bounce or are reported as spam. A message sent to a paused lane is a 409stream_paused.On the broadcast lane, a message to one recipient that sets no
List-Unsubscribeheader of its own carriesList-UnsubscribeandList-Unsubscribe-Postfor one-click unsubscribe. Whoever uses it joins the unsubscribe list (GET /suppressions/unsubscribes), and broadcast lane mail is not sent to anybody on that list: the recipient is markedsuppressedandemail.suppressedsays why. Transactional mail still reaches them.One of"transactional""broadcast"tagsRecord<string, string>- Default
{}
SubjectSuggestionobject
objectstringRequired- One of
"subject_suggestion" subjectstringRequired
ThreadDeliveryobject
objectstringRequired- One of
"thread_delivery" threadIdstringRequiredThe thread the counts are for.
recipientsintegerRequiredRecipients of the messages counted, to, cc and bcc together, one for each message each one was on.
At least 0bouncedintegerRequiredRecipients whose mail server refused the message after it left.
At least 0complainedintegerRequiredRecipients who reported the message as spam.
At least 0failedintegerRequiredRecipients the message could not be sent to at all.
At least 0suppressedintegerRequiredRecipients it was never sent to, because they are on the suppression list of the workspace.
At least 0partialSendsintegerRequiredMessages that reached only some of their recipients.
At least 0reasonstringRequiredAn error one of the recipients came back with, to show beside the counts. Null when none did.
Can be null
Trackingobject
Every /tracking endpoint returns this whole, its list included. It arrives trimmed in exactly one place, under tracking on a GET /emails row, where it is the counts half only: opens, clicks, opened, clicked, openCount, clickCount and firstOpenAt. A page of fifty sends each carrying its recipients and its links is a report nobody asked to have expanded. The trimmed form has no id on it either, so /emails/{id}/tracking rather than /tracking/{id} is the way back to the rest of it.
objectstringPresent when the report is the whole response body. Absent under an email's
trackingfield, which is part of that email rather than a resource in its own right.One of"tracking"idstringThe tracking record,
tmsg_+ 24 hex. Not the message id and not the send id.sendIdstringThe
msg_this went out as, when the send service handled it. Null for mail the mailbox agent sent on its own behalf, which is most composer, MCP and assistant traffic. Those messages do get a send record, but nothing links this tracking row to it. Tracking covers the mailbox rather than only the traffic that came through this API.Can be nullthreadIdstring- Can be null
messageIdstringRFC 5322 Message-ID. Not a correlation key. The header is rewritten on the way out. Correlate on
id.Can be nullsubjectstring- Can be null
fromstringsourcestring- One of
"api""oauth""composer""mcp""ai""form""mail-app""booking" sentAtstring- Can be nullFormat
date-time opensbooleanWhat was APPLIED to this message, resolved when it was sent from the setting of the address it was sent from (its own, else its domain catch-all's, else off, while a broadcast copy is on unless the broadcast or its address turned it off) and any per-send override, not what is switched on now. Turning tracking on today does not make yesterday's mail start reporting, and a report that implied otherwise would read as "nobody opened it".
clicksbooleanAs
opens, for link rewriting. The two are independent switches.openedbooleanclickedbooleanattributablebooleanWhether every reading on this message can be pinned to a named recipient. False as soon as an unattributed copy has activity of its own, which is what happens whenever one body went to the whole list rather than a separate one per person. This is the flag that decides whether "Bob has not opened it" is a sentence a client is entitled to write, or whether all it may say is that somebody did.
recipientscarries the same fact one row at a time, and one row at a time is where it gets missed.openCountintegerOpens that looked like a person, with repeat fetches within thirty seconds collapsed. A preview pane redrawing is not a second reading. Through Gmail this is a floor and not a total: its proxy fetches the image once and caches it, so later readings never reach us.
clickCountintegerCounted clicks. Stronger evidence than an open, and worth weighting as such: images are blocked far more often than links go unfollowed, so a message with clicks and no opens was certainly read.
openCountRawintegerEvery open hit, the automated ones included.
openCountRaw - openCountis everything that was filtered out: Apple Mail Privacy Protection and corporate link scanners, which fetch on delivery whether or not a person ever looks, and alongside them the repeat fetches collapsed by the thirty-second window. Both are recorded and neither is counted, because discarding them outright would leave a gap in the log that nothing could explain. Do not read the difference as a machine count on its own. A message reopened twice in a minute lands in it too.clickCountRawintegerAs
openCountRaw, for clicks.firstOpenAtstring- Can be nullFormat
date-time lastOpenAtstring- Can be nullFormat
date-time firstClickAtstring- Can be nullFormat
date-time lastClickAtstring- Can be nullFormat
date-time recipientsobject[]One entry per tracked copy, which is not always one entry per person. Absent only from the trimmed form on a
GET /emailsrow; every/trackingresponse carries it, list included.emailstringNull where the bytes could not be varied per person: an encrypted message, one too large to rebuild for each recipient, or a fallback carrier that takes the whole recipient list in a single call. The reading is real; which of the recipients did it is not knowable, and the only honest rendering is "someone on this message", never a name chosen out of the list.
Can be nullkindstring- Can be nullOne of
"to""cc""bcc" attributedbooleanFalse on exactly the rows described above. Branch on this rather than on
emailbeing a string, and show nothing where it is false: attributing an unattributed open to a named recipient invents evidence about a specific person.openCountintegerclickCountintegerfirstOpenAtstring- Can be nullFormat
date-time lastOpenAtstring- Can be nullFormat
date-time firstClickAtstring- Can be nullFormat
date-time lastClickAtstring- Can be nullFormat
date-time
linksobject[]The rewritten links, in the order they appeared in the message. Only links in the new part of the body are here: the quoted history under a reply belongs to whoever wrote it, and routing their URLs through our redirector would both rewrite their message and record the recipient "clicking" something we did not put there. Repeated destinations share one entry, because a campaign page linked from a header image, a button and a footer is one question asked three times. Absent only from the trimmed form on a
GET /emailsrow.idstringurlstringWhere it actually goes: the original href.
labelstringThe text the link read as in the message, where it had any. A bare URL rarely tells the sender which of five links somebody followed.
Can be nullclickCountintegerclickCountRawinteger
Translationobject
The preview, and exactly what a translate on POST /emails would produce for the same input. Show it, let someone edit it, then send the edited text as an ordinary html/subject with no translate on the request. Sending with translate after previewing translates a second time and discards the edits.
objectstring- One of
"translation" languageLanguagedetectedSourceLanguageLanguagesubjectstringNull when no subject was given. Safe to put straight into a header.
Can be nullhtmlstringNull when no
htmlwas given. Carriesdir="rtl"when the target needs it, and already contains the original beneath the translation whenincludeOriginalis on.Can be nulltextstringNull when no
textwas given.Can be nullincludeOriginalbooleanEchoed because it changes what
htmlcontains: with it on, the original is already in there and appending your own copy would send it twice.quotedHistoryKeptbooleanTrue when
skipQuotedfound quoted history inhtmland left it in its own language at the end of the translatedhtml, below the original whenincludeOriginalis on. False when nothing was skipped.