Skip to content

REST API

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.

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
scopebodystringPermission scope: 'full_access' or 'sending_access'
domainIdbodystringOptional Domain id this key is locked to

Response

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

Revoke an API key by id

MCP tool: mail_apikey_delete

Parameters

NameInTypeRequiredDescription
idpathstringUUID of the API key to revoke

Response

FieldTypeAlwaysDescription
idstring
revokedboolean
GET/mail/audiences

List audiences for the current product

MCP tool: mail_audience_list

Parameters

No parameters.

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

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

List contacts in an audience

MCP tool: mail_contact_list

Parameters

NameInTypeRequiredDescription
audience_idquerystringAudience to list contacts from
unsubscribedquerystringFilter by unsubscribed flag
cursorquerystringOpaque pagination cursor from a prior page
limitqueryintegerMax items per page (1–100, default 50)
audienceIdpathstring

Response

FieldTypeAlwaysDescription
dataarray
nextCursorstring
POST/mail/audiences/:audienceId/contacts

Add a contact to an audience

MCP tool: mail_contact_create

Parameters

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

Response

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

Delete a contact from an audience

MCP tool: mail_contact_delete

Parameters

NameInTypeRequiredDescription
audience_idbodystringAudience id
idpathstringContact id
audienceIdpathstring

Response

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

Get a single contact by id

MCP tool: mail_contact_get

Parameters

NameInTypeRequiredDescription
audience_idbodystringAudience id
idpathstringContact id
audienceIdpathstring

Response

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

Update a contact (properties or unsubscribed flag)

MCP tool: mail_contact_update

Parameters

NameInTypeRequiredDescription
audience_idbodystringAudience id
idpathstringContact id
propertiesbodyobjectReplace the custom properties object
unsubscribedbodybooleanSet the marketing opt-out flag
audienceIdpathstring

Response

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

Delete an audience and all its contacts (cascade)

MCP tool: mail_audience_delete

Parameters

NameInTypeRequiredDescription
idpathstringAudience id to delete

Response

FieldTypeAlwaysDescription
deletedboolean
GET/mail/audiences/:id

Get a single audience by id

MCP tool: mail_audience_get

Parameters

NameInTypeRequiredDescription
idpathstringAudience id

Response

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

Rename an audience

MCP tool: mail_audience_update

Parameters

NameInTypeRequiredDescription
idpathstringAudience id
namebodystringNew name

Response

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

FieldTypeAlwaysDescription
itemsarray
nextCursorstring
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
frombodystring
replyTobodyarray
headersbodyobject
subjectbodystring
htmlbodystring
textbodystring
templatebodyobject

Response

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring
namestring
textstring
sentAtstring
statusstring
headersobject
replyToarray
subjectstring
queuedAtstring
createdAtstring
lastErrorstring
productIdstring
updatedAtstring
variablesstring
audienceIdstring
templateIdstring
recipientCountnumber
DELETE/mail/broadcasts/:id

Delete a draft broadcast

MCP tool: mail_broadcast_delete

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
idstring
deletedboolean
GET/mail/broadcasts/:id

Get one broadcast by id

MCP tool: mail_broadcast_get

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring
namestring
textstring
sentAtstring
statusstring
headersobject
replyToarray
subjectstring
queuedAtstring
createdAtstring
lastErrorstring
productIdstring
updatedAtstring
variablesstring
audienceIdstring
templateIdstring
recipientCountnumber
PATCH/mail/broadcasts/:id

Edit a draft broadcast

MCP tool: mail_broadcast_update

Parameters

NameInTypeRequiredDescription
namebodystring
audienceIdbodystring
frombodystring
replyTobodyarray
headersbodyobject
subjectbodystring
htmlbodystring
textbodystring
templatebodyobject
idpathstring

Response

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring
namestring
textstring
sentAtstring
statusstring
headersobject
replyToarray
subjectstring
queuedAtstring
createdAtstring
lastErrorstring
productIdstring
updatedAtstring
variablesstring
audienceIdstring
templateIdstring
recipientCountnumber
POST/mail/broadcasts/:id/cancel

Cancel a draft or queued broadcast

MCP tool: mail_broadcast_cancel

Parameters

NameInTypeRequiredDescription
idpathstring

