TagMangoTagMango Docs
Landing Page

Create Landing Page

POST
/api/v1/external/landing-pages

Create a new landing page for the creator, attached to an existing mango.

  • The authenticated creator must own the referenced mango.
  • Only one non-root landing page is allowed per (creator, mango). A 409 Conflict is returned if one already exists; use PUT /external/landing-pages/:landingPageId to modify it.
  • editorState is uploaded to S3 as a JSON file; the document stores the URL.
  • Root-level landing pages cannot be created through this endpoint.

AI generation: when aiPrompt is provided, editorState and templateData may be omitted. The response returns immediately with aiGeneration.status = "pending"; poll GET /external/landing-pages/:landingPageId until status flips to completed or failed.

AuthorizationBearer <token>

In: header

Header Parameters

x-whitelabel-host*string

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

curl -X POST "https://api-prod-new.tagmango.com/api/v1/external/landing-pages" \  -H "x-whitelabel-host: string" \  -H "Content-Type: application/json" \  -d '{    "mango": "66c4964c11e7fef26751f3a7"  }'
{
  "_id": "66a1390268a76f2f5c9f39a3",
  "creator": "77b2390268a76f2f5c9f39a4",
  "mango": "88c3490268a76f2f5c9f39a5",
  "editorState": "https://cdn.tagmango.com/websites/editor-state-abc123.json",
  "publishedLink": "https://landing.example.com/my-page",
  "isPublished": false,
  "lastPublishedOn": "2024-08-11T10:20:30Z",
  "lastSavedOn": "2024-08-11T10:20:30Z",
  "title": "My Landing Page",
  "description": "A page to showcase my course",
  "customSlug": "my-landing-page",
  "templateData": {},
  "isAdvanced": false,
  "customHeaderTags": "<meta name=\"robots\" content=\"index\" />",
  "customBodyTags": "<script>console.log(\"loaded\");</script>",
  "customCTALink": "https://example.com/checkout",
  "isContentBox": false,
  "isRootPage": false,
  "host": "example.tagmango.com",
  "grapesjsFormatVersion": "v2",
  "aiGeneration": {
    "status": "pending",
    "jobId": "string",
    "prompt": "string",
    "niche": "string",
    "objective": "string",
    "brandColor": "string",
    "error": "string",
    "startedAt": "2019-08-24T14:15:22Z",
    "completedAt": "2019-08-24T14:15:22Z",
    "aim": "string",
    "theme": {},
    "totalSections": 0,
    "completedSections": 0,
    "sections": [
      {
        "index": 0,
        "element": "string",
        "description": "string",
        "html": "string",
        "status": "pending",
        "error": "string",
        "completedAt": "2019-08-24T14:15:22Z"
      }
    ],
    "failedSections": [
      "string"
    ]
  },
  "createdAt": "2024-08-11T10:20:30Z",
  "updatedAt": "2024-08-11T10:20:30Z"
}
{
  "code": 400,
  "type": "Bad request",
  "statusMessage": "BAD_REQUEST",
  "message": "Invalid request",
  "success": false
}
{
  "code": 401,
  "type": "Unauthorized",
  "statusMessage": "UNAUTHORIZED",
  "message": "Invalid token",
  "success": false
}