Authentication
All API requests require an API key in the Authorization header.
https://maitsetu-production.up.railway.app//v1/keysList API keysReturns all API keys for the authenticated account.
{
"keys": [
{
"id": "key_01HXYZ",
"name": "Production",
"keyMask": "ms_live_ab12…cd34",
"isLive": true,
"createdAt": "2024-01-15T10:30:00Z"
}
]
}https://maitsetu-production.up.railway.app//v1/keysCreate API keyCreate a new API key. The full key is returned once — store it securely.
{
"name": "Production",
"isLive": true
}{
"id": "key_01HXYZ",
"name": "Production",
"key": "ms_live_ab12cd34ef56gh78",
"isLive": true,
"createdAt": "2024-01-15T10:30:00Z"
}https://maitsetu-production.up.railway.app//v1/keys/:idDelete API keyPermanently deletes an API key. All requests using this key will fail immediately.
{ "deleted": true }Emails
Send transactional emails, retrieve logs, and cancel scheduled sends.
https://maitsetu-production.up.railway.app//v1/emailsSend emailSend a transactional email. Supports HTML, plain text, attachments, and scheduling.
{
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Welcome to our app!",
"html": "<h1>Hello!</h1><p>Welcome aboard.</p>",
"text": "Hello! Welcome aboard.",
"reply_to": "support@yourdomain.com",
"cc": ["manager@example.com"],
"bcc": ["archive@example.com"],
"headers": {
"X-Entity-Ref-ID": "order_123"
},
"tags": [
{ "name": "category", "value": "welcome" }
],
"scheduled_at": "2024-02-01T09:00:00Z"
}{
"id": "em_01HXYZ",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Welcome to our app!",
"status": "QUEUED",
"createdAt": "2024-01-15T10:30:00Z"
}https://maitsetu-production.up.railway.app//v1/emails/batchBatch sendSend up to 100 emails in a single API call. Each email is independent.
{
"emails": [
{
"from": "hello@yourdomain.com",
"to": ["alice@example.com"],
"subject": "Your invoice #1001",
"html": "<p>Your invoice is ready.</p>"
},
{
"from": "hello@yourdomain.com",
"to": ["bob@example.com"],
"subject": "Your invoice #1002",
"html": "<p>Your invoice is ready.</p>"
}
]
}{
"data": [
{ "id": "em_01HABC", "status": "QUEUED" },
{ "id": "em_01HDEF", "status": "QUEUED" }
]
}https://maitsetu-production.up.railway.app//v1/emailsList emailsRetrieve paginated email logs. Supports filtering by status, date range, and recipient.
limitnumberNumber of results (max 100, default 20)offsetnumberPagination offsetstatusstringFilter by status: QUEUED, SENDING, DELIVERED, FAILED, BOUNCEDfrom_datestringISO 8601 date — filter emails sent after this dateto_datestringISO 8601 date — filter emails sent before this date{
"data": [
{
"id": "em_01HXYZ",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Welcome!",
"status": "DELIVERED",
"opens": 2,
"clicks": 1,
"createdAt": "2024-01-15T10:30:00Z",
"deliveredAt": "2024-01-15T10:30:03Z"
}
],
"total": 142,
"limit": 20,
"offset": 0
}https://maitsetu-production.up.railway.app//v1/emails/:idGet emailRetrieve full details for a single email including all events.
{
"id": "em_01HXYZ",
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"subject": "Welcome!",
"html": "<h1>Hello!</h1>",
"status": "DELIVERED",
"opens": 2,
"clicks": 1,
"events": [
{ "type": "sent", "timestamp": "2024-01-15T10:30:01Z" },
{ "type": "delivered", "timestamp": "2024-01-15T10:30:03Z" },
{ "type": "opened", "timestamp": "2024-01-15T11:05:22Z" }
],
"createdAt": "2024-01-15T10:30:00Z"
}https://maitsetu-production.up.railway.app//v1/emails/:id/cancelCancel scheduled emailCancel an email that has not yet been sent. Only works while status is SCHEDULED.
{ "id": "em_01HXYZ", "status": "CANCELED" }SMS
Send OTPs and transactional alerts, inspect delivery logs, and cancel queued SMS.
https://maitsetu-production.up.railway.app//v1/messagesSend SMSQueue a transactional or promotional SMS. Recipients must be in E.164 format.
{
"channel": "sms",
"to": "+919876543210",
"message": "Your MailSetu OTP is 482913. It expires in 10 minutes.",
"type": "transactional",
"idempotencyKey": "otp:user_123:login"
}{
"id": "sms_01HXYZ",
"channel": "sms",
"to": "+919876543210",
"status": "queued",
"estimatedSegments": 1,
"createdAt": "2026-05-06T10:30:00Z"
}https://maitsetu-production.up.railway.app//v1/messagesList SMSRetrieve paginated SMS logs and monthly quota usage.
{
"data": [
{
"id": "sms_01HXYZ",
"to": "+919876543210",
"message": "Your OTP is 482913",
"type": "transactional",
"status": "delivered",
"estimatedSegments": 1,
"createdAt": "2026-05-06T10:30:00Z"
}
],
"quota": { "used": 120, "limit": 5000, "remaining": 4880 },
"pagination": { "page": 1, "limit": 50, "total": 1, "pages": 1 }
}https://maitsetu-production.up.railway.app//v1/messages/:idGet SMS detailInspect a single SMS including its event trail and provider response.
{
"id": "sms_01HXYZ",
"to": "+919876543210",
"message": "Your OTP is 482913",
"status": "delivered",
"events": [
{ "type": "sms.queued", "createdAt": "2026-05-06T10:30:00Z" },
{ "type": "sms.sending", "createdAt": "2026-05-06T10:30:01Z" },
{ "type": "sms.delivered", "createdAt": "2026-05-06T10:30:02Z" }
]
}https://maitsetu-production.up.railway.app//v1/messages/:id/cancelCancel queued SMSCancel an SMS that is still queued and has not yet been handed to the provider.
{ "id": "sms_01HXYZ", "status": "canceled" }Domains
Verify sending domains with DKIM, SPF, and DMARC records.
https://maitsetu-production.up.railway.app//v1/domainsList domainsList all verified and pending domains on the account.
{
"data": [
{
"id": "dom_01HXYZ",
"domain": "yourdomain.com",
"status": "verified",
"dkim": { "status": "verified", "selector": "mailsetu1" },
"spf": { "status": "verified" },
"dmarc": { "status": "pending" },
"createdAt": "2024-01-10T08:00:00Z"
}
]
}https://maitsetu-production.up.railway.app//v1/domainsAdd domainAdd a new domain. Returns DNS records you need to add to verify ownership.
{ "domain": "yourdomain.com" }{
"id": "dom_01HXYZ",
"domain": "yourdomain.com",
"status": "pending",
"dnsRecords": [
{
"type": "TXT",
"name": "mailsetu1._domainkey.yourdomain.com",
"value": "v=DKIM1; k=rsa; p=MIGfMA0GCS...",
"purpose": "DKIM"
},
{
"type": "TXT",
"name": "yourdomain.com",
"value": "v=spf1 include:spf.mailssetu.in ~all",
"purpose": "SPF"
}
]
}https://maitsetu-production.up.railway.app//v1/domains/:id/verifyVerify domainRe-check DNS records and update verification status.
{
"id": "dom_01HXYZ",
"domain": "yourdomain.com",
"status": "verified",
"dkim": { "status": "verified" },
"spf": { "status": "verified" }
}https://maitsetu-production.up.railway.app//v1/domains/:idDelete domainRemove a domain from the account.
{ "deleted": true }Templates
Store reusable email templates with variable substitution.
https://maitsetu-production.up.railway.app//v1/templatesList templatesList all saved email templates.
{
"data": [
{
"id": "tpl_01HXYZ",
"name": "welcome",
"subject": "Welcome to {{app_name}}",
"createdAt": "2024-01-10T08:00:00Z"
}
]
}https://maitsetu-production.up.railway.app//v1/templatesCreate templateCreate a reusable HTML template. Use {{variable}} syntax for dynamic content.
{
"name": "welcome",
"subject": "Welcome to {{app_name}}, {{first_name}}!",
"html": "<h1>Hi {{first_name}},</h1><p>Welcome to {{app_name}}!</p>",
"text": "Hi {{first_name}}, welcome to {{app_name}}!"
}{
"id": "tpl_01HXYZ",
"name": "welcome",
"subject": "Welcome to {{app_name}}, {{first_name}}!",
"createdAt": "2024-01-15T10:30:00Z"
}https://maitsetu-production.up.railway.app//v1/emailsSend with templateSend an email using a saved template. Pass variables in the `data` object.
{
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"template_id": "tpl_01HXYZ",
"data": {
"first_name": "Priya",
"app_name": "MyApp"
}
}{ "id": "em_01HABC", "status": "QUEUED" }Webhooks
Subscribe to real-time email delivery and engagement events.
https://maitsetu-production.up.railway.app//v1/webhook-endpointsList webhooksList all webhook endpoints configured on the account.
{
"data": [
{
"id": "wh_01HXYZ",
"name": "Production webhook",
"url": "https://yourapp.com/webhooks/mailsetu",
"subscribedEvents": ["email.delivered", "email.bounce", "email.open"],
"active": true,
"secretPreview": "whsec_ab12…",
"createdAt": "2024-01-10T08:00:00Z"
}
]
}https://maitsetu-production.up.railway.app//v1/webhook-endpoints/eventsList supported eventsReturns all event types you can subscribe to.
{
"events": [
"email.queued", "email.scheduled", "email.sending",
"email.delivered", "email.open", "email.click",
"email.bounce", "email.complaint", "email.failed", "email.canceled"
]
}https://maitsetu-production.up.railway.app//v1/webhook-endpointsCreate webhookRegister a new webhook endpoint. We send a signed POST request for each subscribed event.
{
"name": "Production webhook",
"url": "https://yourapp.com/webhooks/mailsetu",
"subscribedEvents": [
"email.delivered",
"email.bounce",
"email.open",
"email.click",
"email.complaint"
]
}{
"id": "wh_01HXYZ",
"name": "Production webhook",
"url": "https://yourapp.com/webhooks/mailsetu",
"subscribedEvents": ["email.delivered", "email.bounce"],
"active": true,
"secretPreview": "whsec_ab12…"
}https://maitsetu-production.up.railway.app//v1/webhook-endpoints/:idUpdate webhookUpdate an existing webhook endpoint URL, name, or subscribed events.
{
"subscribedEvents": ["email.delivered", "email.bounce", "email.complaint"]
}{ "id": "wh_01HXYZ", "active": true, "subscribedEvents": [...] }https://maitsetu-production.up.railway.app//v1/webhook-endpoints/:id/rotate-secretRotate webhook secretIssue a new signing secret. All subsequent payloads use the new secret.
{ "secretPreview": "whsec_newAB12…" }https://maitsetu-production.up.railway.app//v1/webhook-endpoints/:idDelete webhookRemove a webhook endpoint. No further events will be delivered.
{ "deleted": true }Suppressions
Manage unsubscribes, bounces, and spam complaints.
https://maitsetu-production.up.railway.app//v1/suppressionsList suppressionsList all suppressed email addresses.
reasonstringFilter by reason: bounce, complaint, unsubscribelimitnumberMax 100offsetnumberPagination offset{
"data": [
{
"email": "user@example.com",
"reason": "bounce",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"total": 12
}https://maitsetu-production.up.railway.app//v1/suppressionsAdd suppressionManually add an email address to the suppression list.
{
"email": "user@example.com",
"reason": "unsubscribe"
}{ "added": true }https://maitsetu-production.up.railway.app//v1/suppressions/:emailRemove suppressionRemove an email address from the suppression list.
{ "removed": true }Error codes
All errors follow a consistent shape: { "error": "CODE", "message": "Human-readable text" }
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing or invalid request parameters. |
| 401 | UNAUTHORIZED | Missing or invalid API key. |
| 403 | FORBIDDEN | This key does not have permission for this action. |
| 404 | NOT_FOUND | The requested resource does not exist. |
| 422 | VALIDATION_ERROR | Request body failed validation. Check the `errors` field. |
| 429 | RATE_LIMITED | Too many requests. Respect the Retry-After header. |
| 500 | INTERNAL_ERROR | Something went wrong on our side. Retry with exponential backoff. |
| 503 | PAYMENT_REQUIRED | Razorpay credentials not configured — contact support. |
Exceeded? You'll receive a
429 — use the Retry-After header.