Misar IO Docs

AI Features

AI-powered subject line generation, email copy, segment building, and reply suggestions.

AI Features

MisarMail exposes several AI-powered endpoints that generate or improve email content.

AI endpoints are powered by the Misar AI model pipeline. They consume AI credits from your plan balance.

Generate subject lines

POST /v1/ai/subject-lines

Required scope: write

{
  "context": "Monthly product newsletter for a B2B SaaS company launching a new analytics dashboard",
  "count": 5,
  "tone": "professional",
  "includeEmoji": false
}

Response:

{
  "success": true,
  "subjects": [
    "Introducing your new analytics dashboard",
    "See what's new: analytics just got smarter",
    "Your data, clearer than ever — new dashboard inside",
    "What 500 teams are using to track growth",
    "New: analytics dashboard is live for your account"
  ]
}

Parameters

| Field | Type | Description | |-------|------|-------------| | context | string | Brief description of the email content and audience | | count | number | Number of subjects to generate (1–10, default 5) | | tone | string | professional | friendly | urgent | curiosity | | includeEmoji | boolean | Allow emoji in subjects | | campaignId | string | Auto-pull context from an existing campaign |

Generate email copy

POST /v1/ai/generate-email
{
  "prompt": "Write a re-engagement email for subscribers who haven't opened in 90 days. Offer 20% off and include urgency.",
  "tone": "friendly",
  "format": "html"
}

Response includes html, text, and subject fields.

Rewrite campaign copy

POST /v1/campaigns/:id/rewrite
{
  "tone": "urgent",
  "goal": "increase click-through rate",
  "instructions": "Shorten the body by 30% and add a clear CTA button"
}

Returns updated html, text, and subject. Apply by PATCHing the campaign.

AI segment builder

Describe the audience in plain English and get a segment filter object:

POST /v1/ai/build-segment
{
  "description": "Contacts who opened at least 3 emails in the last 30 days but haven't purchased"
}

Response:

{
  "success": true,
  "filters": {
    "operator": "AND",
    "conditions": [
      { "metric": "opens_last_30d", "operator": "gte", "value": 3 },
      { "metric": "purchase_count", "operator": "eq", "value": 0 }
    ]
  }
}

You can pass these filters directly to POST /v1/segments.

Suggest reply

Generate a reply to an inbound email:

POST /v1/ai/suggest-reply
{
  "conversationId": "conv_01ABCDEF",
  "tone": "helpful",
  "instructions": "Acknowledge the issue, offer a refund, and close warmly"
}

Returns a text and html suggested reply.

AI inbox summarize

Summarize a long email thread:

POST /v1/inbox/ai/summarize
{
  "conversationId": "conv_01ABCDEF"
}
{
  "summary": "Customer reported a billing error on May 20th. Support acknowledged and escalated to billing team. No resolution yet.",
  "sentiment": "frustrated",
  "nextAction": "Follow up with billing team resolution"
}

Content translation

Translate email content to another language:

POST /v1/i18n/translate-content
{
  "html": "<p>Hello! Your trial ends in 3 days.</p>",
  "targetLocale": "es",
  "preserveHtml": true
}