REST API Reference

Developer API & Layout Schema

Automate flat-banner deconstruction, transparent cutouts, and 14-ratio rendering.

Endpoints

POST/api/deconstruct— Automatic spatial layout detection + copy & brand palette extraction
{
  "imageDataUrl": "data:image/webp;base64,UklGR...",
  "titleHint": "Summer Bundle Campaign"
}

Returns normalized element coordinates, priority levels, brand hex colors, and structured offer cards.

POST/api/cutout— Transparent PNG cutout isolation & handle-hole punching
{
  "cropDataUrl": "data:image/png;base64,iVBOR...",
  "mode": "auto",
  "hasInteriorHoles": true,
  "overlapsDarkCard": false
}

Preserves white brand lettering cleanly while removing solid studio, dark-card, and gradient backgrounds.

POST/api/backdrop— 14-ratio × HD/2K/4K clean background synthesis & scene extension
{
  "aspectRatio": "8:1",
  "imageSize": "2K",
  "prompt": "Minimalist studio atmosphere, zero text, zero objects"
}

Preserves or extends crisp scene photography cleanly across narrow, square, and ultra-wide ad sizes.

POST/api/localize— SKU-safe 10-market APAC campaign localization
{
  "copy": { "headline": "Secure Exclusive *Umbrella*", "subheadline": "1 set LC462 ($88)", "ctaText": "Shop Now", "finePrint": "*T&Cs apply.", "brandTag": "PRO", "offerCards": [] },
  "targetLocales": ["MY", "ID", "TH", "TW", "HK"]
}

Locks SKUs, currency amounts, partner tokens, and accent markers across SG, MY, ID, TH, PH, VN, KR, TW, HK, and IN.

LayoutSpec Contract

{
  "topology": "ultra_wide | landscape_hero | balanced_card | vertical_story | skyscraper_rail",
  "aspectRatio": "8:1",
  "imageSize": "2K", // Exact 6144x768
  "modifications": [
    { "name": "headline", "text": "Secure Exclusive *Umbrella*", "fontSizeClamp": [54, 96], "priority": 1 },
    { "name": "offer_cards", "priority": 3 }, // Auto-collapses on 8:1 & 1:8
    { "name": "hero_cutout", "pngShadow": { "groundedContactEllipse": true }, "priority": 1 }
  ]
}
All API endpoints enforce automatic asset validation, aspect-ratio guardrails, and pixel-exact output dimensions.