Unitpost Inbound emails API
Read email your receiving-enabled domains have received — list messages, retrieve full bodies, and download attachments via short-lived signed URLs.
Read email your receiving-enabled domains have received — list messages, retrieve full bodies, and download attachments via short-lived signed URLs.
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/unitpost-com:unitpost-com-inbound-emails-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: Unitpost Inbound emails API
version: v1
description: 'Public, versioned API for sending email and SMS and managing contacts, segments, campaigns, templates, domains, and webhooks. SMS is included on paid plans; on the free plan `POST /sms` returns `403` with `limit_reached`. Authenticate every request with an API key: `Authorization: Bearer `. A `User-Agent` header is required. Requests are scoped to the workspace that owns the key and are rate-limited per workspace. List endpoints are cursor-paginated via `limit`/`after`/`before` and return a `{ object: "list", has_more, data }` envelope. Register webhook endpoints to receive events: each create returns a `signing_secret` (`whsec_…`) exactly once. Every delivery is **svix-compatible**: it carries `svix-id`, `svix-timestamp`, and `svix-signature` (`v1,`) headers computed over `..` with your secret — verify them and reject deliveries whose signature doesn''t match (any Svix-compatible library works). Inbound email that lands on a receiving-enabled domain is readable under `/email/received`.'
servers:
- url: https://www.unitpost.com/api/v1
description: Base URL
security:
- apiKey: []
tags:
- name: Inbound emails
description: Read email your receiving-enabled domains have received — list messages, retrieve full bodies, and download attachments via short-lived signed URLs.
paths:
/email/received:
get:
operationId: email_received_list
tags:
- Inbound emails
summary: List received emails
description: Retrieve a list of inbound emails received on your receiving-enabled domains, newest-first and cursor-paginated. Rows are summaries (sender, subject, timestamps) without bodies — use a message's `id` with Retrieve a received email to read the full content and attachment metadata. Narrow the list with `to` (one address in the To or Cc header), `thread_id` (one conversation) and a `created_after` / `created_before` range. Requires the `emails:read` capability.
parameters:
- name: limit
in: query
required: false
description: Max rows to return (default 20, max 100).
schema:
type: integer
minimum: 1
maximum: 100
- name: after
in: query
required: false
description: Return rows after this id (forward paging).
schema:
type: string
- name: before
in: query
required: false
description: Return rows before this id (backward paging).
schema:
type: string
- name: to
in: query
required: false
description: Only mail with this address in its To or Cc header, in any case. Envelope recipients aren't stored, so a Bcc copy or a forward to one of your addresses is matched by its headers only.
schema:
type: string
- name: thread_id
in: query
required: false
description: Only the messages of this conversation (`thr_…`), as `thread_id` on a received email and on the `email.received` webhook.
schema:
type: string
- name: created_after
in: query
required: false
description: Only mail whose `created_at` is at/after this ISO 8601 time (with `Z` or an offset).
schema:
type: string
- name: created_before
in: query
required: false
description: Only mail whose `created_at` is at/before this ISO 8601 time (with `Z` or an offset).
schema:
type: string
responses:
'200':
description: A page of received emails.
content:
application/json:
schema:
type: object
properties:
object:
type: string
enum:
- list
has_more:
type: boolean
data:
type: array
items:
$ref: '#/components/schemas/ReceivedEmailSummary'
required:
- object
- has_more
- data
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Invalid pagination params, or a `created_after` / `created_before` that isn't an ISO 8601 time with a zone.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/email/received/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
get:
operationId: email_received_get
tags:
- Inbound emails
summary: Retrieve a received email
description: Retrieve a full inbound message by `id`, including its HTML and text bodies plus metadata for every attachment. Attachment bytes aren't inlined — download each one via Get an attachment download URL. Browse your inbound mail with List received emails. Requires the `emails:read` capability.
responses:
'200':
description: The received email.
content:
application/json:
schema:
$ref: '#/components/schemas/ReceivedEmail'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Received email not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/email/received/{id}/attachments/{attachmentId}:
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: attachmentId
in: path
required: true
schema:
type: string
get:
operationId: email_received_attachment_url
tags:
- Inbound emails
summary: Get an attachment download URL
description: 'Get a short-lived, signed URL for downloading one inbound attachment''s bytes. Fetch the URL and download promptly — it expires quickly (the expiry is included in the response). Find attachment ids on the message via Retrieve a received email. A copy of an email you sent (`sent_by_us`) is a `403`, like its body: what you send isn''t readable through the API. Requires the `emails:read` capability.'
responses:
'200':
description: A signed download URL.
content:
application/json:
schema:
$ref: '#/components/schemas/ReceivedAttachmentUrl'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope, or the email is a copy of one you sent (`forbidden`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Attachment not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'503':
description: Attachment storage is not configured / unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/email/received/{id}/raw:
parameters:
- name: id
in: path
required: true
schema:
type: string
get:
operationId: email_received_raw_url
tags:
- Inbound emails
summary: Get a received email's original message
description: 'Get a short-lived, signed URL for the received message''s full original MIME (`.eml`), headers, every part and attachment included. A body over 256 KB isn''t inlined on Retrieve a received email, so this is how to read it. Download promptly: the URL expires in about 5 minutes. Stored messages are kept 30 days. A copy of an email you sent (`sent_by_us`) is a `403`. Requires the `emails:read` capability.'
responses:
'200':
description: A signed download URL.
content:
application/json:
schema:
$ref: '#/components/schemas/ReceivedEmailRaw'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope, or the email is a copy of one you sent (`forbidden`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Received email not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A query key (this operation takes none).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'503':
description: Inbound storage is not configured / unavailable.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
ReceivedAttachmentUrl:
type: object
properties:
object:
type: string
enum:
- received_attachment_url
url:
type: string
description: A signed, expiring URL to download the attachment bytes.
expires_at:
type: string
description: ISO 8601 expiry of the signed URL (~5 minutes out).
required:
- object
- url
- expires_at
ReceivedEmail:
type: object
properties:
object:
type: string
const: received_email
id:
type: string
from:
type: string
from_name:
anyOf:
- type: string
- type: 'null'
to:
type: array
items:
type: string
cc:
type: array
items:
type: string
bcc:
type: array
items:
type: string
message_id:
anyOf:
- type: string
- type: 'null'
subject:
anyOf:
- type: string
- type: 'null'
text:
anyOf:
- type: string
- type: 'null'
html:
anyOf:
- type: string
- type: 'null'
spam_verdict:
anyOf:
- type: string
- type: 'null'
virus_verdict:
anyOf:
- type: string
- type: 'null'
spf_verdict:
anyOf:
- type: string
- type: 'null'
dkim_verdict:
anyOf:
- type: string
- type: 'null'
dmarc_verdict:
anyOf:
- type: string
- type: 'null'
size:
type: number
attachments:
type: array
items:
type: object
properties:
object:
type: string
const: received_attachment
id:
type: string
filename:
anyOf:
- type: string
- type: 'null'
content_type:
anyOf:
- type: string
- type: 'null'
content_disposition:
anyOf:
- type: string
- type: 'null'
content_id:
anyOf:
- type: string
- type: 'null'
size:
type: number
required:
- object
- id
- filename
- content_type
- content_disposition
- content_id
- size
received_at:
type: string
created_at:
type: string
thread_id:
description: The conversation (`thr_…`); null until the message is threaded.
anyOf:
- type: string
- type: 'null'
reply_to:
type: array
items:
type: string
description: 'Reply-To addresses: answer these before `from` when present.'
headers:
type: object
propertyNames:
type: string
additionalProperties:
type: string
description: 'The headers we keep, by lower-case name: `date`, `in-reply-to`, `references`, `reply-to`, `return-path`, `list-unsubscribe` (when present).'
sent_by_us:
description: 'A copy of one of your own sends that came back to your receiving domain. Its `text` and `html` are null: sent bodies aren''t on the API (they can carry a sign-in or reset link).'
type: boolean
required:
- object
- id
- from
- from_name
- to
- cc
- bcc
- message_id
- subject
- text
- html
- spam_verdict
- virus_verdict
- spf_verdict
- dkim_verdict
- dmarc_verdict
- size
- attachments
- received_at
- created_at
Error:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable machine-readable error code (branch on this, not the message).
message:
type: string
description: 'Human-readable summary. For validation errors it''s path-prefixed (e.g. "template.variables.first_name: …").'
details:
type: array
description: 'Present on errors that carry per-field reasons: validation errors (422), a blocked campaign send (409), a plan that doesn''t include a feature (403 `limit_reached` with one entry whose `code` is `feature_not_in_plan` and whose `field` names the feature, e.g. `smsChannel`), and a send cap (429 `quota_exceeded` with one entry, `field` empty, whose `code` says which cap: `daily_quota_exceeded` or `monthly_quota_exceeded` (the free plan''s daily or monthly cap), `plan_required` (the workspace needs a paid plan to send this), `allowance_used` (a paid plan''s allowance is spent and it has no pay-as-you-go), `shared_plan_cap` (the organization''s shared plan, or this workspace''s cap on it, is used up) or `risk_throttled` (the account review''s daily cap, which an upgrade doesn''t lift)). One entry per offending field/blocker.'
items:
type: object
properties:
field:
type: string
description: Dotted path to the field, e.g. "template.variables.first_name" (empty for a whole-body problem).
code:
type: string
description: Machine-readable reason for this entry, when there is one (e.g. `template_not_published` on `template_id` for a blocked SMS campaign send, or `feature_not_in_plan` on `smsChannel` when the plan has no SMS). Absent on plain validation errors.
message:
type: string
required:
- field
- message
doc_url:
type: string
format: uri
description: 'A page that explains this error and what to do, when there is one: an absolute link on the API''s own host. Every 429 has one (a section of the rate-limits guide: the request limit, an operation''s limit, the plan''s send caps or the account review cap), as do `sending_paused`, the SMS access review''s `sms_review_pending` and `account_under_review`, and errors about domains, API keys, idempotency keys, plan limits, billing, SMS consent and suppression. A `details[].code` with a page of its own picks it. Additive; absent otherwise.'
required:
- code
- message
required:
- error
ReceivedEmailRaw:
type: object
properties:
object:
type: string
enum:
- received_email_raw
url:
type: string
description: A signed, expiring URL to download the original message (.eml, RFC 5322).
expires_at:
type: string
description: ISO 8601 expiry of the signed URL (~5 minutes out).
size_bytes:
type: integer
description: The message's size in bytes.
required:
- object
- url
- expires_at
- size_bytes
ReceivedEmailSummary:
type: object
properties:
object:
type: string
const: received_email
id:
type: string
from:
type: string
from_name:
anyOf:
- type: string
- type: 'null'
to:
type: array
items:
type: string
cc:
type: array
items:
type: string
bcc:
type: array
items:
type: string
message_id:
anyOf:
- type: string
- type: 'null'
subject:
anyOf:
- type: string
- type: 'null'
spam_verdict:
anyOf:
- type: string
- type: 'null'
virus_verdict:
anyOf:
- type: string
- type: 'null'
spf_verdict:
anyOf:
- type: string
- type: 'null'
dkim_verdict:
anyOf:
- type: string
- type: 'null'
dmarc_verdict:
anyOf:
- type: string
- type: 'null'
size:
type: number
received_at:
type: string
created_at:
type: string
thread_id:
description: The conversation (`thr_…`); null until the message is threaded.
anyOf:
- type: string
- type: 'null'
reply_to:
type: array
items:
type: string
description: 'Reply-To addresses: answer these before `from` when present.'
attachment_count:
type: number
required:
- object
- id
- from
- from_name
- to
- cc
- bcc
- message_id
- subject
- spam_verdict
- virus_verdict
- spf_verdict
- dkim_verdict
- dmarc_verdict
- size
- received_at
- created_at
- attachment_count
securitySchemes:
apiKey:
type: http
scheme: bearer
description: Your workspace API key.