REST API
REST API reference
OpenAPI reference for each Lessly feature area.
Every Lessly feature area is reachable over HTTP as well as over MCP. The pages below are generated from the same platform tool catalog that produces the MCP tools reference, so the two surfaces describe the same operations and cannot drift apart.
MCP is the canonical agent path; these REST pages document the equivalent HTTP surface for direct integrations. Each endpoint names the MCP tool it is bound to.
Base URL
Every path on these pages is relative to:
https://api.lessly.comA segment written as :name — for example /mail/audiences/:audienceId/contacts — is a path parameter you substitute.
Authentication
Every endpoint requires a bearer token:
curl https://api.lessly.com/mail/domains \
-H "Authorization: Bearer $LESSLY_API_KEY"Create and revoke keys with the area’s own key operations — mail_apikey_create, realtime_apikey_create, tracking_api_keys_create — or from the dashboard. A secret is shown once, when it is created, and cannot be read back afterwards.
A request with no Authorization header is rejected with 401 and the code missing_token. A malformed or revoked key is rejected with 401 and the code invalid_token.
Errors
A failed request returns a non-2xx status and a JSON body with a single error object:
{
"error": {
"code": "invalid_token",
"message": "Invalid authentication token",
"step": "token_validation"
}
}Branch on code: it is stable and machine-readable. message is written for people and may be reworded. step names the stage that rejected the request, which is what to quote when you report a problem.
Areas
- Analytics API — 1 endpoint.
- Brain API — 41 endpoints.
- Consent API — 15 endpoints.
- Deployment API — 107 endpoints.
- Mail API — 51 endpoints.
- Organization API — 71 endpoints.
- Realtime API — 28 endpoints.
- Support API — 44 endpoints.
- Tracking API — 36 endpoints.
- Users API — 42 endpoints.
- Waitlist API — 7 endpoints.