---
title: "Import a historic email onto one of your aliases."
method: POST
path: "/v1/mail/import"
tags: ["Mail"]
---

# Import a historic email onto one of your aliases.

`POST /v1/mail/import`

## Request

- Base URL: `https://api.inboxy.net`
- URL: `https://api.inboxy.net/v1/mail/import`
- Auth: HTTP bearer

REST mirror of the MCP `mail_import` tool. Requires `manage` scope. Push one raw RFC 5322 message (an `.eml`) that never arrived at inboxy — old order mail from another mailbox, say — and it is stored, classified and embedded for `mail_search` exactly like inbound mail. It is an archive write: never forwarded, never digested, stored as read, and its retention clock starts at import rather than at its own `Date:`. Mail whose `From:` is your own sign-in address is accepted and flagged `sent_by_user`. Dedup is per user on `Message-ID:`. Capped per UTC calendar month (500 free / 5000 paid); 10 MiB per message.

## Query parameters

- `address_id` string, uuid
- `address` string

## Response `200`

Already stored (`duplicate: true`); nothing changed.

- MailImportResult
  - `message_id` string, uuid, required: The `messages.id` — the newly stored row on a 201, or the already-existing row on a duplicate, so it can be fetched either way.
  - `message_id_rfc5322` string, required: The message's `Message-ID:`, or `<inboxy-import-{sha256}@inboxy.net>` synthesised from the bytes when the header is absent. Dedup key per user.
  - `duplicate` boolean, required: `true` when this Message-ID was already stored for you; nothing was written and the quota was not spent.
  - `sent_by_user` boolean, required: `true` when the `From:` is your own sign-in address — mail you sent. Stored for context; `mail_reply` refuses it.

## Other responses

- `201`: Stored and queued for classification + embedding.
- `400`: `bad_request` (neither `address_id` nor `address`, an `address` not on inboxy.net, or the two disagreeing) or `unparseable` (no `From:` address).
- `403`: Address not yours or retired, or `key_scope_mismatch` on an address-scoped key.
- `413`: `too_large` — over 10 MiB.
- `429`: `import_quota_exhausted` — body includes `period_resets_at`.

---

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