Maileditor Docs
Plugin

API reference

Conventions shared by every Plugin API endpoint, and the full endpoint index.

The Plugin API has three surfaces. They differ in who calls them and how they authenticate.

SurfaceCallerAuthentication
EmbeddedThe editor running inside the iframe.A session token issued by the session endpoint.
BackendYour server.X-Plugin-Id and X-Plugin-Secret headers.
PlansAnyone.None.

Most integrations only call the Backend surface. The Embedded surface is documented so you can read the editor's network traffic and understand quotas and errors; the editor calls it for you.

Base URL

https://api.maileditor.net/api

Paths on the following pages are relative to this base.

Response envelope

Every response, success or failure, has the same shape:

{
  "message": "Human readable message",
  "result": { }
}

result is null when there is no payload. Failures put a machine-readable code in result.error. Validation failures use errors keyed by field instead. All codes are collected in Error codes.

Headers

Embedded

HeaderValue
MailEditor-OriginThe origin of the page the editor is embedded in. Checked against the plugin's domain allowlist.
AuthorizationBearer {session_token} after the session call
Acceptapplication/json

The editor sets these on every request.

Backend

HeaderValue
X-Plugin-IdPublic plugin id
X-Plugin-SecretPlugin secret
Acceptapplication/json

No CORS headers are sent, so browsers cannot call this surface.

Pagination

List endpoints accept per_page and page and return paginated data, links and meta objects:

{
  "data": [],
  "links": { "first": "…", "last": "…", "prev": null, "next": null },
  "meta": { "current_page": 1, "from": 1, "last_page": 1, "per_page": 15, "to": 1, "total": 1 }
}

Endpoint index

Embedded

#VerbPathAction
1POST/public/plugin/v1/sessionIssue session token
2DELETE/public/plugin/v1/sessionRevoke session token
3GET/public/plugin/v1/bootstrapBootstrap
4GET/public/plugin/v1/templatesTemplate gallery
5GET/public/plugin/v1/componentsComponent library
6GET/public/plugin/v1/template-categoriesTemplate categories
7GET/public/plugin/v1/component-categoriesComponent categories
8GET/public/plugin/v1/my-templatesList own templates
9POST/public/plugin/v1/my-templatesCreate template
10GET/public/plugin/v1/my-templates/{template}Template details
11GET/public/plugin/v1/my-templates/{template}/htmlTemplate HTML
12PUT/public/plugin/v1/my-templates/{template}Save template
13GET/public/plugin/v1/my-templates/{template}/historyVersion history
14GET/public/plugin/v1/my-templates/{template}/history/{history}/htmlVersion HTML
15GET/public/plugin/v1/imagesList images
16POST/public/plugin/v1/imagesUpload image
17POST/public/plugin/v1/images/multipleUpload several
18DELETE/public/plugin/v1/images/{uuid}Delete image
19DELETE/public/plugin/v1/images/multipleDelete several
20POST/public/plugin/v1/images/{uuid}/add-custom-propertyTag an image
21POST/public/plugin/v1/ai-text-generateGenerate text
22GET/public/plugin/v1/stock/imagesSearch stock images
23POST/public/plugin/v1/stock/track-downloadTrack a download
24POST/public/plugin/v1/stock/importImport a stock image

Backend

#VerbPathAction
25GET/plugin/v1/backend/usersUsers with saved work
26GET/plugin/v1/backend/templatesTemplates across users
27GET/plugin/v1/backend/templates/{template}One template
28GET/plugin/v1/backend/templates/{template}/htmlTemplate HTML

Public

#VerbPathAction
29GET/public/plugin/plansPlans by interval
30GET/public/plugin/plans/{plan}Single plan
31GET/public/plugin/compare-plansComparison table

On this page