AI Features
AI-powered email generation, subject line optimization, reply suggestions, and segment building
MisarMail's AI layer covers the full email workflow — from generating subject lines and full email bodies to scoring drafts, suggesting replies, and building audience segments from plain language.
Subject Lines (API key)
Generate up to 10 subject line ideas for any topic.
POST api.misar.io/mail/v1/ai/subject-lines
Authorization: Bearer msk_...
Content-Type: application/json
Request body
| Field | Type | Required | Description |
|---|---|---|---|
topic | string (5–500 chars) | Yes | The email topic or campaign brief |
tone | professional | casual | urgent | playful | informative | No | Defaults to professional |
audience | string (max 200 chars) | No | Audience description to improve relevance |
count | integer (1–10) | No | How many suggestions to return. Defaults to 5 |
brand | string (max 100 chars) | No | Brand name for brand-voice alignment |
Response
{
"success": true,
"suggestions": [
"5 things you didn't know about email deliverability",
"Your inbox strategy is missing this one step",
"How top senders get 40 % open rates",
"The subject line formula that actually works",
"Stop writing boring subject lines — try this instead"
],
"count": 5
}Rate limit: 10 requests per minute per API key.
Subject line suggestions are available on all plans. Spam words are filtered server-side — if the model returns a flagged phrase, the server automatically retries once before returning the cleaned result.
Email Generation (session)
Generate full email content, sequences, A/B variants, or score an existing subject line. Requires an active dashboard session and a Pro or higher plan.
POST /api/ai/generate-email
Request body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | See generation types below |
prompt | string (10–500 chars) | Yes | What the email should be about |
tone | professional | friendly | urgent | casual | No | Defaults to professional |
includeVariables | boolean | No | Inject merge tags like {{first_name}}. Defaults to true |
currentSubject | string | No | Required for score-subject type |
sequenceLength | integer (2–5) | No | Number of emails in sequence. Defaults to 3 |
Generation types
subject — Returns a single optimised subject line.
{ "success": true, "data": "Your account is ready — here's what to do next" }body — Returns an HTML email body.
{ "success": true, "data": "<p>Hi {{first_name}},</p>..." }full — Returns subject, HTML body, and preheader text.
{
"success": true,
"data": {
"subject": "Welcome to MisarMail",
"html": "<p>Hi {{first_name}},</p>...",
"preheader": "Everything you need to send your first campaign"
}
}sequence — Returns a multi-email nurture sequence.
{
"success": true,
"data": [
{
"subject": "Welcome — let's get you started",
"html": "...",
"preheader": "Your first step to better email",
"send_delay_days": 0,
"purpose": "awareness"
},
{
"subject": "Have you tried campaigns yet?",
"html": "...",
"preheader": "Send your first campaign in 5 minutes",
"send_delay_days": 3,
"purpose": "consideration"
},
{
"subject": "Upgrade and unlock AI — limited offer",
"html": "...",
"preheader": "50 % off Pro for the next 48 hours",
"send_delay_days": 7,
"purpose": "conversion"
}
]
}Possible purpose values: awareness, consideration, conversion, follow_up, re_engagement.
score-subject — Scores an existing subject line and suggests improvements.
{
"success": true,
"data": {
"score": 6,
"issues": ["Too generic", "No urgency or benefit"],
"alternatives": [
{ "subject": "Double your open rates in 7 days", "score": 9, "rationale": "Clear benefit + timeframe" },
{ "subject": "The open rate trick your competitors use", "score": 8, "rationale": "Curiosity + competitive framing" }
]
}
}ab-variants — Generates two A/B test variants with distinct hypotheses.
{
"success": true,
"data": {
"variants": [
{
"label": "A",
"hypothesis": "Benefit-led subject drives higher opens",
"subject": "Get 30 % more replies with this template",
"html": "...",
"preheader": "Used by 12,000 sales teams"
},
{
"label": "B",
"hypothesis": "Curiosity-gap subject outperforms direct benefit",
"subject": "Why your reply rate is lower than it should be",
"html": "...",
"preheader": "The fix takes under 2 minutes"
}
]
}
}Plan limits
| Feature | Free | Starter | Pro | Max |
|---|---|---|---|---|
generate-email endpoint | — | — | ✓ | ✓ |
| Monthly AI generations | 0 | 0 | 200 | Unlimited |
Subject line API (/v1/ai/subject-lines) | ✓ | ✓ | ✓ | ✓ |
Suggest Reply (session)
Get an AI-drafted reply to an inbox email.
POST /api/ai/suggest-reply
{ "email_id": "em_abc123", "tone": "professional" }{ "reply": "Thanks for reaching out — happy to help with that. Could you share a bit more about..." }Build Segment (session)
Describe an audience in plain language; get back a filter criteria object ready to pass to POST /v1/segments.
POST /api/ai/build-segment
{ "description": "contacts who opened emails in the last 30 days and haven't clicked any link" }{
"filter_criteria": {
"operator": "AND",
"conditions": [
{ "field": "last_open_at", "op": "gte", "value": "now-30d" },
{ "field": "total_clicks", "op": "eq", "value": 0 }
]
}
}Pass the returned filter_criteria directly to POST api.misar.io/mail/v1/segments as the filter_criteria field.