---
title: "Inbound Message Routing"
description: "Automatically process inbound emails with AhaSend message routing - route emails to your applications for support tickets, replies, and automated workflows."
url: https://ahasend.com/inbound-message-routing
markdown_url: https://ahasend.com/inbound-message-routing.md
lang: en
type: page_builder
published: 2026-02-09
updated: 2026-09-02
---

# Inbound Message Routing

Automatically process inbound emails with attachments, directly in your applications. Perfect for Support Ticket Systems, Reply Processing, Automated Workflows.

- [Start for Free](https://dash.ahasend.com/user/register)
- [View Documentation](https://ahasend.com/docs)

## Message Routing

Message routing enables you to automatically process inbound emails sent to your domains by forwarding them to your application endpoints in real-time. When someone sends an email to addresses on your configured domains, the system can automatically parse and route these messages to your applications, making it perfect for support ticket systems, reply handling, and automated email processing workflows.

### 1. Email Received

An email is sent to an address on your domain (e.g., support@yourdomain.com or ticket-\*@yourdomain.com)

### 2. Route Matching

AhaSend checks configured routes to find matching recipient patterns

### 3. Email Processing

The email is parsed, processed, and formatted according to your route settings

### 4. HTTP Request Sent

AhaSend sends a POST request to your endpoint URL with the email data

## Built for Developers

Everything you need to integrate, test, and deploy email functionality with confidence and speed.

_Real-time Development_

### Webhook & Inbound Message Routes

Develop and test [webhooks](https://ahasend.com/docs/integrations/webhooks) and inbound message [routes](https://ahasend.com/docs/integrations/routing) directly on your [localhost](https://ahasend.com/docs/cli/commands/webhooks#listen-for-events-development). Stream real-time events to your development environment for seamless debugging and integration testing.

- Listen for webhook events and inbound message routing in real-time.
- Test your webhook handlers without deploying to production.
- Debug message delivery, bounces, and routing logic locally.

```shell
$ ahasend webhooks listen \
    --forward-to http://localhost:3000/ \
    --slim-output
🔌 Webhook connected!
Webhook ID: 1fc8ef7a-9d14-445e-8ace-4f333e888cba
Secret: aha-whsec-VUp1xuZi9TftBhcuE7GqB...SRF8D0rIWOkJDvTOlwYoJ5
Connected at: 22:14:06
Listening for events... (Press Ctrl+C to stop)
────────────────────────────────────────────────────────────
✓ Session established: sess_1757535246_9f34457af66cdd0c
────────────────────────────────────────────────────────────
[22:14:16] 📨 message.reception
────────────────────────────────────────────────────────────
[22:14:16] 📨 message.delivered
────────────────────────────────────────────────────────────
[22:14:16] 📨 message.bounced
────────────────────────────────────────────────────────────
```

_Develop faster locally_

### Your Toolkit in the Terminal

Our powerful [CLI tool](https://ahasend.com/docs/cli) puts the entire platform at your fingertips, dramatically speeding up your workflow.

- Test and debug webhooks and email routes by securely streaming events directly to your localhost.
- Trigger any API event or send test emails right from the command line.
- Manage your entire account and configuration without leaving the terminal.

```shell
$ ahasend auth login --profile local
Enter your AhaSend API key: ****************************************
Enter your AhaSend Account ID: 8b9dcfcf-94f7-477c-8372-0178618ef975
Successfully authenticated and saved profile 'local'
```

_Principle Of Least Privilege_

### The Right Permissions, Every Time

With [Scoped API keys](https://ahasend.com/docs/api-reference/scopes), you have granular control over what each part of your application is allowed to do.

- Scope keys by action (e.g., report-only, send-only) and by domain.
- Enforce least privilege for maximum security.
- Shrink the blast radius of a compromised key.
- Restrict each key to trusted source IPs (IPv4/IPv6 or CIDR) with an [IP Allow List](https://ahasend.com/blog/restrict-your-api-keys-specific-ips-ip-allow-lists), so a leaked key is useless from anywhere else.
- Safely create keys for different tenants or services, like a reporting key for just one client's domain.

```shell
$ ahasend keys create \
    --name "reporting-client-ahasend" \
    --scopes "reports:read" \
    --domain "ahasend.com"
✓ API key created successfully
Key: aha-sk-1234567890abcdef...
Scopes: reports:read
Domain: ahasend.com
# Attempting to send email with reports-only key
$ ahasend messages send \
    --api-key "aha-sk-1234..." \
    --from test@acme.com \
    --to user@example.com \
    --subject "Test"
✗ Error: Insufficient permissions - key lacks 'messages:send' scope
```

_Complete Transparency_

### Raw Delivery Logs

Unlike other email providers, we don't hide delivery logs behind paywalls or abstractions. Get complete access to raw delivery attempts, bounce reasons, and detailed error messages for every email.

- Access detailed delivery logs for every message sent through our platform.
- Get raw SMTP error messages and bounce reasons directly from receiving servers.
- Debug delivery issues with complete transparency and detailed timestamps.
- No hidden information - see exactly what happened to every email attempt.

```shell
$ ahasend messages list \
    --status bounced \
    --output json | jq '.data[0].delivery_attempts'
[
  {
    "log": "Requested action not taken: mailbox unavailable...",
    "status": "Bounce",
    "time": "2025-12-25T13:01:16.913Z"
  }
]
```

## Get Started in Seconds

Choose your favorite programming language and start sending emails with just a few lines of code.

### JSON example

#### JSON

```bash
{
  "type": "message.routing",
  "timestamp": "2026-02-07T10:41:45.026792973Z",
  "data": {
    "id": "route-msg-12345",
    "from": "customer@gmail.com",
    "reply_to": "customer@gmail.com",
    "to": "support@yourdomain.com",
    "subject": "Help with my account",
    "message_id": "<unique-message-id@gmail.com>",
    "size": 2048,
    "spam_score": 0.1,
    "bounce": false,
    "cc": "",
    "date": "Mon, 02 February 2024 13:15:46 +0000",
    "in_reply_to": "",
    "references": "",
    "auto_submitted": "",
    "html_body": "<p>I need help with my account settings.</p>",
    "plain_body": "I need help with my account settings.",
    "reply_from_plain_body": "I need help with my account settings.",
    "attachments": [
      {
        "filename": "screenshot.png",
        "content_type": "image/png",
        "content_id": "attachment_001",
        "data": "base64-encoded-image-data"
      }
    ],
    "headers": {
      "From": "customer@gmail.com",
      "To": "support@yourdomain.com",
      "Subject": "Help with my account",
      "Date": "Mon, 02 February 2024 13:15:46 +0000",
      "Message-ID": "<unique-message-id@gmail.com>",
      "Content-Type": "text/html; charset=UTF-8"
    }
  }
}
```

Need help getting started? [Check out our documentation](https://ahasend.com/docs) or [contact our support team](https://ahasend.com/contact)

## See AhaSend in Action

A clean, intuitive dashboard to manage your transactional emails with real-time analytics and delivery tracking.

![AhaSend Dashboard - Email analytics and management interface](https://cms.ahasend.com/sites/default/files/2025-12/dashboard-light.webp)

_Advanced Features_

## Everything You Need to Scale

Comprehensive email infrastructure features designed to grow with your business.

### SMTP Relay

Send emails from any programming language or software using our SMTP relay servers.

[Learn more](https://ahasend.com/free-smtp-server-relay)

### Email API

SMTP is good, but HTTP APIs are more flexible and faster for large senders.

[Learn more](https://ahasend.com/free-email-api)

### Engagement Tracking

Gain insight into your audience with detailed open and click tracking for every email.

[Learn more](https://ahasend.com/docs/tracking/open-tracking)

### Message Retention Policies

Customize retention policies for your message data and metadata.

[Learn more](https://ahasend.com/docs/retention)

### Email Archiving

Automatically archive emails to any S3-compatible service for compliance and long-term storage.

[Learn more](https://ahasend.com/docs/retention/s3)

### DNS Whitelabeling

Provide a seamless, branded experience for your customers with fully white-labeled DNS records.

[Learn more](https://ahasend.com/docs/scale/dns-whitelabel)

### Free Dedicated IPs

We reward high-volume senders with free IPs to protect and manage their reputation.

[Learn more](https://ahasend.com/docs/scale/dedicated-ips)

### IP Pools

Group dedicated IPs into pools to manage sending reputation across different mail streams.

[Learn more](https://ahasend.com/docs/scale/ip-pools)

### Bring Your Own IP (BYOIP)

Import and use your existing IP addresses on our platform for seamless migration.

[Learn more](https://ahasend.com/docs/scale/byoip)

_Customer Stories_

## Trusted by Developers Worldwide

Join thousands of developers who've transformed their email infrastructure with AhaSend's reliable delivery and world-class support.

> **Our Best Email Deliverability Ever**
> The best part about using AhaSend is the incredibly supportive team. They worked closely with us to resolve long-standing issues and warnings we had with our transactional email at Virgool. Thanks to their help, we're now experiencing the lowest spam rate in our history. The platform itself is also very intuitive, easy to set up, and integrates smoothly with our existing infrastructure.
> Ali A., CEO @Virgool (via G2) [Read review](https://www.g2.com/products/ahasend/reviews)

> **Exceptional Support and Excellent Service!**
> AhaSend provides an outstanding level of customer support and a seamless, user-friendly service that simplifies our communication needs. The platform is highly reliable and versatile, allowing us to manage campaigns effortlessly, which has significantly boosted our marketing efforts. I also appreciate the constant updates and improvements they bring to the platform.
> Dave F., Founder @Virabase (via G2) [Read review](https://www.g2.com/products/ahasend/reviews)

> **Mindblowingly good**
> I have worked with Brevo, Mailgun, SendQ, Cloudflare email workers, and others ... AhaSend was by far the easiest to set-up. On our latest project we spent hours trying to get the other to work without email being rejected or spam bucketed. With AhaSend we were up and running in 45 minutes, including the implementation of a routing web hook (granted we were just modifying from another provider). Finally, we made a comment about wanting a new feature (passing all email headers to a webhook) ... it was made, documented, and deployed within 45 minutes! Talk about support ... wow! And, it is very cost effective!
> Simon B., CTO @Unbounded.chat (via G2) [Read review](https://www.g2.com/products/ahasend/reviews)

> **Absolutely fantastic service!**
> We've been using AhaSend for a while now, and it comes highly recommended. Absolutely fantastic service!
> Nima A., Founder @BestOfWeb (via Product Hunt) [Read review](https://www.producthunt.com/products/ahasend#Review-743793)

> **AhaSend solved our email headaches**
> We were having ongoing deliverability issues with our previous email provider. After switching to AhaSend, those problems were completely resolved. Emails now land where they should and performance has been much more reliable. The support team is the best! Quick to respond, proactive, and genuinely helpful. They've gone above and beyond to help us get set up and improve our sending. Very happy with AhaSend so far. Highly recommended.
> Rob K., CEO @TeleCalendar (via G2) [Read review](https://www.g2.com/products/ahasend/reviews)

> **So fast and reliable**
> A transactional email service is an essential tool for every startup. I tested the AhaSend service and I'm using it for one of my projects. it's so fast and reliable, providing productive reports. Congratulations to the AhaSend team. 👌
> Atta K., CPO @WishMerge (via Product Hunt) [Read review](https://www.producthunt.com/products/ahasend#Review-743815)

## Ready to Build?

Join thousands of developers who trust AhaSend for reliable email delivery. Integrate in minutes, scale to millions.

- [Start Free](https://dash.ahasend.com/user/register)
- [View Documentation](https://ahasend.com/docs)

_No credit card required • 1000 emails/month free_
