Configure automation email
Configure the email that fires for a registered automation event. Supports three payload shapes:
- Toggle —
{ event, active }enables/disables the automation. On a creator-global save (nomango) it cascades the flag to every per-mango row for the event. - Content save —
{ event, subject, template }(plus optionalmango/active) writes template content. Omitmangoto set the creator-global template; providemangoto set a per-mango override. - Per-mango override — any save containing
mangoauto-enables the creator-global row (so a per-mango override always has a backing enabled event). Callers do not need to pre-toggle the event separately.
Partial updates: subject, template, and active are all optional. Fields absent from the body are preserved on the stored record. At least one of active, template, or subject must be present.
Processing:
- HTML sanitization —
<script>,<iframe>, event handlers (onclick/onerror/…), andjavascript:URLs are rejected. Full HTML documents (<html>/<head>/<body>wrappers) are accepted; wrappers are stripped and any<head><style>blocks are preserved. - Handlebars compile-test — template is compiled against the event's allowed variable catalogue; unknown variables are rejected.
- Unlayer design synthesis — a minimal visual-editor design is generated from the HTML so the template remains editable in the dashboard editor.
- Cascade writes — creator-global saves cascade
activeto per-mango rows; per-mango saves auto-enable the creator-global row.
Authorization
bearer In: header
Header Parameters
Host name of the dashboard, ex: mydomain.tagmango.com
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/automations/emails/templates" \ -H "x-whitelabel-host: string" \ -H "Content-Type: application/json" \ -d '{ "event": "mangoPurchase" }'{
"_id": "69c77c57ad85cea56909a95e",
"creator": "69945193ce0ecef7256a481f",
"mango": "69bcc993473291fad8e4a7fa",
"event": "mangoPurchase",
"subject": "Your {{{mango}}} purchase is confirmed",
"template": "<p>Hey {{{name}}}, thanks for buying <strong>{{{mango}}}</strong>!</p>",
"active": true,
"createdAt": "2026-04-23T11:17:44.000Z",
"updatedAt": "2026-04-23T11:17:44.000Z"
}{
"code": 400,
"type": "Bad Request",
"statusMessage": "BAD_REQUEST",
"errorCode": "AUTOMATION_TEMPLATE_TOO_LARGE",
"message": "HTML templates are capped at 256 KB after UTF-8 encoding.",
"result": "HTML templates are capped at 256 KB after UTF-8 encoding.",
"success": false
}{
"code": 401,
"type": "Unauthorized",
"statusMessage": "UNAUTHORIZED",
"message": "Invalid token",
"success": false
}{
"code": 403,
"type": "Forbidden",
"statusMessage": "FORBIDDEN",
"errorCode": "AUTOMATION_USER_NOT_CREATOR",
"message": "The user has not completed creator onboarding or is not a valid creator account.",
"result": "The user has not completed creator onboarding or is not a valid creator account.",
"success": false
}{
"code": 404,
"type": "Not Found",
"statusMessage": "NOT_FOUND",
"errorCode": "AUTOMATION_CREATOR_NOT_FOUND",
"message": "The creator associated with the API key does not exist.",
"result": "The creator associated with the API key does not exist.",
"success": false
}Get Authenticated User By Token GET
## Overview This endpoint is used to get the basic user details by JWT token. Its crucial for closely integrating your application with TagMango Dashboard. TagMango doesn't provide independent login solution to custom applications, in that case you can use this endpoint to get the user details by JWT token. TagMango will include JWT token(refresh token) of the current logged in user as a query parameter to the registered domain of the application. When user clicks on the custom application from the dashboard navigation menu, it will redirect to the registered domain of the application with this token as a query parameter. ## Query Parameters Example `https://your-app.domain.com?refreshToken={your-refresh-token}` Then you can extract the refresh token from the query parameter and use it to get the user details by calling this endpoint. :::info You can also add other query parameters to the URL while adding your application in the dashboard (Settings -> Platform Settings -> Customise Menu). :::
Create or find user POST
## Overview This endpoint creates a new user on the customhost or returns an existing user if a match is found by email or phone. At least one of email or phone is required.