Skip to content

Mail API

REST endpoints for the Mail area of Lessly.

The Mail area publishes 51 REST endpoints. Paths are relative to https://api.lessly.com; see Authentication for the required header.

GET/mail/api-keys

List active API keys (prefix + metadata only, never the secret)

MCP tool: mail_apikey_list

Parameters

No parameters.

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
namestring
scopestring
prefixstring
domainIdstring | null
createdAtstring
POST/mail/api-keys

Issue a scoped sending API key; the full secret is returned only once

MCP tool: mail_apikey_create

Parameters

NameInTypeRequiredDescription
namebodystringHuman-readable label for the key
scopebodystringone of: full_access, sending_accessPermission scope: 'full_access' or 'sending_access'
domainIdbodystring (uuid)Optional Domain id this key is locked to

Response

Returns object.

FieldTypeAlwaysDescription
idstring
keystring
namestring
scopestring
prefixstring
domainIdstring | null
createdAtstring
DELETE/mail/api-keys/:id

Revoke an API key by id

MCP tool: mail_apikey_delete

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)UUID of the API key to revoke

Response

Returns object.

FieldTypeAlwaysDescription
idstring
revokedbooleanone of: true
GET/mail/audiences

List audiences for the current product

MCP tool: mail_audience_list

Parameters

No parameters.

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
namestring
createdAtstring
updatedAtstring
POST/mail/audiences

Create an audience (a named bucket of contacts) for the current product

MCP tool: mail_audience_create

Parameters

NameInTypeRequiredDescription
namebodystringHuman label for the audience

Response

Returns object.

FieldTypeAlwaysDescription
idstring
namestring
createdAtstring
updatedAtstring
GET/mail/audiences/:audienceId/contacts

List contacts in an audience

MCP tool: mail_contact_list

Parameters

NameInTypeRequiredDescription
audience_idquerystring (uuid)Audience to list contacts from
unsubscribedquerystring | booleanone of: true, falseFilter by unsubscribed flag
cursorquerystringOpaque pagination cursor from a prior page
limitqueryintegerMax items per page (1–100, default 50)
audienceIdpathstring

Response

Returns object.

FieldTypeAlwaysDescription
dataobject[]
nextCursorstring | null
POST/mail/audiences/:audienceId/contacts

Add a contact to an audience

MCP tool: mail_contact_create

Parameters

NameInTypeRequiredDescription
audience_idbodystring (uuid)Audience the contact belongs to
emailbodystringContact email address
propertiesbodyobjectCustom key/value properties (e.g. first_name, last_name)
unsubscribedbodybooleanMarketing opt-out flag
audienceIdpathstring

Response

Returns object.

FieldTypeAlwaysDescription
idstring
emailstring
createdAtstring
updatedAtstring
audienceIdstring
propertiesnull
unsubscribedboolean
DELETE/mail/audiences/:audienceId/contacts/:id

Delete a contact from an audience

MCP tool: mail_contact_delete

Parameters

NameInTypeRequiredDescription
audience_idbodystring (uuid)Audience id
idpathstring (uuid)Contact id
audienceIdpathstring

Response

Returns object.

FieldTypeAlwaysDescription
deletedboolean
GET/mail/audiences/:audienceId/contacts/:id

Get a single contact by id

MCP tool: mail_contact_get

Parameters

NameInTypeRequiredDescription
audience_idbodystring (uuid)Audience id
idpathstring (uuid)Contact id
audienceIdpathstring

Response

Returns object.

FieldTypeAlwaysDescription
idstring
emailstring
createdAtstring
updatedAtstring
audienceIdstring
propertiesnull
unsubscribedboolean
PATCH/mail/audiences/:audienceId/contacts/:id

Update a contact (properties or unsubscribed flag)

MCP tool: mail_contact_update

Parameters

NameInTypeRequiredDescription
audience_idbodystring (uuid)Audience id
idpathstring (uuid)Contact id
propertiesbodyobjectReplace the custom properties object
unsubscribedbodybooleanSet the marketing opt-out flag
audienceIdpathstring

Response

Returns object.

