BaxMail

BaxMail Documentation

Transactional email API — send receipts, notifications, and password resets from your backend.

Prerequisites

  1. Enable BaxMail on your project (Dashboard → BaxMail → Setup).
  2. Verify your sending domain(s).
  3. Create an API key with the BaxMail feature enabled.
  4. Call the API from your server — never expose API keys in client apps.

Authentication

Authorization: Bearer YOUR_API_KEY
X-Project-Id: YOUR_PROJECT_ID
Content-Type: application/json
X-BaxMail-Domain: yourdomain.com   # optional — verified sending domain

Base URL: https://api.baxcloud.tech/v1

Send Email

Node.js SDK (recommended)

npm install @baxcloud/baxmail
1import { BaxCloudMailClient } from '@baxcloud/baxmail';
2
3const mail = new BaxCloudMailClient({
4  projectId: process.env.BAXCLOUD_PROJECT_ID!,
5  apiKey: process.env.BAXCLOUD_API_KEY!,
6});
7
8await mail.sendEmail({
9  to: 'user@example.com',
10  subject: 'Your order confirmation',
11  html: '<h1>Thank you for your order!</h1>',
12  from: 'noreply@your-verified-domain.com', // optional
13  fromName: 'My App',                        // optional
14});
Node.js SDK guide →

REST API (curl)

See the curl guide for full examples including multi-domain sends, stats, and logs.

1curl -X POST https://api.baxcloud.tech/v1/mail/send \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "X-Project-Id: YOUR_PROJECT_ID" \
4  -H "Content-Type: application/json" \
5  -d '{
6    "to": "user@example.com",
7    "subject": "Your order confirmation",
8    "html": "<h1>Thank you for your order!</h1>",
9    "text": "Thank you for your order!"
10  }'

cURL guide

Send email (default sender)

Uses the default from address configured in BaxMail Setup.

1curl -X POST https://api.baxcloud.tech/v1/mail/send \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "X-Project-Id: YOUR_PROJECT_ID" \
4  -H "Content-Type: application/json" \
5  -d '{
6    "to": "user@example.com",
7    "subject": "Welcome!",
8    "html": "<h1>Thanks for signing up</h1>",
9    "text": "Thanks for signing up"
10  }'

Override sender (from / fromName)

1curl -X POST https://api.baxcloud.tech/v1/mail/send \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "X-Project-Id: YOUR_PROJECT_ID" \
4  -H "Content-Type: application/json" \
5  -d '{
6    "to": "user@example.com",
7    "subject": "Your receipt",
8    "html": "<p>Order confirmed.</p>",
9    "from": "noreply@your-verified-domain.com",
10    "fromName": "My App",
11    "replyTo": "support@your-verified-domain.com"
12  }'

Pick a verified domain (multi-domain projects)

When you have several verified domains, pass X-BaxMail-Domain to send from that domain using your project's default local-part (e.g. noreply@that-domain.com). Omit the header to use the default verified domain from Setup.

1curl -X POST https://api.baxcloud.tech/v1/mail/send \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "X-Project-Id: YOUR_PROJECT_ID" \
4  -H "X-BaxMail-Domain: brand-b.com" \
5  -H "Content-Type: application/json" \
6  -d '{
7    "to": "user@example.com",
8    "subject": "Notification from Brand B",
9    "html": "<p>Hello from Brand B</p>",
10    "fromName": "Brand B"
11  }'

Usage stats

1curl "https://api.baxcloud.tech/v1/mail/stats?days=30" \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "X-Project-Id: YOUR_PROJECT_ID"

Delivery logs

1curl "https://api.baxcloud.tech/v1/mail/logs?page=1&pageSize=20" \
2  -H "Authorization: Bearer YOUR_API_KEY" \
3  -H "X-Project-Id: YOUR_PROJECT_ID"

Parse Server

Use @baxcloud/parse-server-baxmail as your Parse Server emailAdapter — verification, password reset, and custom mail via BaxMail. API keys stay on the server.

npm install @baxcloud/parse-server-baxmail
Parse Server adapter guide →

Error codes

Failed BaxMail API calls return a structured JSON envelope. Use error.code for programmatic handling and error.details.helpUrl to link users to the right dashboard page.

{
  "success": false,
  "error": {
    "code": "BAXVERIFY_FEATURE_DISABLED",
    "message": "BaxVerify is not enabled for this project. Enable it under Project → Features.",
    "details": {
      "projectId": "your-project-id",
      "helpUrl": "https://baxcloud.tech/dashboard/projects/your-project-id?tab=features",
      "docsUrl": "https://baxcloud.tech/docs/baxverify"
    }
  },
  "timestamp": "2026-06-06T12:00:00.000Z",
  "path": "/v1/auth/sms/send"
}
CodeHTTPMessageWhat to do
BAXMAIL_FEATURE_DISABLED403BaxMail is not enabled for this project.Enable BaxMail under Project → Features (details.helpUrl).
BAXMAIL_PLAN_NOT_INCLUDED403Your plan does not include BaxMail.Upgrade your subscription (details.helpUrl → Billing).
BAXMAIL_API_KEY_SCOPE403API key lacks BaxMail scope.Create or edit an API key with BaxMail enabled.
BAXMAIL_SENDER_NOT_CONFIGURED400No sender email configured.Verify a domain and set a default from address in BaxMail Setup (details.helpUrl).
BAXMAIL_DOMAIN_NOT_VERIFIED403Sending domain is not verified.Add DNS records and verify the domain in BaxMail Setup (details.helpUrl).
BAXMAIL_PROVIDER_NOT_CONFIGURED400Email provider is not configured on the platform.Contact BaxCloud support.
BAXMAIL_SEND_FAILED400Failed to send email.Check domain verification, from address, and recipient.
BAXMAIL_RECIPIENT_SUPPRESSED400Recipient is suppressed after a hard bounce.Do not send to this address, or remove it from the project suppression list.
BAXMAIL_PROJECT_INACTIVE403Project is not active.Reactivate the project in the dashboard.
BAXMAIL_PROJECT_HEADER_REQUIRED400X-Project-Id header is required.Send X-Project-Id with every request.
BAXMAIL_API_KEY_PROJECT_MISMATCH403API key does not belong to this project.Use an API key created for the same project as X-Project-Id.

API Reference

MethodPathDescription
POST/mail/sendSend transactional email
GET/mail/statsUsage statistics
GET/mail/logsDelivery logs

Request body (send):

  • to — recipient email (required)
  • subject — email subject (required)
  • html — HTML body (required)
  • text — plain-text fallback (optional)
  • from, fromName, replyTo — overrides (optional)
  • X-BaxMail-Domain header — verified sending domain when from is omitted (optional)
  • attachments — base64 attachments (optional)

Webhooks

  • baxmail.sent
  • baxmail.delivered
  • baxmail.failed
  • baxmail.bounced
  • baxmail.deferred
Webhook documentation →