Response

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring
namestring
textstring
sentAtstring
statusstring
headersobject
replyToarray
subjectstring
queuedAtstring
createdAtstring
lastErrorstring
productIdstring
updatedAtstring
variablesstring
audienceIdstring
templateIdstring
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

Response

FieldTypeAlwaysDescription
idstring
fromstring
htmlstring
namestring
textstring
sentAtstring
statusstring
headersobject
replyToarray
subjectstring
queuedAtstring
createdAtstring
lastErrorstring
productIdstring
updatedAtstring
variablesstring
audienceIdstring
templateIdstring
recipientCountnumber
GET/mail/broadcasts/:id/stats

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

MCP tool: mail_broadcast_stats

Parameters

NameInTypeRequiredDescription
idpathstring

Response

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.

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

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring
modestring
namestring
activeboolean
regionstring
statusstring
recordsarray
createdAtstring
updatedAtstring
verifiedAtstring
instructionsarray
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring
governanceDomainIdstring
governanceBindingIdstring
verificationStartedAtstring
lastVerificationCheckAtstring
DELETE/mail/domains/:id

Delete a sending domain and its SES identity

MCP tool: mail_domain_delete

Parameters

NameInTypeRequiredDescription
idpathstringDomain id to delete

Response

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
idpathstringDomain id

Response

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring
modestring
namestring
activeboolean
regionstring
statusstring
recordsarray
createdAtstring
updatedAtstring
verifiedAtstring
instructionsarray
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring
governanceDomainIdstring
governanceBindingIdstring
verificationStartedAtstring
lastVerificationCheckAtstring
PATCH/mail/domains/:id

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

MCP tool: mail_domain_update

Parameters

NameInTypeRequiredDescription
idpathstringDomain id
openTrackingbodybooleanEnable open tracking (1×1 pixel); off by default
clickTrackingbodybooleanEnable click tracking (link rewrite); off by default
trackingSubdomainbodystringHost used for the click-redirect and open-pixel
tlsbodystringTLS policy: opportunistic (default) or enforced

Response

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring
modestring
namestring
activeboolean
regionstring
statusstring
recordsarray
createdAtstring
updatedAtstring
verifiedAtstring
instructionsarray
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring
governanceDomainIdstring
governanceBindingIdstring
verificationStartedAtstring
lastVerificationCheckAtstring
POST/mail/domains/:id/verify

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

MCP tool: mail_domain_verify

Parameters

NameInTypeRequiredDescription
idpathstringDomain id to re-check now

Response

FieldTypeAlwaysDescription
idstring
tlsstring
apexstring
modestring
namestring
activeboolean
regionstring
statusstring
recordsarray
createdAtstring
updatedAtstring
verifiedAtstring
instructionsarray
openTrackingboolean
bindingStatusstring
clickTrackingboolean
customReturnPathstring
trackingSubdomainstring
governanceDomainIdstring
governanceBindingIdstring
verificationStartedAtstring
lastVerificationCheckAtstring
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.

POST/mail/emails

Send a single email

MCP tool: mail_email_send

Parameters

NameInTypeRequiredDescription
frombodystringSender, e.g. "Name <you@your-domain.com>"
tobodystringPrimary recipient(s)
ccbodystringCc recipient(s)
bccbodystringBcc recipient(s) — not shown in headers
subjectbodystringEmail subject (required for inline sends)
reply_tobodystringReply-To address(es)
htmlbodystringHTML body
textbodystringPlain-text body; auto-derived from html if omitted
headersbodyobjectCustom headers map
tagsbodyarrayMetadata tags
templatebodyobjectSend by reference to a published template
scheduled_atbodystringISO-8601 instant to send at; future, within 30 days. Omit to send now.

Response

FieldTypeAlwaysDescription
idstring
GET/mail/emails/:id

Retrieve an email by id, with its last event

MCP tool: mail_email_get

Parameters

NameInTypeRequiredDescription
idpathstringEmail id
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
idpathstringEmail id

Response

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

Cancel a scheduled email

MCP tool: mail_email_cancel

Parameters

NameInTypeRequiredDescription
idpathstringEmail id

Response

FieldTypeAlwaysDescription
idstring
statusstring
POST/mail/emails/batch

Send up to 100 emails in one atomic batch

MCP tool: mail_email_send_batch