FieldTypeAlwaysDescription
idstring
emailstring
createdAtstring
updatedAtstring
audienceIdstring
propertiesnull
unsubscribedboolean
DELETE/mail/audiences/:id

Delete an audience and all its contacts (cascade)

MCP tool: mail_audience_delete

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Audience id to delete

Response

Returns object.

FieldTypeAlwaysDescription
deletedboolean
GET/mail/audiences/:id

Get a single audience by id

MCP tool: mail_audience_get

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Audience id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
namestring
createdAtstring
updatedAtstring
PATCH/mail/audiences/:id

Rename an audience

MCP tool: mail_audience_update

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Audience id
namebodystringNew name

Response

Returns object.

FieldTypeAlwaysDescription
idstring
namestring
createdAtstring
updatedAtstring
GET/mail/broadcasts

List broadcasts for the product (cursor-paginated)

MCP tool: mail_broadcast_list

Parameters

NameInTypeRequiredDescription
cursorquerystring
limitqueryinteger

Response

Returns object.

FieldTypeAlwaysDescription
itemsobject[]
nextCursorstring | null
POST/mail/broadcasts

Create a draft broadcast (inline content or a template reference) targeting an audience

MCP tool: mail_broadcast_create

Parameters

NameInTypeRequiredDescription
namebodystring
audienceIdbodystring (uuid)
frombodystring
replyTobodystring[]
headersbodyobject
subjectbodystring
htmlbodystring
textbodystring
templatebodyobject

Response

Returns object.

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring | null
namestring
textstring | null
sentAtstring (date-time) | null
statusstring
headersobject
replyTostring[]
subjectstring | null
queuedAtstring (date-time) | null
createdAtstring (date-time)
lastErrorstring | null
productIdstring
updatedAtstring (date-time)
variablesnull
audienceIdstring
templateIdstring | null
recipientCountnumber
DELETE/mail/broadcasts/:id

Delete a draft broadcast

MCP tool: mail_broadcast_delete

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)

Response

Returns object.

FieldTypeAlwaysDescription
idstring
deletedboolean
GET/mail/broadcasts/:id

Get one broadcast by id

MCP tool: mail_broadcast_get

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)

Response

Returns object.

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring | null
namestring
textstring | null
sentAtstring (date-time) | null
statusstring
headersobject
replyTostring[]
subjectstring | null
queuedAtstring (date-time) | null
createdAtstring (date-time)
lastErrorstring | null
productIdstring
updatedAtstring (date-time)
variablesnull
audienceIdstring
templateIdstring | null
recipientCountnumber
PATCH/mail/broadcasts/:id

Edit a draft broadcast

MCP tool: mail_broadcast_update

Parameters

NameInTypeRequiredDescription
namebodystring
audienceIdbodystring (uuid)
frombodystring
replyTobodystring[]
headersbodyobject
subjectbodystring
htmlbodystring
textbodystring
templatebodyobject
idpathstring (uuid)

Response

Returns object.

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring | null
namestring
textstring | null
sentAtstring (date-time) | null
statusstring
headersobject
replyTostring[]
subjectstring | null
queuedAtstring (date-time) | null
createdAtstring (date-time)
lastErrorstring | null
productIdstring
updatedAtstring (date-time)
variablesnull
audienceIdstring
templateIdstring | null
recipientCountnumber
POST/mail/broadcasts/:id/cancel

Cancel a draft or queued broadcast

MCP tool: mail_broadcast_cancel

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)

Response

Returns object.

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring | null
namestring
textstring | null
sentAtstring (date-time) | null
statusstring
headersobject
replyTostring[]
subjectstring | null
queuedAtstring (date-time) | null
createdAtstring (date-time)
lastErrorstring | null
productIdstring
updatedAtstring (date-time)
variablesnull
audienceIdstring
templateIdstring | null
recipientCountnumber
POST/mail/broadcasts/:id/queue

Queue a draft broadcast — fans out one email per eligible contact

MCP tool: mail_broadcast_queue

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)

Response

