Misar Docs
MisarMailMisar.BlogMisarReachMisarPostMisar.DevMisar PlatformMisar IdentityMisar Posts API
Api Reference

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

GET/mail/accounts

List all email accounts connected to the authenticated user.

Response fields

successboolean

true when the request succeeded.

accountsarray

Connected 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

POST/mail/accounts

Connect a new IMAP/SMTP email account. Credentials are verified on connection before saving.

Request body

emailstringbodyrequired

The email address of the account.

namestringbody

Display name for outgoing emails.

imap_hoststringbodyrequired

IMAP server hostname.

imap_portnumberbodyrequired

Usually 993 (TLS) or 143 (STARTTLS).

smtp_hoststringbodyrequired

SMTP server hostname.

smtp_portnumberbodyrequired

Usually 587 (STARTTLS) or 465 (TLS).

usernamestringbodyrequired

IMAP/SMTP login username.

passwordstringbodyrequired

IMAP/SMTP login password or app password.

Response fields

successboolean

true when the account was connected.

accountobject

The 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 failed
  • 409 — This email address is already connected
  • 403 — Account quota reached for your plan

Disconnect an account

DELETE/mail/accounts/:id

Disconnect an account and stop inbox sync. Does not delete any emails already synced.

Path parameters

idUUIDpathrequired

ID of the account to disconnect.

Response fields

successboolean

true 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 user
  • 403 — Cannot disconnect the only remaining default account while active campaigns exist

Account Sharing & Reputation

Get sender reputation

GET/mail/accounts/reputation

Get sender reputation score for connected email accounts. Uses session authentication.

Response fields

successboolean

true when the request succeeded.

dataarray

Per-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

GET/mail/accounts/:id/invitations

List pending invitations to share this account with other users. Uses session authentication; account owner only.

Path parameters

idstringpathrequired

ID of the account.

Response fields

successboolean

true when the request succeeded.

invitationsarray

Pending 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

POST/mail/accounts/:id/invitations

Invite another MisarMail user to access this account. Uses session authentication; account owner only.

Path parameters

idstringpathrequired

ID of the account.

Request body

emailstringbodyrequired

Invitee's email address.

rolestringbodydefault: member

admin 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

GET/mail/accounts/:id/shares

List active account shares (accepted invitations). Uses session authentication; account owner only.

Path parameters

idstringpathrequired

ID of the account.

Response fields

successboolean

true when the request succeeded.

sharesarray

Active 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

GET/mail/invitations/pending

List 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

successboolean

true when the request succeeded.

invitationsarray

Pending 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

POST/mail/invitations/decline

Decline a pending invitation. Uses session authentication.

Request body

invitation_idstringbodyrequired

ID 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" }'