TagMangoTagMango Docs
Authentication

Get Authenticated User By Token

GET
/api/v1/external/auth/v2/verify-token

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). :::

AuthorizationBearer <token>

In: header

Query Parameters

token*string

Current logged in user JWT token

Header Parameters

x-whitelabel-host*string

Host name of the dashboard, ex: mydomain.tagmango.com

Response Body

application/json

application/json

application/json

curl -X GET "https://api-prod-new.tagmango.com/api/v1/external/auth/v2/verify-token?token=your-jwt-token" \  -H "x-whitelabel-host: string"
{
  "_id": "6659ca9e5f2acb7abfdcd8fd",
  "name": "John Doe",
  "email": "john.doe@example.com",
  "host": "yourhost.tagmango.com",
  "userSlug": "john-doe",
  "phone": 1234567890,
  "profilePicUrl": "https://linktoprofilepic.com/pic.jpg",
  "onboarding": "creator_completed",
  "isDeactivated": false,
  "country": "India",
  "dialCode": "+91",
  "currency": "USD",
  "score": {
    "lifetime": 100,
    "month": 20,
    "week": 5
  },
  "leaderboardRank": {
    "lifetime": 1,
    "month": 2,
    "week": 3
  },
  "creator": "6149b1e5612c4e5fd96041d3",
  "badges": [
    {
      "_id": "6659ca9e5f2acb7abfdcd8fd",
      "creator": "6149b1e5612c4e5fd96041d3",
      "name": "Hall Of Fame",
      "description": "Something about the badge",
      "imageUrl": "https://testing.tagmango.com/assets/badge-icon-922e7f499bc0045d7af8ac771eebe2fe.png",
      "enableAutomation": true,
      "pointsThreshold": 100,
      "pointCategoryForAutomation": "lifetime",
      "automationEnabledMangoes": [
        "6659ca9e5f2acb7abfdcd8fd",
        "6659ca9e5f2acb7abfdcd8fd"
      ],
      "createdAt": "2024-05-31T13:03:26.375Z",
      "updatedAt": "2024-07-19T12:32:51.071Z"
    }
  ],
  "hasGamificationAccess": false
}
{
  "code": 400,
  "type": "Bad request",
  "statusMessage": "BAD_REQUEST",
  "message": "Invalid request",
  "success": false
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "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. You can also add other query parameters to the URL while adding your application in the dashboard (Settings -> Platform Settings -> Customise Menu).

Configure automation email POST

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 (no `mango`) it cascades the flag to every per-mango row for the event. - **Content save** — `{ event, subject, template }` (plus optional `mango` / `active`) writes template content. Omit `mango` to set the creator-global template; provide `mango` to set a per-mango override. - **Per-mango override** — any save containing `mango` auto-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**: 1. HTML sanitization — `<script>`, `<iframe>`, event handlers (`onclick`/`onerror`/…), and `javascript:` URLs are rejected. Full HTML documents (`<html>`/`<head>`/`<body>` wrappers) are accepted; wrappers are stripped and any `<head><style>` blocks are preserved. 2. Handlebars compile-test — template is compiled against the event's allowed variable catalogue; unknown variables are rejected. 3. Unlayer design synthesis — a minimal visual-editor design is generated from the HTML so the template remains editable in the dashboard editor. 4. Cascade writes — creator-global saves cascade `active` to per-mango rows; per-mango saves auto-enable the creator-global row.