Prerequisites
Before your first request, complete the following steps.Create a MailChannels account
Sign up if you don’t already have an account.
Generate an API key
Open Account > API Keys and click Create API Key.
Add a descriptive label and set the scope to
api. Copy the key; you won’t be able to see it again.Add a Domain Lockdown DNS record
For each domain you’ll send from, add a See the Domain Lockdown guide for details.
TXT record on the _mailchannels subdomain authorizing your account to send.
Replace examplecorp with your MailChannels account ID (visible in the panel footer when you log in):Install the Node.js SDK
Node.js
Send your first email
To send an email, provide the recipients, sender, subject, and message content. The example below sends an HTML email to a single recipient.Until you add a payment method, sending is restricted to addresses belonging to verified Users
on your account. Add a user, click the link in the verification email, then use that address as the
to email below.MAILCHANNELS_API_KEY— the API key generated above.FROM_EMAIL— an address on the domain you configured with Domain Lockdown and SPF above (e.g.hello@example.comif you usedexample.comin the Domain Lockdown and SPF DNS records).TO_EMAIL— a recipient inbox you can check, e.g. the address you use to sign up for MailChannels.
Next steps
- Read the webhooks guide to learn how to get real-time notifications about email delivery, bounces, and complaints.
- Explore the API reference to see what else you can do with the API.

