Skip to main content

AI Studio

AI Studio

Generate campaign text, widget HTML, and strategy suggestions from AI endpoints.

Audience: Content, CRM, and growth teams accelerating campaign and widget ideation.

Critical: Generation endpoints require AI generate permissions and should be reviewed before direct production publishing.

Who This Page Is For

Use this page when you need structured AI-assisted output for copywriting, HTML widget drafts, and campaign strategy direction.

Quick Start (2-5 Minutes)

1

Generate text copy

Use tone/language/context inputs for campaign text suggestions.

POST /api/v1/ai/generate-text
2

Generate widget HTML

Draft widget markup from prompt and optional context.

POST /api/v1/ai/generate-html
3

Generate strategy recommendation

Get high-level campaign strategy guidance from business context.

POST /api/v1/ai/generate-strategy
4

Inspect campaign insight

Read AI insight for one campaign performance context.

GET /api/v1/ai/insights/:campaignId
5

Publish through normal module workflow

Review and apply AI output via campaigns/widgets modules.

Do not auto-publish unreviewed AI outputs.

AI Studio endpoints

POST /api/v1/ai/generate-text
POST /api/v1/ai/generate-html
POST /api/v1/ai/generate-strategy
GET  /api/v1/ai/insights/:campaignId

Required Fields / Minimum Payload

FieldRequiredTypeUsed by eventsDescription
toneRequiredurgent | friendly | premium | playful | professional | engaginggenerate-textOutput tone style target.
languageRequiredstringgenerate-textOutput language code.
productNameRecommended (Copywriter UI required)stringgenerate-textMain product/offer context for generation.
targetAudienceRecommended (Copywriter UI required)stringgenerate-textAudience profile the copy should address.
ctaGoalRecommended (Copywriter UI required)stringgenerate-textWhat action the CTA must drive.
promptRequiredstringgenerate-htmlPrimary instruction for HTML output generation.
businessDescriptionRequiredstringgenerate-strategyBusiness context grounding for strategy output.
campaignIdRequireduuid/stringinsights endpointTarget campaign for insight retrieval.

generate-text example

{
"campaignType": "discount",
"widgetType": "announcement_bar",
"tone": "urgent",
"language": "en",
"maxLength": 90,
"brandName": "Acme",
"discountValue": "20%",
"avoidEmojis": true,
"productName": "Summer Collection 2026",
"targetAudience": "new visitors",
"ctaGoal": "Drive users to click Shop Now",
"primaryBenefit": "Limited-time discount on best sellers",
"painPoint": "Visitors postpone purchases without urgency",
"proofPoint": "Trusted by 15,000+ customers",
"keywordsToInclude": "limited-time, free shipping",
"keywordsToAvoid": "cheap",
"additionalContext": "Keep claims realistic and concise"
}

For stronger output quality in Smart Copywriter, provide at least:

  • productName
  • targetAudience
  • ctaGoal

Then enrich with optional context fields such as primaryBenefit, painPoint, proofPoint, and keyword guidance.

Event or Endpoint Decision Matrix

ScenarioUse ThisWhy
Need CTA and message variants quicklyPOST /ai/generate-textFast copy iteration with tone controls.
Need prototype widget markupPOST /ai/generate-htmlConverts intent into initial HTML draft.
Need strategic direction before launchPOST /ai/generate-strategyHigh-level planning aid from business context.
Need campaign-specific AI interpretationGET /ai/insights/:campaignIdCampaign-level insight retrieval.
Need production rolloutCampaign/widget module workflowsGoverned publish path with review controls.

Common Errors and Fixes

Text output too generic

Cause: Insufficient context in payload fields.

Fix: Provide richer brand, audience, and product context.

HTML output not usable directly

Cause: Prompt lacks structural constraints or design requirements.

Fix: Specify layout, CTA, and style constraints in prompt/context.

Strategy output not aligned with business goals

Cause: goal/targetAudience omitted in request.

Fix: Include explicit goals and audience profile.

Permission denied for generation calls

Cause: Role missing AI generate permissions.

Fix: Grant ai:generate capability for relevant users.

Production Checklist

  • All AI-generated outputs are human-reviewed before publishing.Required
  • Prompt templates are standardized for quality consistency.Required
  • Campaign insights are checked against actual KPI data.Required
  • AI endpoint access is limited to authorized roles.Required
  • Output quality is tracked with post-launch performance metrics.Required

Next Steps