Returns object.

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring | null
namestring
textstring | null
sentAtstring (date-time) | null
statusstring
headersobject
replyTostring[]
subjectstring | null
queuedAtstring (date-time) | null
createdAtstring (date-time)
lastErrorstring | null
productIdstring
updatedAtstring (date-time)
variablesnull
audienceIdstring
templateIdstring | null
recipientCountnumber
GET/mail/broadcasts/:id/stats

Per-broadcast analytics: recipients/suppressed/failed + delivered/opened/clicked/bounced

MCP tool: mail_broadcast_stats

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)

Response

Returns object.

FieldTypeAlwaysDescription
failednumber
openednumber
bouncednumber
clickednumber
deliverednumber
recipientsnumber
suppressednumber
GET/mail/domains

List sending domains for the current product

MCP tool: mail_domain_list

Parameters

No parameters.

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
tlsstring
apexstring | null
modestring | null
namestring
activeboolean
regionstring
statusstring
recordsobject[]
createdAtstring
updatedAtstring
verifiedAtstring | null
instructionsstring[]
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring | null
governanceDomainIdstring | null
governanceBindingIdstring | null
verificationStartedAtstring
lastVerificationCheckAtstring | null
POST/mail/domains

Register a sending domain (SES Easy DKIM) and return the DNS records to publish

MCP tool: mail_domain_create

Parameters

NameInTypeRequiredDescription
namebodystringThe sending domain to register, e.g. "example.com"
regionbodystringAWS region for the SES identity (data residency); immutable after create

Response

Returns object.

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring | null
modestring | null
namestring
activeboolean
regionstring
statusstring
recordsobject[]
createdAtstring
updatedAtstring
verifiedAtstring | null
instructionsstring[]
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring | null
governanceDomainIdstring | null
governanceBindingIdstring | null
verificationStartedAtstring
lastVerificationCheckAtstring | null
DELETE/mail/domains/:id

Delete a sending domain and its SES identity

MCP tool: mail_domain_delete

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Domain id to delete

Response

Returns object.

FieldTypeAlwaysDescription
deletedboolean
GET/mail/domains/:id

Get a sending domain with its DNS records and per-record verification status

MCP tool: mail_domain_get

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Domain id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring | null
modestring | null
namestring
activeboolean
regionstring
statusstring
recordsobject[]
createdAtstring
updatedAtstring
verifiedAtstring | null
instructionsstring[]
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring | null
governanceDomainIdstring | null
governanceBindingIdstring | null
verificationStartedAtstring
lastVerificationCheckAtstring | null
PATCH/mail/domains/:id

Update tracking / TLS / return-path config for a domain

MCP tool: mail_domain_update

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Domain id
openTrackingbodybooleanEnable open tracking (1×1 pixel); off by default
clickTrackingbodybooleanEnable click tracking (link rewrite); off by default
trackingSubdomainbodystring | nullHost used for the click-redirect and open-pixel
tlsbodystringone of: opportunistic, enforcedTLS policy: opportunistic (default) or enforced

Response

Returns object.

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring | null
modestring | null
namestring
activeboolean
regionstring
statusstring
recordsobject[]
createdAtstring
updatedAtstring
verifiedAtstring | null
instructionsstring[]
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring | null
governanceDomainIdstring | null
governanceBindingIdstring | null
verificationStartedAtstring
lastVerificationCheckAtstring | null
POST/mail/domains/:id/verify

Re-check a domain's DNS + SES verification immediately

MCP tool: mail_domain_verify

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Domain id to re-check now

Response

Returns object.

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring | null
modestring | null
namestring
activeboolean
regionstring
statusstring
recordsobject[]
createdAtstring
updatedAtstring
verifiedAtstring | null
instructionsstring[]
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring | null
governanceDomainIdstring | null
governanceBindingIdstring | null
verificationStartedAtstring
lastVerificationCheckAtstring | null
GET/mail/domains/allowed

List apex domains this product may register sending domains under (from governance)

MCP tool: mail_domain_allowed_list

Parameters

No parameters.

Response

Returns object[].

Item fieldTypeAlwaysDescription
modestring
domainstring
domainIdstring
extensionCountnumber
POST/mail/emails

Send a single email

MCP tool: mail_email_send

Parameters

