Unitpost Email threads API
Work your inbox as conversations: list and read them, mark them read, report spam, block a sender, reply or forward, and delete a conversation, as Emails → Received does in the dashboard.
Work your inbox as conversations: list and read them, mark them read, report spam, block a sender, reply or forward, and delete a conversation, as Emails → Received does in the dashboard.
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-email-threads-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 Email threads 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: Email threads
description: 'Work your inbox as conversations: list and read them, mark them read, report spam, block a sender, reply or forward, and delete a conversation, as Emails → Received does in the dashboard.'
paths:
/email/threads:
get:
operationId: email_threads_list
tags:
- Email threads
summary: List conversations
description: 'Your inbox''s conversations, newest activity first, as Emails → Received shows them: each received message and the replies and forwards sent from it are one conversation. Every conversation is listed: read state and Spam are the dashboard''s. `q` searches the subject, the sender and the opening words. Page with `next_cursor` as `after`. `snippet` is null when the newest message is one you sent (or a copy of your own send): sent bodies aren''t on the API, and `q` never matches a withheld snippet, so a page can be shorter than `limit` while `has_more` is true. `q` shares the search rate policy. Any other query key is a `422`. Requires the `emails:read` capability.'
parameters:
- name: q
in: query
required: false
description: Search the subject, sender and opening words.
schema:
type: string
- name: limit
in: query
required: false
description: 1–100 (default 50).
schema:
type: integer
minimum: 1
maximum: 100
- name: after
in: query
required: false
description: The previous page's `next_cursor`.
schema:
type: string
responses:
'200':
description: A page of conversations.
content:
application/json:
schema:
type: object
properties:
object:
type: string
enum:
- list
has_more:
type: boolean
data:
type: array
items:
$ref: '#/components/schemas/EmailThread'
next_cursor:
type:
- string
- 'null'
description: Pass as `after` for the next page; null on the last.
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: A bad `limit` or `after`, or an unknown query key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/email/threads/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
get:
operationId: email_threads_get
tags:
- Email threads
summary: Retrieve a conversation
description: 'One conversation, oldest message first: what you received (bodies, `reply_to`, verdicts, attachments) and what you sent from it (status and recipients, no body). A long conversation comes in pages, newest first: this read holds its newest `limit` messages (fewer when their bodies are large), and `older_cursor` passed as `before` reads the messages before them, as the inbox''s "Show earlier messages" does. Answer a message with Reply to a conversation. Requires the `emails:read` capability.'
parameters:
- name: limit
in: query
required: false
description: Messages per read, 1–100 (default 50). A read stays under a size budget, so big messages can make it shorter.
schema:
type: integer
minimum: 1
maximum: 100
- name: before
in: query
required: false
description: 'The previous read''s `older_cursor`: read the messages before those.'
schema:
type: string
responses:
'200':
description: The conversation (one page of it).
content:
application/json:
schema:
$ref: '#/components/schemas/EmailThreadDetail'
'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: Conversation not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A bad `limit` or `before`, or an unknown query key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
operationId: email_threads_delete
tags:
- Email threads
summary: Delete a conversation
description: Delete a conversation for good, as the inbox's Delete does. Its received messages are erased (they still count toward usage, and never come back); replies and forwards sent from it stay on your sent emails. It can't be undone. Also requires `emails:read`. Requires the `emails:send` capability.
responses:
'200':
description: Deleted.
content:
application/json:
schema:
$ref: '#/components/schemas/EmailThreadDeleted'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope (`emails:read` and `emails:send`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Conversation not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/email/threads/{id}/reply:
parameters:
- name: id
in: path
required: true
schema:
type: string
post:
operationId: email_threads_reply
tags:
- Email threads
summary: Reply to a conversation
description: 'Reply, reply all or forward one received message of the conversation (`received_email_id`), as the inbox does: your `text` and/or `html` go on top and the original is quoted under them; a reply carries In-Reply-To and References; a forward carries the attachments you list in `forward_attachment_ids`. The message joins the conversation and the conversation is marked read. For a reply, send `to` the message''s `reply_to` addresses, else its `from`. It goes out now (no `scheduled_at`) through the same checks as any send. Pass an `Idempotency-Key`: a retry with it never sends twice. A copy of one of your own sends (`sent_by_us`) is never forwarded or quoted, since what you send isn''t readable through the API: a reply to it goes without the quote, and a forward of it is a `403`. Also requires `emails:read` (a reply quotes mail). Requires the `emails:send` capability.'
parameters:
- name: Idempotency-Key
in: header
required: false
description: Any unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`.
schema:
type: string
minLength: 1
maxLength: 256
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmailThreadReplyRequest'
responses:
'200':
description: Accepted for delivery.
content:
application/json:
schema:
$ref: '#/components/schemas/EmailThreadReplyResult'
'400':
description: The body isn't JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Insufficient scope (`emails:send` and `emails:read`), the sending gate refused it, or it would forward or quote a copy of one of your own sends.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Conversation or message not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: The `Idempotency-Key` is in use by a request still running, or with another body.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: A bad field, nothing written, or an unknown key (including `scheduled_at`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: Rate limited or over quota; honor `Retry-After`.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
EmailThreadReplyRequest:
type: object
properties:
received_email_id:
type: string
minLength: 1
description: The received message (`inb_…`) in this conversation to answer or forward.
mode:
type: string
enum:
- reply
- reply_all
- forward
description: '`reply` (the sender), `reply_all` (everyone on it), or `forward` (to someone new, with the original''s attachments you pick).'
from:
type: string
minLength: 3
maxLength: 320
description: One of your sending addresses, e.g. the address the message came in on.
to:
anyOf:
- type: string
minLength: 3
maxLength: 320
- maxItems: 50
type: array
items:
type: string
minLength: 3
maxLength: 320
description: 'For a reply: the message''s `reply_to`, else its `from`. Up to 50.'
cc:
description: Copy recipients, up to 50.
anyOf:
- type: string
minLength: 3
maxLength: 320
- maxItems: 50
type: array
items:
type: string
minLength: 3
maxLength: 320
bcc:
description: Blind-copy recipients, up to 50.
anyOf:
- type: string
minLength: 3
maxLength: 320
- maxItems: 50
type: array
items:
type: string
minLength: 3
maxLength: 320
subject:
type: string
minLength: 1
maxLength: 998
description: 'Usually `Re: <their subject>` (or `Fwd:`).'
text:
description: Your words, plain text. The original is quoted under them.
type: string
html:
description: Your words, HTML. The original is quoted under them.
type: string
include_quote:
description: 'Quote the original under a reply (default true; a forward always carries it). A copy of one of your own sends (`sent_by_us`) is never quoted: left out, it defaults to false there, and `true` is a `403`.'
type: boolean
forward_attachment_ids:
description: 'Forward only: the original''s attachments to carry over (their `id`s).'
maxItems: 20
type: array
items:
type: string
minLength: 1
attachments:
description: 'Files to attach: `content` (base64) or `path` (an https URL), up to 20 with the carried-over ones.'
maxItems: 20
type: array
items:
type: object
properties:
filename:
type: string
minLength: 1
maxLength: 255
content:
type: string
minLength: 1
path:
type: string
format: uri
content_type:
type: string
maxLength: 255
content_id:
type: string
maxLength: 255
required:
- filename
tracking:
description: Open and click tracking for this message; omitted = the sending domain's default.
type: boolean
required:
- received_email_id
- mode
- from
- to
- subject
EmailThread:
type: object
properties:
object:
type: string
const: email_thread
id:
type: string
subject:
anyOf:
- type: string
- type: 'null'
last_message_at:
type: string
last_direction:
type: string
enum:
- inbound
- outbound
snippet:
description: The newest received message's opening words; null when the newest message is one you sent.
anyOf:
- type: string
- type: 'null'
from:
description: 'The other party: the newest received message''s sender.'
anyOf:
- type: string
- type: 'null'
from_name:
anyOf:
- type: string
- type: 'null'
inbox_address:
description: Your address it came in on (the newest received message's To).
anyOf:
- type: string
- type: 'null'
message_count:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
has_attachments:
type: boolean
flagged:
type: boolean
description: A received message was flagged spam or virus, or failed SPF, DKIM or DMARC.
replied:
type: boolean
description: A reply or forward was sent from this conversation.
required:
- object
- id
- subject
- last_message_at
- last_direction
- snippet
- from
- from_name
- inbox_address
- message_count
- has_attachments
- flagged
- replied
EmailThreadReplyResult:
type: object
properties:
object:
type: string
enum:
- email
id:
type: string
description: The sent email (`email_…`); read it with `GET /email/{id}`.
status:
type: string
enum:
- queued
- scheduled
thread_id:
type:
- string
- 'null'
required:
- object
- id
- status
- thread_id
EmailThreadDetail:
type: object
properties:
object:
type: string
const: email_thread
id:
type: string
subject:
anyOf:
- type: string
- type: 'null'
last_message_at:
type: string
sender:
anyOf:
- type: object
properties:
address:
type: string
required:
- address
- type: 'null'
description: The other party; null when the conversation has no received mail.
older_hidden:
type: boolean
description: Older messages exist than the ones in `messages`; read them with `before` = `older_cursor`.
older_cursor:
description: Pass as `before` to read the messages before these (the next page back). Null when nothing older remains.
anyOf:
- type: string
- type: 'null'
sent_with_unitpost:
type: boolean
description: A reply from here carries the "Sent with Unitpost" line (your plan decides).
messages:
type: array
items:
oneOf:
- type: object
properties:
object:
type: string
const: received_email
direction:
type: string
const: inbound
id:
type: string
received_at:
type: string
from:
type: string
from_name:
anyOf:
- type: string
- type: 'null'
to:
type: array
items:
type: string
cc:
type: array
items:
type: string
reply_to:
type: array
items:
type: string
description: Reply-To addresses; answer these before `from` when present.
subject:
anyOf:
- type: string
- type: 'null'
message_id:
anyOf:
- type: string
- type: 'null'
text:
description: 'Null on a copy of one of your own sends (`sent_by_us`): sent bodies aren''t on the API.'
anyOf:
- type: string
- type: 'null'
html:
description: Inline (`cid:`) images point to short-lived links. Null on a copy of your own send.
anyOf:
- type: string
- type: 'null'
verdicts:
type: object
properties:
spam:
anyOf:
- type: string
- type: 'null'
virus:
anyOf:
- type: string
- type: 'null'
spf:
anyOf:
- type: string
- type: 'null'
dkim:
anyOf:
- type: string
- type: 'null'
dmarc:
anyOf:
- type: string
- type: 'null'
required:
- spam
- virus
- spf
- dkim
- dmarc
size:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
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
sent_by_us:
type: boolean
description: A copy of one of your own sends that came back in to your receiving domain.
duplicate:
type: boolean
description: It repeats a message the conversation already shows; the dashboard folds it away.
required:
- object
- direction
- id
- received_at
- from
- from_name
- to
- cc
- reply_to
- subject
- message_id
- text
- html
- verdicts
- size
- attachments
- sent_by_us
- duplicate
- type: object
properties:
object:
type: string
const: email
direction:
type: string
const: outbound
id:
type: string
created_at:
type: string
from:
type: string
to:
type: array
items:
type: string
cc:
type: array
items:
type: string
bcc:
type: array
items:
type: string
subject:
type: string
status:
type: string
enum:
- scheduled
- queued
- sent
- delivered
- bounced
- complained
- canceled
- failed
kind:
anyOf:
- type: string
enum:
- reply
- forward
- type: 'null'
description: Sent from this conversation; null for an earlier send a reply pulled in.
sent_at:
anyOf:
- type: string
- type: 'null'
delivered_at:
anyOf:
- type: string
- type: 'null'
opened_at:
anyOf:
- type: string
- type: 'null'
clicked_at:
anyOf:
- type: string
- type: 'null'
attachments:
type: array
items:
type: object
properties:
filename:
type: string
content_type:
anyOf:
- type: string
- type: 'null'
size:
type: integer
minimum: -9007199254740991
maximum: 9007199254740991
required:
- filename
- content_type
- size
required:
- object
- direction
- id
- created_at
- from
- to
- cc
- bcc
- subject
- status
- kind
- sent_at
- delivered_at
- opened_at
- clicked_at
- attachments
description: 'Oldest first. What you sent is metadata only: no body.'
required:
- object
- id
- subject
- last_message_at
- sender
- older_hidden
- older_cursor
- sent_with_unitpost
- messages
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
EmailThreadDeleted:
type: object
properties:
object:
type: string
enum:
- email_thread
id:
type: string
deleted:
type: boolean
enum:
- true
deleted_messages:
type: integer
description: Received messages erased.
required:
- object
- id
- deleted
- deleted_messages
securitySchemes:
apiKey:
type: http
scheme: bearer
description: Your workspace API key.