---
title: "Store an inbound email (raw MIME)"
method: POST
path: "/inbound-email/ingest"
tags: ["public"]
---

# Store an inbound email (raw MIME)

`POST /inbound-email/ingest`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/inbound-email/ingest`
- Auth: none required

Submitted at the DATA stage. `authentication` is the authentication metadata produced by the upstream SMTP service (sourceIp/helo/spf/dkim/dmarc/policy/results); missing or invalid metadata returns 503 so the upstream retries.

## Request body

- object
  - `from` string: Envelope sender
  - `to` string[]: RCPT TO recipient list
  - `rawBase64` string: Full MIME message, base64-encoded
  - `authentication` unknown

## Response `200`

Ingestion result

- object
  - `success` boolean, required
  - `stored` number, required: Number of newly stored recipients
  - `duplicates` number, required: Number of recipients skipped as duplicates or races

## Other responses

- `400`: Invalid request
- `401`: Inbound secret mismatch
- `404`: No matching inbox
- `413`: Email exceeds 10 MiB
- `503`: Not configured, or authentication metadata is missing or temporarily unavailable (the upstream should retry)

---

[API](https://skmtc.dev/mailly/apis/mailly-api.md) · [All operations](https://skmtc.dev/mailly/apis/mailly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailly/apis/mailly-api/revisions/1ceb29637301?raw)
