Email API

Email API to send and receive email

Send email from your own domain with one REST call, reply inside the customer's thread, and receive every inbound email as structured JSON on your webhook.

  • ✓ Your own verified domain
  • ✓ Replies stay in thread
  • ✓ Inbound email as JSON
  • ✓ Bounces blocked for you

Send an email from your domain

Full reference →
Request
curl -X POST "https://api.iotabot.com/v1/messages" \
  -H "Authorization: Bearer $IOTABOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channel": "email",
  "to": "priya@example.com",
  "from": "support@acme.com",
  "subject": "Your order #1042",
  "html": "<p>Hi Priya, your order shipped.</p>"
}' \
  -H "Idempotency-Key: order-1042-shipped"
Response · 202
{
  "data": {
    "id": "6a4ba0f1c3f1a2b3c4d5e733",
    "object": "message",
    "status": "queued",
    "channel": "email",
    "conversation_id": "6a4b9e21c3f1a2b3c4d5e6f7",
    "created_at": "2026-10-01T09:16:10.004Z",
    "type": "email",
    "email": {
      "subject": "Order #1042",
      "mailbox": "support@acme.com",
      "customer": "priya@example.com",
      "message_id": "<0102019a1c.iotabot@acme.com>",
      "thread_id": "<CAF3kq1x@mail.gmail.com>",
      "from": "support@acme.com",
      "to": [
        "priya@example.com"
      ],
      "cc": [],
      "in_reply_to": "<CAF3kq1x@mail.gmail.com>",
      "references": "<CAF3kq1x@mail.gmail.com>"
    }
  }
}
Your domain
mail goes from your verified address
In thread
In-Reply-To and References set for you
JSON
every inbound email, parsed, on your webhook
10 MB
of attachments per message, any file type
How it works

Get started with the Email API in three steps

  1. 1

    Connect your mailbox

    Forward support@ (or any address) to IotaBot and verify your sending domain.

  2. 2

    Create an API key

    In Developers → API keys, create a key with messages:send and messages:read.

  3. 3

    Send and receive

    POST /v1/messages to send; add a webhook endpoint for inbound email.

Use cases

Email API use cases

Order and account emails

Send order confirmations, receipts and account notices from your own domain.

Support replies from your helpdesk

Reply to customers from your own tool — in their thread, from your support address.

Parse inbound email

Turn emails into tickets, leads or orders in your system from the JSON webhook.

One inbox with the AI

IotaBot's inbox shows every email, so your team and your code work the same threads.

Good to know

Built-in protections

  • Only verified domains can send - refused with sender_not_verified otherwise.
  • Hard-bounced and complained addresses are never emailed (recipient_suppressed).
  • Unsubscribed addresses can be answered, but not written to afresh (recipient_unsubscribed).
FAQ

Email API: frequently asked questions

What is an email API?

An email API lets your application send and receive email with HTTP requests instead of an email client. With IotaBot you send with POST /v1/messages and receive every inbound email as JSON on your webhook.

Can I send from my own domain?

Yes. Mail goes from your own address on your verified domain. GET /v1/email/senders lists the addresses you can send from.

Do replies stay in the same thread?

Yes. Reply with the conversation_id and IotaBot sets In-Reply-To and References to the customer's last email, so their mail client keeps one thread.

Can I receive emails through the API?

Yes. Forward your mailbox to IotaBot and add a webhook endpoint — each email arrives as JSON with from, to, cc, subject, text, sanitised and raw HTML, and attachments. See the inbound email API.

Can I send attachments?

Yes — any file type, up to 10 MB per message, uploaded first with POST /v1/files or attached inline as base64.

What happens with bounced addresses?

Addresses that bounced permanently or reported spam are refused before sending with recipient_suppressed, which protects your domain's sending reputation.

Is there a test mode?

Yes. A test key (ib_test_…) runs every check and can simulate an inbound email; nothing is sent.

Start building with the Email API

Create a key, send your first request, and try everything in test mode before it goes live.