Welcome to Inbound! Get started with sending emails, receiving emails, and building complete email workflows in minutes.

Quick Start

1

Get Your API Key

Sign up at inbound.new and generate an API key from your dashboard.
2

Install the SDK (Recommended)

Install our SDK for the best developer experience:
npm install @inboundemail/sdk
3

Send Your First Email

Start sending emails immediately:
SDK (typescript)
import { Inbound } from '@inboundemail/sdk'

const inbound = new Inbound(process.env.INBOUND_API_KEY!)

const { data, error } = await inbound.emails.send({
  from: 'Inbound User <agent@inbnd.dev>',
  to: 'youremail@inbound.new',
  subject: 'Welcome!',
  html: '<p>Thanks for signing up!</p>',
  tags: [{ name: 'campaign', value: 'welcome' }]
})

console.log(`Email sent: ${data?.id}`)

Authentication

All API requests to Inbound v2 require authentication using an API key. This guide explains how to obtain and use your API key securely.

Base URL

All authenticated requests are made to:
https://inbound.new/api/v2

Getting Your API Key

1

Access Your Dashboard

Log in to your Inbound dashboard and navigate to the Settings page.

Dashboard

Access your API keys from the dashboard
2

Generate API Key

Click “Create API Key” and give it a descriptive name for easy identification.
3

Copy and Store Securely

Copy your API key immediately and store it securely. You won’t be able to see it again.
API keys are sensitive credentials. Never expose them in client-side code or commit them to version control.

Using Your API Key

Include your API key in the Authorization header of all API requests:
Authorization: Bearer your_api_key_here

Security Best Practices

  • Environment Variables: Always store API keys in environment variables
  • Key Rotation: Regularly rotate your API keys for enhanced security
  • Environment Separation: Use separate API keys for different environments
  • Monitoring: Monitor your API key usage in the dashboard
Learn about rate limits to optimize your API usage and avoid hitting limits.

How Inbound Works

Inbound enables you to be able to send & receive emails programmatically.

Sending Emails

You can send emails using the SDK or the API. Our SDK is very similar to the Resend SDK. So if you are migrating from Resend, you shouldn’t have any trouble. Example:
Node.js
const { data, error } = await inbound.emails.send({
  from: 'Inbound User <agent@inbnd.dev>',
  to: 'youremail@inbound.new',
  subject: 'Welcome!',
  html: '<p>Thanks for signing up!</p>',
  tags: [{ name: 'campaign', value: 'welcome' }]
})

console.log(`Email sent: ${data?.id}`)

// Response:
{
   "id":"nOvWqzU2Geh2q6AfeH1pk", // inbound email id
   "messageId":"010f01990252a2b8-0dcc8a27-a7b4-45be-a290-822f7e509049-000000" // AWS SES Message ID
}

Receiving Emails

In inbound you can receive emails using endpoints. You can attach endpoints to individual email addresses or you can setup catch-all for a domain, where all any incoming email that doesn’t match any of the specific email addresses will be routed to the catch-all endpoint. Example:
switch (email) {
  case 'support@yourdomain.com':
    endpoint1  // Specific endpoint for support
  case 'sales@yourdomain.com':
    endpoint2  // Specific endpoint for sales
  default:    // catch-all
    endpoint3  // Fallback endpoint for all other emails
}

API Features

Webhook Payload Structure

We have fully typed webhook payloads for you to use in your endpoints.
import type { InboundWebhookPayload } from '@inboundemail/sdk'

const payload: InboundWebhookPayload = {
  event: 'email.received',
  timestamp: '2024-01-15T10:30:00Z',
  email: {
    id: 'email_abc123',
    messageId: '<unique@example.com>',
    from: {
      text: 'John Doe <john@example.com>',
      addresses: [{
        name: 'John Doe',
        address: 'john@example.com'
      }]
    },
    to: {
      text: 'support@yourdomain.com',
      addresses: [{
        name: null,
        address: 'support@yourdomain.com'
      }]
    },
    recipient: 'support@yourdomain.com',
    subject: 'Help with my order',
    receivedAt: '2024-01-15T10:30:00Z',
    parsedData: {
      messageId: '<unique@example.com>',
      date: new Date('2024-01-15T10:30:00Z'),
      subject: 'Help with my order',
      from: {
        text: 'John Doe <john@example.com>',
        addresses: [{
          name: 'John Doe',
          address: 'john@example.com'
        }]
      },
      to: {
        text: 'support@yourdomain.com',
        addresses: [{
          name: null,
          address: 'support@yourdomain.com'
        }]
      },
      cc: null,
      bcc: null,
      replyTo: null,
      inReplyTo: undefined,
      references: undefined,
      textBody: 'Hello, I need help with my recent order...',
      htmlBody: '<p>Hello, I need help with my recent order...</p>',
      attachments: [],
      headers: {},
      priority: undefined
    },
    cleanedContent: {
      html: '<p>Hello, I need help with my recent order...</p>',
      text: 'Hello, I need help with my recent order...',
      hasHtml: true,
      hasText: true,
      attachments: [],
      headers: {}
    }
  },
  endpoint: {
    id: 'endp_xyz789',
    name: 'Support Webhook',
    type: 'webhook'
  }
}

Error Handling

API errors are returned with appropriate HTTP status codes:
{
  "error": "Invalid or missing API key"
}
Common status codes:
  • 200 - Success
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid API key)
  • 404 - Not Found (resource not found)
  • 429 - Too Many Requests (rate limit exceeded)
  • 500 - Internal Server Error

Next Steps

Ready to start building with Inbound? Here are the essential resources to get you started: