Skip to main content
POST
/
api
/
v1
/
campaigns
/
ai-generate
curl -X POST "https://api.usegately.com/api/v1/campaigns/ai-generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignName": "Summer Sale",
    "subject": "50% off everything this weekend",
    "tone": "friendly"
  }'
{
  "html": "<div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 30px;\">\n  <h1 style=\"color: #333;\">Summer Sale — 50% Off!</h1>\n  <p style=\"color: #555; line-height: 1.6;\">Hi there,</p>\n  <p style=\"color: #555; line-height: 1.6;\">We're excited to announce our biggest sale of the year...</p>\n  <a href=\"#\" style=\"display: inline-block; background: #FE551B; color: white; padding: 12px 24px; border-radius: 6px; text-decoration: none; font-weight: bold;\">Shop Now</a>\n</div>"
}
Uses Gately’s AI model (Kimi K2) to produce inline-styled, email-client-compatible HTML based on your campaign name, subject, and desired tone. The returned HTML can be passed directly to the Send Campaign endpoint.

Headers

Authorization
string
required
Bearer YOUR_API_KEY
X-Project-ID
string
Your project UUID. Not required if the API key already encodes the project.

Request Body

campaignName
string
required
Name of the campaign — used as the primary context for generation
subject
string
Email subject line — provides additional context for the AI
tone
string
default:"professional"
Writing tone: professional · friendly · casual · urgent

Response

html
string
Complete, inline-styled HTML email body ready to send
curl -X POST "https://api.usegately.com/api/v1/campaigns/ai-generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignName": "Summer Sale",
    "subject": "50% off everything this weekend",
    "tone": "friendly"
  }'
{
  "html": "<div style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 30px;\">\n  <h1 style=\"color: #333;\">Summer Sale — 50% Off!</h1>\n  <p style=\"color: #555; line-height: 1.6;\">Hi there,</p>\n  <p style=\"color: #555; line-height: 1.6;\">We're excited to announce our biggest sale of the year...</p>\n  <a href=\"#\" style=\"display: inline-block; background: #FE551B; color: white; padding: 12px 24px; border-radius: 6px; text-decoration: none; font-weight: bold;\">Shop Now</a>\n</div>"
}