Skip to main content
POST
/
emails
JavaScript
import Nuntly from '@nuntly/sdk';

const client = new Nuntly({
  apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});

const response = await client.emails.send({
  from: 'Tomlinson AI <ray@info.tomlinson.ai>',
  subject: 'Verify your email address',
  to: 'brian67@gmail.com',
});

console.log(response.id);
{
  "data": {
    "id": "<string>",
    "status": "queued"
  }
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>

Body

application/json

Email message with recipients, content, attachments, and optional scheduling.

from
string
required

The e-mail address of the sender

Example:

"Tomlinson AI <ray@info.tomlinson.ai>"

to
required

The primary recipient(s) of the email

Example:

"brian67@gmail.com"

subject
string
required

The subject of the e-mail

Example:

"Verify your email address"

cc

The carbon copy recipient(s) of the email

bcc

The blind carbon copy recipient(s) of the email

replyTo

The email address where replies should be sent. If a recipient replies, the response will go to this address instead of the sender's email address

text
string

The plaintext version of the email

Example:

"Thank you for signing up! Please verify your email address."

html
string

The HTML version of the email

Example:

"<h1>Welcome 🎉</h1><p>Thank you for signing up! Please verify your email address.</p>"

headers
object

The headers to add to the email

tags
object[]

The tags to add to the email

attachments
object[]

The attachements to add to the email

variables
object

The variables for the template

scheduledAt
string

The date at which the email is scheduled to be sent

Response

Successful response.

data
object
required