Mailtea Inbound email API
The Inbound email API from Mailtea — 5 operation(s) for inbound email.
The Inbound email API from Mailtea — 5 operation(s) for inbound email.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/mailtea-app:mailtea-app-inbound-email-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Mailtea Inbound email API
version: 0.24.0
summary: Send transactional and marketing email, manage contacts and audiences, verify sending domains, render templates, and subscribe to webhook events.
description: Every endpoint lives under `/v1` and takes a Bearer token (`mt_pat_…` personal access token, `mt_svc_…` service key, or `mt_test_…` test key) in the `Authorization` header. The required scopes are listed per operation. This document is generated from the API reference at https://docs.mailtea.app/docs/api-reference.
termsOfService: https://mailtea.app/terms
contact:
name: Mailtea
url: https://mailtea.app
email: support@mailtea.app
license:
name: AGPL-3.0-only
identifier: AGPL-3.0-only
servers:
- url: https://api.mailtea.app
description: Mailtea cloud
tags:
- name: Inbound email
paths:
/v1/emails/inbound:
get:
operationId: inboundListEmails
summary: List Inbound Emails
description: 'List inbound emails for a publication
List inbound emails for a publication, ordered by newest first. Results are paginated using cursor-based pagination.'
tags:
- Inbound email
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/inbound/list-emails
parameters:
- name: publication_id
in: query
required: true
description: Filter to a specific publication.
schema:
type: string
- name: limit
in: query
required: false
description: Number of results per page. 1–100, default `20`.
schema:
type: number
- name: cursor
in: query
required: false
description: Pagination cursor from a previous response's `next_cursor`.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
object:
type: string
description: Always `"list"`.
data:
type: array
description: Array of inbound email summaries.
items:
type: object
properties:
id:
type: string
description: Unique email identifier.
from:
type: string
description: Sender address.
to:
type: array
items:
type: string
description: Recipient addresses.
cc:
type: array
items:
type: string
description: CC addresses.
bcc:
type: array
items:
type: string
description: BCC addresses.
reply_to:
type: array
items:
type: string
description: Reply-to addresses.
subject:
type: string
description: Email subject.
message_id:
type: string
description: RFC 822 Message-ID.
created_at:
type: string
description: ISO 8601 timestamp when the email arrived.
spam_verdict:
type:
- string
- 'null'
description: 'The spam check run on arrival: `PASS`, `FAIL`, `GRAY`, `PROCESSING_FAILED` or `DISABLED`. `null` where mail is not checked. New values may appear; treat anything but `PASS` as not confirmed.'
virus_verdict:
type:
- string
- 'null'
description: The virus check, same values. A `FAIL` means the attachments were withheld.
attachments_withheld:
type: boolean
description: '`true` when Mailtea deliberately did not store the attachments (today: a failed virus check).'
has_more:
type: boolean
description: Whether additional pages exist.
next_cursor:
type: string
description: Cursor to pass as the `cursor` query parameter for the next page. Only present when `has_more` is `true`.
example:
object: list
data:
- id: rxemail_abc123
from: customer@example.com
to:
- hello@newsletter.acme.com
cc: []
bcc: []
reply_to: []
subject: 'Re: Your latest issue'
message_id: <unique-id@example.com>
spam_verdict: PASS
virus_verdict: PASS
attachments_withheld: false
created_at: '2026-03-27T10:30:00.000Z'
has_more: true
next_cursor: eyJ0IjoiMjAyNi0wMy0yN1QxMDozMDowMC4wMDBaIiwiaSI6InJ4ZW1haWxfYWJjMTIzIn0
'400':
description: Missing required `publication_id` query parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized — missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth:
- issues:read
- bearerAuth:
- contacts:read
- bearerAuth:
- issues:send
x-mailtea-scopes:
- issues:read
- contacts:read
- issues:send
/v1/emails/inbound/{id}:
get:
operationId: inboundRetrieveEmail
summary: Retrieve Inbound Email
description: 'Get full details of an inbound email including headers and raw download
Retrieve the full details of an inbound email, including its parsed content, headers, attachments, and a signed URL to download the raw `.eml` file.'
tags:
- Inbound email
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/inbound/retrieve-email
parameters:
- name: id
in: path
required: true
description: The unique identifier of the inbound email.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
object:
type: string
description: Always `"email"`.
id:
type: string
description: Unique email identifier.
from:
type: string
description: Sender address.
to:
type: array
items:
type: string
description: Recipient addresses.
cc:
type: array
items:
type: string
description: CC addresses.
bcc:
type: array
items:
type: string
description: BCC addresses.
reply_to:
type: array
items:
type: string
description: Addresses the sender asked replies to go to. A [reply](/docs/api-reference/inbound/reply) goes to the first one by default.
subject:
type: string
description: Email subject.
message_id:
type: string
description: RFC 822 Message-ID.
in_reply_to:
type:
- string
- 'null'
description: RFC 5322 `In-Reply-To` — the Message-ID this email replies to, if any.
references:
type: array
items:
type: string
description: RFC 5322 `References` — the thread's ancestor Message-IDs. Empty when the email starts a new thread.
html:
type:
- string
- 'null'
description: Parsed HTML body.
text:
type:
- string
- 'null'
description: Parsed plain text body.
headers:
type: object
description: 'Every header as written, keyed by its lowercased name, such as `"from": "\"Pat Reader\" <pat@example.org>"`. A header that appears more than once, such as `received`, holds each value on its own line. Mail received before 2026-09-30 may hold a structured JSON value for address and content-type headers instead.'
created_at:
type: string
description: ISO 8601 timestamp when the email arrived.
raw:
type: object
properties:
download_url:
type: string
description: Signed URL to download the raw `.eml` file.
expires_at:
type: string
description: ISO 8601 timestamp when the download URL expires (1 hour).
spam_verdict:
type:
- string
- 'null'
description: 'The spam check run on arrival: `PASS`, `FAIL`, `GRAY`, `PROCESSING_FAILED` or `DISABLED`. `null` where mail is not checked. New values may appear; treat anything but `PASS` as not confirmed.'
virus_verdict:
type:
- string
- 'null'
description: The virus check, same values. A `FAIL` means the attachments were withheld.
spf_verdict:
type:
- string
- 'null'
description: Whether the sending server was allowed to send for the From domain (SPF).
dkim_verdict:
type:
- string
- 'null'
description: Whether the message carried a valid signature for its domain (DKIM).
dmarc_verdict:
type:
- string
- 'null'
description: 'Whether the From domain''s policy passed (DMARC): the strongest sign the From is genuine.'
attachments_withheld:
type: boolean
description: '`true` when Mailtea deliberately did not store the attachments (today: a failed virus check). `attachments` is then empty on purpose.'
attachments:
type: array
description: Attachment metadata. See [List Attachments](/docs/api-reference/inbound/list-attachments) for field descriptions.
example:
object: email
id: rxemail_abc123
from: customer@example.com
to:
- hello@newsletter.acme.com
cc: []
bcc: []
reply_to: []
subject: 'Re: Your latest issue'
message_id: <unique-id@example.com>
in_reply_to: <your-issue-id@newsletter.acme.com>
references:
- <your-issue-id@newsletter.acme.com>
html: <p>Great article, thanks for sharing!</p>
text: Great article, thanks for sharing!
headers:
subject: 'Re: Your latest issue'
from: customer@example.com
to: hello@newsletter.acme.com
date: Thu, 27 Mar 2026 10:30:00 +0000
message-id: <unique-id@example.com>
mime-version: '1.0'
content-type: multipart/alternative
created_at: '2026-03-27T10:30:00.000Z'
spam_verdict: PASS
virus_verdict: PASS
spf_verdict: PASS
dkim_verdict: PASS
dmarc_verdict: PASS
attachments_withheld: false
raw:
download_url: https://storage.mailtea.app/inbound/...
expires_at: '2026-03-27T11:30:00.000Z'
attachments:
- id: rxatt_xyz789
filename: screenshot.png
content_type: image/png
content_disposition: attachment
content_id: null
size: 24576
'401':
description: Unauthorized — missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found — email does not exist or belongs to a different organization.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth:
- issues:read
- bearerAuth:
- contacts:read
- bearerAuth:
- issues:send
x-mailtea-scopes:
- issues:read
- contacts:read
- issues:send
/v1/emails/inbound/{id}/attachments:
get:
operationId: listAttachments
summary: List Attachments
description: 'List all attachments on an inbound email with download URLs
List all attachments on an inbound email. Each attachment includes a signed download URL valid for 1 hour.'
tags:
- Inbound email
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/inbound/list-attachments
parameters:
- name: id
in: path
required: true
description: The unique identifier of the inbound email.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
object:
type: string
description: Always `"list"`.
data:
type: array
description: Array of attachment objects.
items:
type: object
properties:
id:
type: string
description: Unique attachment identifier.
filename:
type: string
description: Original filename.
content_type:
type: string
description: MIME type (e.g. `image/png`, `application/pdf`).
content_disposition:
type: string
description: Either `"attachment"` or `"inline"`.
content_id:
type:
- string
- 'null'
description: RFC 2392 Content-ID for inline attachments, or `null`.
size:
type: number
description: File size in bytes.
download_url:
type: string
description: Signed URL to download the file.
expires_at:
type: string
description: ISO 8601 timestamp when the download URL expires (1 hour).
has_more:
type: boolean
description: Always `false` — attachments are not paginated.
example:
object: list
data:
- id: rxatt_xyz789
filename: screenshot.png
content_type: image/png
content_disposition: attachment
content_id: null
size: 24576
download_url: https://storage.mailtea.app/inbound/...
expires_at: '2026-03-27T11:30:00.000Z'
has_more: false
'401':
description: Unauthorized — missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found — email does not exist or belongs to a different organization.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth:
- issues:read
- bearerAuth:
- contacts:read
- bearerAuth:
- issues:send
x-mailtea-scopes:
- issues:read
- contacts:read
- issues:send
/v1/emails/inbound/{id}/attachments/{attachmentId}:
get:
operationId: getAttachment
summary: Get Attachment
description: 'Get a single attachment with its download URL
Retrieve a single attachment from an inbound email, including a signed download URL valid for 1 hour.'
tags:
- Inbound email
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/inbound/get-attachment
parameters:
- name: id
in: path
required: true
description: The unique identifier of the inbound email.
schema:
type: string
- name: attachmentId
in: path
required: true
description: The unique identifier of the attachment.
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
object:
type: string
description: Always `"attachment"`.
id:
type: string
description: Unique attachment identifier.
filename:
type: string
description: Original filename.
content_type:
type: string
description: MIME type.
content_disposition:
type: string
description: Either `"attachment"` or `"inline"`.
content_id:
type:
- string
- 'null'
description: RFC 2392 Content-ID for inline attachments, or `null`.
size:
type: number
description: File size in bytes.
download_url:
type: string
description: Signed URL to download the file.
expires_at:
type: string
description: ISO 8601 timestamp when the download URL expires (1 hour).
example:
object: attachment
id: rxatt_xyz789
filename: screenshot.png
content_type: image/png
content_disposition: attachment
content_id: null
size: 24576
download_url: https://storage.mailtea.app/inbound/...
expires_at: '2026-03-27T11:30:00.000Z'
'401':
description: Unauthorized — missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found — attachment does not exist or belongs to a different organization.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth:
- issues:read
- bearerAuth:
- contacts:read
- bearerAuth:
- issues:send
x-mailtea-scopes:
- issues:read
- contacts:read
- issues:send
/v1/emails/inbound/{id}/reply:
post:
operationId: reply
summary: Reply to Inbound Email
description: 'Send a correctly-threaded reply to an inbound email
Reply to an inbound email. Mailtea derives the reply target and sets the RFC 5322 threading headers (`In-Reply-To`, `References`) from the original message, so the reply lands in the same conversation in the recipient''s inbox. The reply is sent through the same pipeline as `POST /v1/emails` — it appears in your transactional email history and emits the usual delivery webhooks.'
tags:
- Inbound email
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/inbound/reply
parameters:
- name: id
in: path
required: true
description: The id of the inbound email to reply to.
schema:
type: string
- name: Idempotency-Key
in: header
required: false
description: A client-generated key that makes the reply safe to retry. Replaying the same key with the same body returns the original result without sending again. Also accepted as the `idempotency_key` body field; the header wins when both are present.
schema:
type: string
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
html:
type: string
description: HTML body. At least one of `html` or `text` is required. Maximum 500,000 characters.
text:
type: string
description: Plain text body. At least one of `html` or `text` is required. Maximum 500,000 characters.
from:
type: object
description: 'Sender address `{ "email": string, "name"?: string }`. Must be on a verified sending domain. When omitted, Mailtea derives it from the address the original mail was delivered to (see below).'
subject:
type: string
description: 'Reply subject. Defaults to the original subject with a single `Re: ` prefix (never double-prefixed). Maximum 998 characters.'
to:
anyOf:
- type: string
- type: array
items:
type: string
description: Who the reply goes to. Omitted, the reply goes to the stored `Reply-To` when that is exactly one valid address, else the stored `From` when that is exactly one valid address, else the request is refused with `422 no_reply_target`. Given, every address must equal the single-address `From` or one single-address `Reply-To` entry (compared without case), else `422 reply_target_not_allowed`. Counts toward the 50-recipient limit.
cc:
type: array
items:
type: string
description: CC addresses. Maximum 50.
bcc:
type: array
items:
type: string
description: BCC addresses. Maximum 50.
attachments:
type: array
description: Files to attach. Up to 20, weighing at most 6 MiB together once decoded, and the whole reply must build under the provider's size limit. See [Attachment object](#attachment-object).
headers:
type: object
description: 'Only `Auto-Submitted` and `X-Auto-Response-Suppress`, any case, one line each. Set `"Auto-Submitted": "auto-replied"` on an automatic acknowledgement so out-of-office robots do not answer it. Any other header is refused with `400`.'
idempotency_key:
type: string
description: Alternative to the `Idempotency-Key` header.
responses:
'202':
description: Accepted
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: Id of the created transactional email (`txemail_`). Use it with [Retrieve Email](/docs/api-reference/emails/retrieve-email) to track delivery.
status:
type: string
description: Delivery status of the reply, `queued` on acceptance.
example:
id: txemail_9a1b2c3d
status: queued
'400':
description: Validation failed, or `from` was omitted and could not be derived from the original recipients. Validation includes a header other than `Auto-Submitted` and `X-Auto-Response-Suppress` (the error names `headers.<name>`), more than 20 files, files over 6 MiB together, content that is not base64 or is empty, a file name with `/`, `\` or control characters, or a reply too large to send.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized — missing or invalid token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
description: 'Account suspended or paused: payment required (with `reason` and `code`).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Insufficient permissions: the token lacks the `issues:send` scope; or the reply addressed someone it may not reach (`reason` / `code` `system_domain_recipient_restricted`). Two cases answer that: before your team has verified a sending domain, a reply may only go to the original sender or a verified team member; and a reply sent from the built-in `*.mailtea.email` address only ever reaches your own team. The `restriction` field names which: `no_verified_domain` or `built_in_sender`. Or a plan limit was reached (`reason` and `code`: `daily_cap`, `monthly_cap`, or `ramp_cap`, a new team''s daily limit in its first week).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: The inbound email does not exist or belongs to a different organization.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: 'Conflict: the `Idempotency-Key` was reused with a different body, or the original request is still being processed; or an earlier reply with this key was never handed over for delivery (`reason` and `code` `reply_failed`, and the next retry sends a fresh reply).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: 'The original email has no usable reply target, or `from` is not on a verified sending domain; or the reply, once its HTML is cleaned, would be too large to send (`reason` and `code`: `message_too_large`); or `to` named an address that is neither the original''s `From` nor its `Reply-To` (`reason` and `code`: `reply_target_not_allowed`).'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: 'The reply was stored but could not be handed over for delivery. Retry with the same `Idempotency-Key`: if it was never handed over, the retry makes a fresh reply; if Mailtea cannot tell, the retry answers with the first reply''s state instead of sending again.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security:
- bearerAuth:
- issues:send
x-mailtea-scopes:
- issues:send
components:
schemas:
Error:
type: object
description: Every error body carries `error`; validation failures add `details` and some refusals add a machine-readable `code`.
properties:
error:
type: string
code:
type: string
details:
type: array
items:
type: object
required:
- error
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: A Mailtea API key. Scopes such as `contacts:write` are properties of the key, chosen when it is created; each operation lists the scope it needs under `x-mailtea-scopes`. See https://docs.mailtea.app/docs/api-reference/authentication.
externalDocs:
description: API reference
url: https://docs.mailtea.app/docs/api-reference