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.
| Surface | Caller | Authentication |
|---|---|---|
| Embedded | The editor running inside the iframe. | A session token issued by the session endpoint. |
| Backend | Your server. | X-Plugin-Id and X-Plugin-Secret headers. |
| Plans | Anyone. | 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/apiPaths 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
| Header | Value |
|---|---|
MailEditor-Origin | The origin of the page the editor is embedded in. Checked against the plugin's domain allowlist. |
Authorization | Bearer {session_token} after the session call |
Accept | application/json |
The editor sets these on every request.
Backend
| Header | Value |
|---|---|
X-Plugin-Id | Public plugin id |
X-Plugin-Secret | Plugin secret |
Accept | application/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
| # | Verb | Path | Action |
|---|---|---|---|
| 1 | POST | /public/plugin/v1/session | Issue session token |
| 2 | DELETE | /public/plugin/v1/session | Revoke session token |
| 3 | GET | /public/plugin/v1/bootstrap | Bootstrap |
| 4 | GET | /public/plugin/v1/templates | Template gallery |
| 5 | GET | /public/plugin/v1/components | Component library |
| 6 | GET | /public/plugin/v1/template-categories | Template categories |
| 7 | GET | /public/plugin/v1/component-categories | Component categories |
| 8 | GET | /public/plugin/v1/my-templates | List own templates |
| 9 | POST | /public/plugin/v1/my-templates | Create template |
| 10 | GET | /public/plugin/v1/my-templates/{template} | Template details |
| 11 | GET | /public/plugin/v1/my-templates/{template}/html | Template HTML |
| 12 | PUT | /public/plugin/v1/my-templates/{template} | Save template |
| 13 | GET | /public/plugin/v1/my-templates/{template}/history | Version history |
| 14 | GET | /public/plugin/v1/my-templates/{template}/history/{history}/html | Version HTML |
| 15 | GET | /public/plugin/v1/images | List images |
| 16 | POST | /public/plugin/v1/images | Upload image |
| 17 | POST | /public/plugin/v1/images/multiple | Upload several |
| 18 | DELETE | /public/plugin/v1/images/{uuid} | Delete image |
| 19 | DELETE | /public/plugin/v1/images/multiple | Delete several |
| 20 | POST | /public/plugin/v1/images/{uuid}/add-custom-property | Tag an image |
| 21 | POST | /public/plugin/v1/ai-text-generate | Generate text |
| 22 | GET | /public/plugin/v1/stock/images | Search stock images |
| 23 | POST | /public/plugin/v1/stock/track-download | Track a download |
| 24 | POST | /public/plugin/v1/stock/import | Import a stock image |
Backend
| # | Verb | Path | Action |
|---|---|---|---|
| 25 | GET | /plugin/v1/backend/users | Users with saved work |
| 26 | GET | /plugin/v1/backend/templates | Templates across users |
| 27 | GET | /plugin/v1/backend/templates/{template} | One template |
| 28 | GET | /plugin/v1/backend/templates/{template}/html | Template HTML |
Public
| # | Verb | Path | Action |
|---|---|---|---|
| 29 | GET | /public/plugin/plans | Plans by interval |
| 30 | GET | /public/plugin/plans/{plan} | Single plan |
| 31 | GET | /public/plugin/compare-plans | Comparison table |

.png)