POST
/
api
/
v2
/
emails
import { Inbound } from '@inboundemail/sdk';

const inbound = new Inbound('your_api_key');

const { data, error } = await inbound.email.send({
  from: 'Acme <noreply@yourdomain.com>',
  to: ['customer@example.com'],
  subject: 'Welcome to Acme!',
  html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  text: 'Welcome! Thanks for signing up.'
});

if (error) {
  console.error('Error:', error);
} else {
  console.log('Email sent:', data.id);
}
{
  "id": "em_1234567890abcdef",
  "messageId": "0100018e1234abcd-12345678-1234-1234-1234-123456789012-000000"
}
This endpoint is compatible with Resend’s email sending API, making it easy to migrate from Resend to Inbound.

Authentication

This endpoint requires authentication via:
  • API key auth: Bearer token in Authorization header

Body Parameters

from
string
required
Sender email address.To include a friendly name, use the format "Your Name <sender@domain.com>".
You must own and have verified the sender’s domain in your Inbound account.
You can use agent@inbnd.dev as a sender without domain verification for testing purposes.
to
string | string[]
required
Recipient email address. For multiple addresses, send as an array of strings.
Combined total of all recipients (to, cc, bcc) should not exceed 50 addresses.
subject
string
required
Email subject.
bcc
string | string[]
Bcc recipient email address. For multiple addresses, send as an array of strings.
cc
string | string[]
Cc recipient email address. For multiple addresses, send as an array of strings.
reply_to
string | string[]
Reply-to email address. For multiple addresses, send as an array of strings.
Also accepts replyTo (camelCase) for Resend compatibility.
replyTo
string | string[]
Reply-to email address (Resend-compatible camelCase format). For multiple addresses, send as an array of strings.
html
string
The HTML version of the message.
text
string
The plain text version of the message.
headers
object
Custom headers to add to the email.
tags
array
Array of tag objects for email categorization and tracking (Resend-compatible).
attachments
array
Array of file attachments (max 40MB total email size, 25MB per attachment, 20 attachments max).

Headers

Authorization
string
required
Bearer token for API authentication.
Idempotency-Key
string
Add an idempotency key to prevent duplicated emails.
  • Should be unique per API request
  • Idempotency keys expire after 24 hours
  • Have a maximum length of 256 characters

Request Example

import { Inbound } from '@inboundemail/sdk';

const inbound = new Inbound('your_api_key');

const { data, error } = await inbound.email.send({
  from: 'Acme <noreply@yourdomain.com>',
  to: ['customer@example.com'],
  subject: 'Welcome to Acme!',
  html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  text: 'Welcome! Thanks for signing up.'
});

if (error) {
  console.error('Error:', error);
} else {
  console.log('Email sent:', data.id);
}

Response

id
string
required
Unique identifier for the sent email in Inbound’s system
messageId
string
AWS SES Message ID for tracking the email through AWS infrastructure.
Not included in idempotent responses (when using Idempotency-Key header for duplicate requests).
{
  "id": "em_1234567890abcdef",
  "messageId": "0100018e1234abcd-12345678-1234-1234-1234-123456789012-000000"
}

Important Notes

Domain Verification Required: You can only send emails from domains that you own and have verified in your Inbound account. Attempting to send from an unverified domain will result in a 403 error.
Email Limits: Your account has a monthly email sending limit based on your subscription plan. The API will return a 429 error if you exceed this limit.
Idempotency: Use the Idempotency-Key header to ensure emails aren’t sent multiple times in case of network issues or retries.

Migration from Resend

This endpoint is designed to be compatible with Resend’s email sending API. To migrate:
  1. Replace your Resend API endpoint with https://inbound.new/api/v2/emails
  2. Replace your Resend API key with your Inbound API key
  3. Ensure your sending domain is verified in Inbound
Supported Resend Features:
  • All basic email parameters (from, to, subject, html, text, etc.)
  • Both reply_to (snake_case) and replyTo (camelCase) formats
  • Both content_type and contentType for attachments
  • tags array for email categorization
  • content_id for CID embedding in attachments
  • Remote file fetching via path parameter in attachments
Unsupported Resend Features:
  • scheduled_at parameter (use /api/v2/emails/schedule endpoint instead)
  • React components (use HTML/text instead)
  • Some advanced attachment features may differ
1.0 - ✅