> ## Documentation Index
> Fetch the complete documentation index at: https://inbound.new/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Simple email processing API for receiving and managing emails programmatically

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](https://inbound.new) and generate an API key from your dashboard.

**2. Install the SDK (Recommended)**

Install our TypeScript SDK for the best developer experience:

```bash theme={null}
npm install inboundemail
```

The SDK reads `INBOUND_API_KEY` from the environment, or pass `new Inbound({ apiKey })`. Every endpoint page in this reference shows a TypeScript sample using the SDK next to the cURL sample.

**3. Send Your First Email**

Start sending emails immediately:

```typescript SDK (typescript) theme={null}
import Inbound from 'inboundemail'

const inbound = new Inbound()

const result = await inbound.emails.send({
  from: 'Inbound User <agent@inbnd.dev>',
  to: 'youremail@inbound.new',
  subject: 'Welcome!',
  html: '<p>Thanks for signing up!</p>'
})

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

Errors throw an `APIError` with `status` and `message`; wrap calls in `try`/`catch`.

## 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:

```bash theme={null}
https://inbound.new/api/e2
```

### Getting Your API Key

**1. Access Your Dashboard**

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

> [card] [Dashboard](https://inbound.new/settings)
>
> 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.

> [!WARNING]
>
> 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:

```bash theme={null}
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

> [!TIP]
>
> Learn about [rate limits](https://inbound.new/docs/api-reference/rate-limits.md) 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](https://resend.com/docs/api-reference). So if you are
migrating from Resend, you shouldn't have any trouble.

Example:

```typescript Node.js theme={null}
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}`)
```

#### 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:

```typescript theme={null}
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

> [card] [Send Emails](https://inbound.new/docs/api-reference/emails/send-an-email.md)
>
> Send transactional emails with Resend-compatible API

> [card] [Receive Emails](https://inbound.new/docs/api-reference/webhook.md)
>
> Process incoming emails via webhooks with TypeScript types

> [card] [Reply to Emails](https://inbound.new/docs/api-reference/emails/reply-to-an-email.md)
>
> Send replies to received emails with full threading support

> [card] [Manage Domains](https://inbound.new/docs/api-reference/domains/create-new-domain.md)
>
> Add and verify domains for email receiving

## Error Handling

API errors are returned with appropriate HTTP status codes:

```json theme={null}
{
  "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:

> [card] [Authentication Guide](https://inbound.new/docs/api-reference/introduction.md#authentication)
>
> Complete guide to API authentication and security

> [card] [Rate Limits](https://inbound.new/docs/api-reference/rate-limits.md)
>
> Understand API limits and optimization strategies

> [card] [Send Your First Email](https://inbound.new/docs/api-reference/emails/send-an-email.md)
>
> Start sending emails with the API

> [card] [SDK Installation](https://inbound.new/docs/quickstart/getting-started.md#2-install-the-sdk)
>
> Install and configure the TypeScript SDK

> [card] [Error Codes](https://inbound.new/docs/api-reference/errors.md)
>
> Reference for all API error codes and responses


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.