Campaigns
Create, manage, and send email marketing campaigns
Campaigns are bulk email sends to a segment of your contacts. Campaigns support scheduling, tracking, and analytics.
Auth: API key with campaigns scope.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/v1/campaigns | List campaigns |
POST | /api/v1/campaigns | Create a campaign |
GET | /api/v1/campaigns/:id | Get a campaign |
PATCH | /api/v1/campaigns/:id | Update a campaign |
DELETE | /api/v1/campaigns/:id | Delete a draft campaign |
POST | /api/v1/campaigns/:id/send | Trigger a campaign send |
List campaigns
/mail/v1/campaignsList campaigns with optional status filter.
Query parameters
statusstringqueryFilter: draft, scheduled, sending, sent, paused, cancelled.
pagenumberquerydefault: 1Page number.
limitnumberquerydefault: 20Results per page (max 50).
Response fields
successbooleantrue when the request succeeded.
dataArray<Campaign>The page of campaigns. Each includes id, name, subject, status, from_email, from_name, segment_id, scheduled_at, started_at, completed_at, total_recipients, total_sent, total_delivered, total_opened, total_clicked, total_bounced, total_complained, created_at, and updated_at.
paginationobjectPagination metadata: page, limit, total, totalPages.
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "February Newsletter",
"subject": "What's new this month",
"status": "sent",
"from_email": "newsletter@yourdomain.com",
"from_name": "Misar Team",
"segment_id": "550e8400-e29b-41d4-a716-446655440001",
"scheduled_at": "2026-02-01T10:00:00Z",
"started_at": "2026-02-01T10:00:05Z",
"completed_at": "2026-02-01T10:12:00Z",
"total_recipients": 5000,
"total_sent": 5000,
"total_delivered": 4988,
"total_opened": 1250,
"total_clicked": 340,
"total_bounced": 12,
"total_complained": 2,
"created_at": "2026-01-28T09:00:00Z",
"updated_at": "2026-02-01T10:12:00Z"
}
],
"pagination": { "page": 1, "limit": 20, "total": 8, "totalPages": 1 }
}Create a campaign
/mail/v1/campaignsCreate a new campaign. Plan limits apply.
Request body
namestringbodyrequiredInternal name (max 100 characters).
descriptionstringbodyOptional internal description (max 1000 characters).
subjectstringbodyrequiredEmail subject line (supports {{variables}}, max 255 characters).
fromNamestringbodyrequiredSender display name (max 100 characters).
fromEmailstringbodyrequiredMust be one of your connected email accounts.
replyTostringbodyReply-to address.
segmentIdUUIDbodyTarget audience segment.
templateIdUUIDbodyUse a template instead of inline HTML. Provide templateId or body content (one required).
bodyHtmlstringbodyInline HTML body. Provide templateId or body content (one required).
bodyTextstringbodyPlain text fallback (recommended).
scheduledAtstringbodyISO-8601 time to schedule the campaign (must be in the future). When set, the campaign is created with status scheduled; otherwise draft.
Response fields
successbooleantrue when the campaign was created.
dataobjectThe created campaign row, including id, name, status, and all campaign fields.
{
"name": "February Newsletter",
"subject": "What's new this month 🚀",
"fromName": "Misar Team",
"fromEmail": "newsletter@yourdomain.com",
"replyTo": "support@yourdomain.com",
"segmentId": "550e8400-e29b-41d4-a716-446655440001",
"templateId": "550e8400-e29b-41d4-a716-446655440002",
"bodyHtml": "<h1>Hello {{firstName}}!</h1>",
"bodyText": "Hello {{firstName}}!"
}{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "February Newsletter",
"status": "draft"
}
}Errors
403— Campaign limit reached for your plan403—fromEmailis not one of your connected accounts403—templateIdorsegmentIdnot found or not owned by your account400— EithertemplateIdor body content is required
Update a campaign
/mail/v1/campaigns/:idUpdate a campaign. Only campaigns in draft, scheduled, or paused status can be modified. Any subset of the fields below may be sent. For paused campaigns, only a status change is allowed.
Path parameters
idstringpathrequiredID of the campaign to update.
Request body
namestringbodyUpdated internal name.
descriptionstringbodyUpdated internal description.
subjectstringbodyUpdated subject line.
fromNamestringbodyUpdated sender display name.
replyTostringbodyUpdated reply-to address.
bodyHtmlstringbodyUpdated HTML content.
bodyTextstringbodyUpdated plain-text content.
segmentIdUUIDbodyUpdated target segment.
scheduledAtstringbodyUpdated ISO-8601 schedule time, or null to clear it.
statusstringbodyNew status. Valid transitions: draft → scheduled/cancelled; scheduled → draft/paused/cancelled; paused → scheduled/cancelled.
{
"subject": "Updated subject line",
"bodyHtml": "<h1>Updated content</h1>"
}Delete a campaign
/mail/v1/campaigns/:idDelete a draft campaign. Cannot delete scheduled, sending, or sent campaigns.
Path parameters
idstringpathrequiredID of the draft campaign to delete.
curl -X DELETE https://api.misar.io/mail/v1/campaigns/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer msk_your_key"Trigger a campaign send
/mail/v1/campaigns/:id/sendTrigger an immediate send of a campaign. The campaign must be in draft or scheduled status. This endpoint sends right away — it takes no request body. To schedule a campaign for a future time, set scheduledAt when creating or updating the campaign.
Path parameters
idstringpathrequiredID of the draft or scheduled campaign.
Response fields
successbooleantrue when the send was initiated.
messagestringConfirmation message, e.g. Campaign send initiated.
campaignIdstringID of the campaign.
statusstringResulting status — scheduled (claimed for sending by the worker).
curl -X POST https://api.misar.io/mail/v1/campaigns/550e8400-e29b-41d4-a716-446655440000/send \
-H "Authorization: Bearer msk_your_key"{
"success": true,
"message": "Campaign send initiated",
"campaignId": "550e8400-e29b-41d4-a716-446655440000",
"status": "scheduled"
}Errors
400— Campaign is not indraftorscheduledstatus400— Invalid campaign ID format404— Campaign not found409— Campaign status changed before it could be claimed429— Send rate limit exceeded