API reference
The NextMail REST API is JSON-only, scoped per tenant via your API key, and versioned. Every request requires Authorization: Bearer nm_… in the header.
Endpoints
POST
/v1/emailsGET
/v1/emails/:idGET
/v1/emailsPOST
/v1/templatesGET
/v1/templates/:slugGET
/v1/suppressionsPOST
/v1/suppressionsDELETE
/v1/suppressions/:emailPOST
/v1/webhooksGET
/v1/webhooksPOST
/v1/api-keysGET
/v1/api-keysPOST /v1/emails
The primary send endpoint. Accepts a JSON body and returns a queued message id.
Request
application/json
{
"from": "noreply@mail.example.com",
"to": "user@example.com",
"replyTo": "support@example.com",
"subject": "Your password reset",
"html": "<p>Click to reset.</p>",
"text": "Click to reset.",
"template": "password-reset",
"data": { "name": "Sarah", "resetUrl": "https://..." },
"tags": ["flow:password-reset"],
"metadata": { "userId": "u_42" }
}Either html + text or template + data must be present. Templates win when both are sent.
Response
HTTP 202 Accepted
{
"messageId": "msg_8gK9p2x1WqYz",
"status": "QUEUED",
"queuedAt": "2026-05-27T12:48:21.991Z"
}Errors
400— invalid body (missing field, malformed email)401— invalid or revoked API key403— API key lacks theemails:sendscope409— recipient is on the suppression list429— rate limit exceeded; respectRetry-After
Full per-endpoint details ship with the OpenAPI spec under /v1/openapi.json.