NameInTypeRequiredDescription
frombodystringSender, e.g. "Name <you@your-domain.com>"
tobodystring | string[]Primary recipient(s)
ccbodystring | string[]Cc recipient(s)
bccbodystring | string[]Bcc recipient(s) — not shown in headers
subjectbodystringEmail subject (required for inline sends)
reply_tobodystring | string[]Reply-To address(es)
htmlbodystringHTML body
textbodystringPlain-text body; auto-derived from html if omitted
headersbodyobjectCustom headers map
tagsbodyobject[]Metadata tags
templatebodyobjectSend by reference to a published template
scheduled_atbodystringISO-8601 instant to send at; future, within 30 days. Omit to send now.

Response

Returns object.

FieldTypeAlwaysDescription
idstring
GET/mail/emails/:id

Retrieve an email by id, with its last event

MCP tool: mail_email_get

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Email id

Response

Returns null.

PATCH/mail/emails/:id

Reschedule a scheduled email to a new ISO-8601 instant

MCP tool: mail_email_update

Parameters

NameInTypeRequiredDescription
scheduled_atbodystringNew ISO-8601 instant; future, within 30 days
idpathstring (uuid)Email id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
POST/mail/emails/:id/cancel

Cancel a scheduled email

MCP tool: mail_email_cancel

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Email id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
statusstringone of: canceled
POST/mail/emails/batch

Send up to 100 emails in one atomic batch

MCP tool: mail_email_send_batch

Parameters

NameInTypeRequiredDescription
emailsbodyobject[]Up to 100 emails to send, each shaped like a single send

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
GET/mail/reputation

Current sender-reputation status for the product: hard-bounce and complaint rates over the rolling window, the sample volume, whether sends are throttled, the tripped metric, and the configured thresholds

MCP tool: mail_reputation_get

Parameters

No parameters.

Response

Returns object.

FieldTypeAlwaysDescription
gatedboolean
volumenumber
complaintsnumber
thresholdsobject
window_daysnumber
hard_bouncesnumber
complaint_ratenumber
tripped_metricstring | null
hard_bounce_ratenumber
GET/mail/stats

Dashboard aggregation for the product over 7d|30d|90d: sent/delivered/bounced/complained totals, period-over-period deltas, daily volume buckets, and deliverability percentages

MCP tool: mail_stats_get

Parameters

NameInTypeRequiredDescription
periodquerystringone of: 7d, 30d, 90d

Response

Returns object.

FieldTypeAlwaysDescription
rangeobject
deltasobject
periodstring
totalsobject
volumeobject[]
deliverabilityobject
GET/mail/suppressions

List suppressed recipient addresses for the current product (paginated, filter by reason or address substring)

MCP tool: mail_suppression_list

Parameters

NameInTypeRequiredDescription
reasonquerystringone of: hard_bounce, complaint, manual, unsubscribeFilter by reason
qquerystringCase-insensitive substring match on address
cursorquerystringOpaque pagination cursor from a prior page
limitqueryintegerMax items per page (1–100, default 50)

Response

Returns object.

FieldTypeAlwaysDescription
itemsobject[]
next_cursorstring | null
POST/mail/suppressions

Manually suppress a recipient address (reason is always "manual"); idempotent

MCP tool: mail_suppression_add

Parameters

NameInTypeRequiredDescription
addressbodystringEmail address to suppress
notebodystringOptional free-text note

Response

Returns object.

FieldTypeAlwaysDescription
idstring
notestring | null
reasonstring
addressstring
created_atstring
source_event_idstring | null
DELETE/mail/suppressions/:address

Remove an address from the suppression list; idempotent (returns whether a row existed)

MCP tool: mail_suppression_remove

Parameters

NameInTypeRequiredDescription
addresspathstringEmail address to remove from the suppression list

Response

Returns object.

FieldTypeAlwaysDescription
addressstring
removedboolean
GET/mail/templates

List email templates for the current product

MCP tool: mail_template_list

Parameters

No parameters.

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring | null
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesobject[]
POST/mail/templates

Create a draft email template with typed {{ variable }} placeholders

MCP tool: mail_template_create

Parameters

