Mailtea Subscribe API
The Subscribe API from Mailtea — 2 operation(s) for subscribe.
The Subscribe API from Mailtea — 2 operation(s) for subscribe.
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-subscribe-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 Subscribe 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: Subscribe
paths:
/v1/public/subscribe:
post:
operationId: subscribe
summary: Subscribe
description: 'Add a reader to a publication from a public signup form
Sign a reader up to a publication. What happens next depends on the publication''s opt-in setting:
- **Single opt-in** (the default) — the contact is created or updated immediately and the response is `201`.
- **Double opt-in** — if the address is not already an `active` contact, the signup is held as pending, a confirmation email is sent, and the response is `202` with `status: "pending"`. **No contact is created.** An address that is already an `active` contact skips confirmation and gets the normal `201`.
A `suppressed` reader stays `suppressed`; signing up again never reactivates them.'
tags:
- Subscribe
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/subscribe/subscribe
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
description: The reader's email address.
publicationId:
type: string
description: The publication to subscribe to. Required **unless** the request `Host` matches a verified primary domain, in which case the publication is resolved from the host.
referrerContactId:
type: string
description: The contact ID of the reader who referred this signup. When it resolves to a contact in the same publication, Mailtea records a referral conversion.
required:
- email
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
example:
ok: true
contactId: sub_abc123
email: reader@example.com
publicationId: pub_123
status: active
'202':
description: Accepted
content:
application/json:
schema:
type: object
example:
ok: true
contactId: sub_abc123
email: reader@example.com
publicationId: pub_123
status: active
'400':
description: Invalid body (missing or malformed `email`), or no `publicationId` and the request host does not match a verified primary domain. For an invalid body, `error` is a sentence a form can show as it is (`Enter a valid email address.` for a bad `email`), and `details` holds the per-field errors (`fieldErrors`, `formErrors`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: The publication's site is private, or the list is at capacity (`This list isn't accepting new subscribers right now.`).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: '`publicationId` does not name an existing publication.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security: []
/v1/public/subscribe/confirm:
post:
operationId: confirmSubscription
summary: Confirm Subscription
description: 'Claim a double-opt-in confirmation token and create the contact
Complete a double-opt-in signup. The confirmation email links to a page at `/subscribe/confirm/{token}`; when the reader clicks the button on that page, the page posts the token here. That is what turns a pending signup into a real contact — the same `upsertContact` path a single-opt-in signup takes, so it fires the same `contact.created` webhook, enrolls the same automations, and counts against the same plan contact limit.
This is a `POST` behind a page with a button, not a `GET` that confirms on load. Link scanners and mail-client prefetchers open every URL in an email, and a confirming `GET` would let them confirm on the reader''s behalf.
Tokens are **single-use**: the token is claimed atomically, so a double-clicked link confirms exactly once and cannot double-fire a webhook or a welcome automation. Confirmation links are valid for **7 days**.'
tags:
- Subscribe
externalDocs:
url: https://docs.mailtea.app/docs/api-reference/subscribe/confirm-subscription
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
token:
type: string
description: The confirmation token from the email's link.
required:
- token
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
example:
ok: true
contactId: sub_abc123
email: reader@example.com
publicationId: pub_123
publicationName: Acme News
status: active
'400':
description: '`token is required` — the body carried no token.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: The list is at capacity (`This list isn't accepting new subscribers right now.`). Capacity is re-checked at confirmation because a pending signup consumes no contact quota.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: '`reason: "not_found"` — unknown token, or one that was already claimed by an earlier confirmation.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'410':
description: '`reason: "expired"` — the link is older than 7 days. The reader must sign up again.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
security: []
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