Accounts
Connect and manage IMAP/SMTP email accounts for sending and inbox sync
Email accounts are the verified sender mailboxes used in the from field of outbound emails. Each account stores IMAP/SMTP credentials and is associated with the authenticated user's session.
Account endpoints use session authentication (dashboard cookie), not API key auth. To send email programmatically via API key, use POST /api/v1/send referencing an already-connected account.
List connected accounts
/mail/accountsList all email accounts connected to the authenticated user.
Response fields
successbooleantrue when the request succeeded.
accountsarrayConnected accounts. Each includes id, email, name, imap_host, imap_port, smtp_host, smtp_port, sync_status, is_default, and created_at.
sync_status values: pending (credentials saved, initial sync not yet started), syncing (actively syncing inbox), synced (up to date), error (IMAP connection failed — check credentials).
curl https://api.misar.io/mail/accounts \
-H "Cookie: sb-access-token=YOUR_SESSION"{
"success": true,
"accounts": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"name": "Your Name",
"imap_host": "imap.yourdomain.com",
"imap_port": 993,
"smtp_host": "smtp.yourdomain.com",
"smtp_port": 587,
"sync_status": "syncing",
"is_default": true,
"created_at": "2026-01-15T10:00:00Z"
}
]
}Connect a new account
/mail/accountsConnect a new IMAP/SMTP email account. Credentials are verified on connection before saving.
Request body
emailstringbodyrequiredThe email address of the account.
namestringbodyDisplay name for outgoing emails.
imap_hoststringbodyrequiredIMAP server hostname.
imap_portnumberbodyrequiredUsually 993 (TLS) or 143 (STARTTLS).
smtp_hoststringbodyrequiredSMTP server hostname.
smtp_portnumberbodyrequiredUsually 587 (STARTTLS) or 465 (TLS).
usernamestringbodyrequiredIMAP/SMTP login username.
passwordstringbodyrequiredIMAP/SMTP login password or app password.
Response fields
successbooleantrue when the account was connected.
accountobjectThe created account, including id, email, and sync_status.
curl -X POST https://api.misar.io/mail/accounts \
-H "Cookie: sb-access-token=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "Your Display Name",
"imap_host": "imap.yourdomain.com",
"imap_port": 993,
"smtp_host": "smtp.yourdomain.com",
"smtp_port": 587,
"username": "[email protected]",
"password": "your-email-password"
}'{
"success": true,
"account": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"sync_status": "pending"
}
}Errors
400— IMAP or SMTP credentials verification failed409— This email address is already connected403— Account quota reached for your plan
Disconnect an account
/mail/accounts/:idDisconnect an account and stop inbox sync. Does not delete any emails already synced.
Path parameters
idUUIDpathrequiredID of the account to disconnect.
Response fields
successbooleantrue when the account was disconnected.
curl -X DELETE https://api.misar.io/mail/accounts/550e8400-e29b-41d4-a716-446655440000 \
-H "Cookie: sb-access-token=YOUR_SESSION"{ "success": true }Errors
404— Account not found or does not belong to authenticated user403— Cannot disconnect the only remaining default account while active campaigns exist
Account Sharing & Reputation
Get sender reputation
/mail/accounts/reputationGet sender reputation score for connected email accounts. Uses session authentication.
Response fields
successbooleantrue when the request succeeded.
dataarrayPer-account reputation. Each includes account_id, email, reputation_score, warmup_status, daily_limit, sent_today, blacklist_status, and last_checked_at.
reputation_score ranges 0–100. Scores below 70 indicate deliverability risk.
{
"success": true,
"data": [
{
"account_id": "550e8400-...",
"email": "[email protected]",
"reputation_score": 92,
"warmup_status": "active",
"daily_limit": 5000,
"sent_today": 412,
"blacklist_status": "clean",
"last_checked_at": "2026-05-27T08:00:00Z"
}
]
}List account invitations
/mail/accounts/:id/invitationsList pending invitations to share this account with other users. Uses session authentication; account owner only.
Path parameters
idstringpathrequiredID of the account.
Response fields
successbooleantrue when the request succeeded.
invitationsarrayPending invitations. Each includes id, invitee_email, role, status, created_at, and expires_at.
{
"success": true,
"invitations": [
{
"id": "inv_abc123",
"invitee_email": "[email protected]",
"role": "member",
"status": "pending",
"created_at": "2026-05-20T10:00:00Z",
"expires_at": "2026-06-20T10:00:00Z"
}
]
}Invite a user to an account
/mail/accounts/:id/invitationsInvite another MisarMail user to access this account. Uses session authentication; account owner only.
Path parameters
idstringpathrequiredID of the account.
Request body
emailstringbodyrequiredInvitee's email address.
rolestringbodydefault: memberadmin or member.
curl -X POST https://api.misar.io/mail/accounts/acc_id.../invitations \
-H "Cookie: sb-access-token=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{ "email": "[email protected]", "role": "member" }'List account shares
/mail/accounts/:id/sharesList active account shares (accepted invitations). Uses session authentication; account owner only.
Path parameters
idstringpathrequiredID of the account.
Response fields
successbooleantrue when the request succeeded.
sharesarrayActive shares. Each includes user_id, email, role, and shared_at.
{
"success": true,
"shares": [
{
"user_id": "user_abc...",
"email": "[email protected]",
"role": "member",
"shared_at": "2026-05-21T14:00:00Z"
}
]
}List pending invitations received
/mail/invitations/pendingList all pending invitations you've received (cross-account). Used by the dashboard to show the "You've been invited" banner. Uses session authentication.
Response fields
successbooleantrue when the request succeeded.
invitationsarrayPending invitations received. Each includes id, account_email, inviter_name, role, and created_at.
{
"success": true,
"invitations": [
{
"id": "inv_abc123",
"account_email": "[email protected]",
"inviter_name": "Boss Person",
"role": "admin",
"created_at": "2026-05-20T10:00:00Z"
}
]
}Decline an invitation
/mail/invitations/declineDecline a pending invitation. Uses session authentication.
Request body
invitation_idstringbodyrequiredID of the invitation to decline.
curl -X POST https://api.misar.io/mail/invitations/decline \
-H "Cookie: sb-access-token=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{ "invitation_id": "inv_abc123" }'