NameInTypeRequiredDescription
namebodystringHuman label for the template
subjectbodystringEmail subject; may contain {{ variable }} placeholders
htmlbodystringHTML body; may contain {{ variable }} placeholders
textbodystringOptional plaintext body; derived from html when omitted
variablesbodyobject[]Declared variables ([{name,type,optional,fallback}], <=20)

Response

Returns object.

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring | null
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesobject[]
DELETE/mail/templates/:id

Delete a template

MCP tool: mail_template_delete

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Template id to delete

Response

Returns object.

FieldTypeAlwaysDescription
deletedboolean
GET/mail/templates/:id

Get a single email template by id, with its send-usage rollup

MCP tool: mail_template_get

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Template id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring | null
usageobject
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesobject[]
PATCH/mail/templates/:id

Update a draft template (published templates are not editable)

MCP tool: mail_template_update

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Template id
namebodystring
subjectbodystring
htmlbodystring
textbodystring | null
variablesbodyobject[]

Response

Returns object.

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring | null
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesobject[]
POST/mail/templates/:id/publish

Publish a template (draft -> published)

MCP tool: mail_template_publish

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Template id to publish

Response

Returns object.

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring | null
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesobject[]
GET/mail/usage

Current free-tier usage for the product: emails sent this day and month with used/limit/remaining, the hard cap, a blocked flag, and the point-in-time contacts count

MCP tool: mail_usage_get

Parameters

No parameters.

Response

Returns object.

FieldTypeAlwaysDescription
emailsobject
periodobject
contactsobject
GET/mail/webhooks

List webhook endpoints for the current product (secret omitted).

MCP tool: mail_webhook_list

Parameters

No parameters.

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
urlstring
enabledboolean
created_atstring
updated_atstring
descriptionstring | null
enabled_eventsstring[]
POST/mail/webhooks

Register a webhook endpoint for the current product. Returns the signing secret ONCE.

MCP tool: mail_webhook_create

Parameters

NameInTypeRequiredDescription
urlbodystring (uri)HTTPS URL that signed events are POSTed to
enabled_eventsbodystring[]one of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clickedEvent types to deliver. One or more of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clicked
descriptionbodystringOptional human label

Response

Returns object.

FieldTypeAlwaysDescription
idstring
urlstring
secretstring
enabledboolean
created_atstring
updated_atstring
descriptionstring | null
enabled_eventsstring[]
DELETE/mail/webhooks/:id

Delete a webhook endpoint.

MCP tool: mail_webhook_delete

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Webhook endpoint id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
deletedboolean
GET/mail/webhooks/:id

Get a webhook endpoint by id (secret omitted).

MCP tool: mail_webhook_get

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Webhook endpoint id

Response

Returns object.

FieldTypeAlwaysDescription
idstring
urlstring
enabledboolean
created_atstring
updated_atstring
descriptionstring | null
enabled_eventsstring[]
PATCH/mail/webhooks/:id

Update a webhook endpoint (url, enabled_events, description, or enable/disable).

MCP tool: mail_webhook_update

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Webhook endpoint id
urlbodystring (uri)HTTPS URL that signed events are POSTed to
enabled_eventsbodystring[]one of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clickedEvent types to deliver. One or more of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clicked
descriptionbodystring | nullOptional human label
enabledbodybooleanEnable (true) or disable (false) delivery

Response

Returns object.

FieldTypeAlwaysDescription
idstring
urlstring
enabledboolean
created_atstring
updated_atstring
descriptionstring | null
enabled_eventsstring[]
GET/mail/webhooks/:id/deliveries

List recent delivery attempts for a webhook endpoint (status, attempts, last error).

MCP tool: mail_webhook_deliveries_list

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Webhook endpoint id
limitqueryintegerMax items (1-100, default 50)

Response

Returns object[].

Item fieldTypeAlwaysDescription
idstring
statusstring
attemptsnumber
event_idstring
created_atstring
event_typestring
last_errorstring | null
updated_atstring
endpoint_idstring
last_attempt_atstring | null
response_statusnumber | null
Was this page helpful?
Esc

Start typing to search the docs.

navigateselect