Every click in the app
is a method you can call.

The window below shows one session as code. Open the mailbox tab, read a thread, star it or search, and each click comes back as a call in your language.

Your session, as code

await nextmail.threads.list({ folder: 'inbox' })

Last response

GET /threads?folder=inbox

{  "items": [    {      "object": "thread",      "id": "t1"    },    {      "object": "thread",      "id": "t2"    },    {      "object": "thread",      "id": "t3"    },    {      "object": "thread",      "id": "t4"    },    {      "object": "thread",      "id": "t5"    },    {      "object": "thread",      "id": "t6"    },    {      "object": "thread",      "id": "t7"    },    {      "object": "thread",      "id": "t8"    },    {      "object": "thread",      "id": "t9"    }  ],  "hasMore": false,  "nextCursor": null}

What your clicks call

The SDK,
a building block for email.

Each operation is a method on the client. The API and the SDKs share the same scopes and limits.

npm install @nextmail/sdk
import { init, nextmail } from '@nextmail/sdk' init({ apiKey: process.env.NEXTMAIL_API_KEY }) const email = await nextmail.emails.send({  from: 'Acme Billing <[email protected]>',  to: '[email protected]',  subject: 'Your September invoice',  html: '<p>The invoice is attached.</p>',}) console.log(email.id, email.status)

Install, then make one call

Install the package, then call the client from your code.

Read the docs: Install, then make one call

TypeScript SDK

A client with zero dependencies for Node 20 and up, Bun, Deno and Cloudflare Workers.

Read the docs: TypeScript SDK
POST/emails201
POST/emails201
Idempotency-Key: invoice:inv_2026_09_4192Same message

Safe retries

A retry with the same idempotency key never sends twice.

Read the docs: Safe retries

Install

One line to install.
Seven languages to write in.

npm install @nextmail/sdk

793 SDK methods · 639 API operations · one OpenAPI document

Write one call.
Delivery is on us.

Anything that speaks HTTP can send. TypeScript, Python, Ruby, PHP, Go, Java and C# get typed clients, and every message reports back as it is queued, sent and delivered.

npm install @nextmail/sdk
import { init, nextmail } from '@nextmail/sdk' init({ apiKey: process.env.NEXTMAIL_API_KEY }) const email = await nextmail.emails.send({  from: 'Acme Billing <[email protected]>',  to: '[email protected]',  subject: 'Your September invoice',  html: '<p>The invoice is attached.</p>',}) console.log(email.id, email.status)

What happens next

  1. Request acceptedmsg_4b7e…
  2. Queuedemail.queued
  3. Sentemail.sent
  4. Deliveredemail.delivered
your codeAPIqueueSMTP outthe internetMX inchecksstorewebhookSigned · retried for about a day

793 methods.
Grouped the way you call them.

A namespace for each part of the product, so emails.send and domains.verify are where you would look for them. Every method is in all seven languages.

Send once.
Exactly when you meant to.

A retry never sends twice, a send can wait up to a year, and an undo window lasts up to fifteen minutes.

invoice.ts
await nextmail.emails.send({
from: 'Acme Billing <[email protected]>',
subject: 'Your September invoice',
html: invoiceHtml,
1 attachments: [{ fileId: invoicePdf.id }],
}, {
2 idempotencyKey: 'invoice:inv_2026_09_4192',
})

What happens

  1. 09:41:02status: sent

    Accepted and sent. The PDF is large, so it travels as a download link.

  2. 09:41:07timeout

    The connection drops before your code reads the answer.

  3. 09:41:08Idempotency-Key

    The SDK sends it again with the same key.

  4. 09:41:08replayed: true

    Nextmail returns the first result instead of sending twice.

A retry never sends twice.

Coming from Resend?
Change two lines.

Point the Resend SDK at Nextmail and keep your code, then bring contacts, templates and webhooks across.

.env2 lines
  1. RESEND_API_KEY=re_…
  2. RESEND_API_KEY=nm_live_…
  3. RESEND_BASE_URL=https://api.nextmail.sh/compat/resend
send.ts0 lines changed
import { Resend } from 'resend'

const resend = new Resend(process.env.RESEND_API_KEY)

await resend.emails.send({
  from: 'Acme Billing <[email protected]>',
  to: '[email protected]',
  subject: 'Your September invoice',
})
  • Answered in Resend's own shapes and error names

    • send
    • batch
    • get
    • list
    • reschedule
    • cancel
  • Bring the rest with one key

    • Suppressions
    • Audiences
    • Contacts
    • Templates
    • Webhooks

Two differences: a message takes one reply-to address, and an inline image referenced by content id arrives as an ordinary attachment.

Read the Resend guide

Four doors.
One mailbox behind them.

REST, the SDK, the command line and MCP reach the same operations, with the same scopes and the same limits.

Give it an address.
Watch it work.

MCP, the API and the command line come with every plan, the free one included. Connect a client and approve exactly what it reaches.

Read https://nextmail.sh/agent.md and follow it. Then tell me what I need to do to sign you in to my Nextmail mailbox. If I have no account yet, create one with my address and ask me for the code that arrives. Wait for my go-ahead before you send anything.

© 2026 Nextmail. All rights reserved.