Authentication
Authenticate to the MisarMail API with a product-bound API key — full access, scoped to your MisarMail plan.
Overview
Every request to the MisarMail API, MCP server, and SDKs is authenticated with an API key. MisarMail keys:
- are product-bound — a MisarMail key works only with MisarMail (
api.misar.io/mail/*). It cannot be used with any other Misar product (Reach, Dev, Post, SEO, …), and their keys cannot be used with MisarMail. - grant full access — a key can call every public MisarMail endpoint (send, contacts, campaigns, templates, analytics, validation, …). Keys are not feature-scoped; you never have to pick permissions when creating one.
- are plan-gated — the number of active keys you can hold is set by your active MisarMail subscription.
API keys act on your own MisarMail account. They cannot access resources owned by other users. Acting on behalf of other users requires the privileged act-as-user scope, which is granted only to internal/service keys — normal full-access keys never carry it.
Creating a key
- Sign in at misarmail.com and open the MisarMail dashboard.
- Go to Settings → API Keys (mail.misar.io/settings/api-keys).
- Click New API Key, give it a name (e.g.
Production), and copy the secret.
The raw key is shown once at creation — store it somewhere safe. If you lose it, revoke the key and create a new one.
MisarMail keys always begin with the msk_ prefix, so they are easy to recognize in logs and secret scanners:
msk_your_key_hereThe number of active keys you can hold is limited by your MisarMail subscription. If you hit the limit, revoke an unused key or upgrade your plan.
Key Restrictions
Optionally restrict a key to a single email account (allowed_account_id). When set, the from.email on send requests must match that account. This is an optional deliverability guard — it does not narrow the key's full API access.
Using a key
Pass the key in the Authorization header of every request:
Authorization: Bearer msk_your_key_hereExample:
curl https://api.misar.io/mail/v1/send \
-H "Authorization: Bearer msk_your_key_here" \
-H "Content-Type: application/json" \
-d '{ ... }'The same key works with the MisarMail SDKs and the MCP server.
Because a MisarMail key grants full access, treat it like a password. Never embed it in client-side code, browsers, or mobile apps — call the MisarMail API only from your server.
Product binding
MisarMail validates every key against its own database. A key issued by another Misar product is not present there, so it is rejected — and vice-versa. This means:
- A MisarMail
msk_key returns401 Unauthorizedonapi.misar.io/reach/*,…/dev/*,…/post/*, etc. - A MisarReach
mrk_key (or any other product's key) returns401 Unauthorizedonapi.misar.io/mail/*.
There is no way to "share" one key across products — issue a separate key from each product's dashboard for each product you integrate with.
Managing keys via API
API keys can also be created, listed, and revoked programmatically via session-authenticated requests. See API Keys for the full reference.
Revoking keys
Keys can be revoked at any time from Settings → API Keys or via DELETE /api/v1/keys?id=<uuid>. Revoked keys return 401 immediately.
Session Authentication (Browser / Dashboard)
Dashboard routes (/api/accounts, /api/campaigns, etc.) accept the Supabase session cookie automatically set during login. These routes are for the UI only — use API key auth for programmatic access.
Session flow:
- User logs in via id.misar.io
- SSO JWT issued →
api.misar.io/mail/auth/ssoverifies and creates local session - Session cookie shared across
*.misar.iosubdomains
Errors
| Status | Meaning |
|---|---|
401 Unauthorized | Missing, malformed, revoked, or wrong-product key. |
403 Forbidden | Key valid, but your MisarMail plan does not permit the action (or key limit reached at creation). |
429 Too Many Requests | Rate limit exceeded — back off and retry after the Retry-After header. |
Security Best Practices
- Store API keys in environment variables — never hardcode in source code
- Treat every key as full-access — issue one key per integration so you can rotate them independently
- Rotate keys periodically or after suspected compromise
- Use
idempotency_keyon send requests to avoid duplicate emails after retries