Parameters

NameInTypeRequiredDescription
emailsbodyarrayUp to 100 emails to send, each shaped like a single send
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

FieldTypeAlwaysDescription
gatedboolean
volumenumber
complaintsnumber
thresholdsobject
window_daysnumber
hard_bouncesnumber
complaint_ratenumber
tripped_metricstring
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
periodquerystring

Response

FieldTypeAlwaysDescription
rangeobject
deltasobject
periodstring
totalsobject
volumearray
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
reasonquerystringFilter by reason
qquerystringCase-insensitive substring match on address
cursorquerystringOpaque pagination cursor from a prior page
limitqueryintegerMax items per page (1–100, default 50)

Response

FieldTypeAlwaysDescription
itemsarray
next_cursorstring
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

FieldTypeAlwaysDescription
idstring
notestring
reasonstring
addressstring
created_atstring
source_event_idstring
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

FieldTypeAlwaysDescription
addressstring
removedboolean
GET/mail/templates

List email templates for the current product

MCP tool: mail_template_list

Parameters

No parameters.

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
variablesbodyarrayDeclared variables ([{name,type,optional,fallback}], <=20)

Response

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesarray
DELETE/mail/templates/:id

Delete a template

MCP tool: mail_template_delete

Parameters

NameInTypeRequiredDescription
idpathstringTemplate id to delete

Response

FieldTypeAlwaysDescription
deletedboolean
GET/mail/templates/:id

Get a single email template by id

MCP tool: mail_template_get

Parameters

NameInTypeRequiredDescription
idpathstringTemplate id

Response

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesarray
PATCH/mail/templates/:id

Update a draft template (published templates are not editable)

MCP tool: mail_template_update

Parameters

NameInTypeRequiredDescription
idpathstringTemplate id
namebodystring
subjectbodystring
htmlbodystring
textbodystring
variablesbodyarray

Response

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesarray
POST/mail/templates/:id/publish

Publish a template (draft -> published)

MCP tool: mail_template_publish

Parameters

NameInTypeRequiredDescription
idpathstringTemplate id to publish

Response

FieldTypeAlwaysDescription
idstring
htmlstring
namestring
textstring
statusstring
subjectstring
createdAtstring
updatedAtstring
variablesarray
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

FieldTypeAlwaysDescription
emailsobject
periodobject
contactsobject
GET/mail/webhooks

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

MCP tool: mail_webhook_list

Parameters

No parameters.

POST/mail/webhooks

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

MCP tool: mail_webhook_create

Parameters

NameInTypeRequiredDescription
urlbodystringHTTPS URL that signed events are POSTed to
enabled_eventsbodyarrayEvent types to deliver. One or more of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clicked
descriptionbodystringOptional human label

Response

FieldTypeAlwaysDescription
idstring
urlstring
secretstring
enabledboolean
created_atstring
updated_atstring
descriptionstring
enabled_eventsarray
DELETE/mail/webhooks/:id

Delete a webhook endpoint.

MCP tool: mail_webhook_delete

Parameters

NameInTypeRequiredDescription
idpathstringWebhook endpoint id

Response

FieldTypeAlwaysDescription
idstring
deletedboolean
GET/mail/webhooks/:id

Get a webhook endpoint by id (secret omitted).

MCP tool: mail_webhook_get

Parameters

NameInTypeRequiredDescription
idpathstringWebhook endpoint id

Response

FieldTypeAlwaysDescription
idstring
urlstring
enabledboolean
created_atstring
updated_atstring
descriptionstring
enabled_eventsarray
PATCH/mail/webhooks/:id

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

MCP tool: mail_webhook_update

Parameters

NameInTypeRequiredDescription
idpathstringWebhook endpoint id
urlbodystringHTTPS URL that signed events are POSTed to
enabled_eventsbodyarrayEvent types to deliver. One or more of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clicked
descriptionbodystringOptional human label
enabledbodybooleanEnable (true) or disable (false) delivery

Response

FieldTypeAlwaysDescription
idstring
urlstring
enabledboolean
created_atstring
updated_atstring
descriptionstring
enabled_eventsarray
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
idpathstringWebhook endpoint id
limitqueryintegerMax items (1-100, default 50)
Was this page helpful?
Esc

Start typing to search the docs.

navigateselect