Authentication

How to authenticate with the MailSetu API using API keys.

API Keys

All API requests must include your API key in the Authorization header as a Bearer token.

bash
curl https://api.mailssetu.in/v1/emails \
  -H "Authorization: Bearer ms_live_your_key_here"

Key types

There are two types of API keys: • LIVE keys (ms_live_...) — Send real emails via AWS SES. Requires a verified sending domain. • TEST/Sandbox keys (ms_test_...) — Simulate sends. Emails appear as DELIVERED immediately without touching DNS or SES. Use for development and testing.

Keeping keys secure

• Never commit API keys to source control • Use environment variables: process.env.MAILSETU_API_KEY • Rotate keys from the dashboard if you suspect a leak • Use TEST keys in development, LIVE keys only in production