ConnexBetter LogoConnexBetter
← Developer Hub
REST API99% Deliverability

Email API

Send transactional and bulk emails with 99% deliverability. SPF, DKIM, and DMARC pre-configured. Open/click tracking, bounce handling, and template management built in.

99%

Deliverability rate

< 5s

Average delivery time

1M+

Emails/hour on Enterprise

3 auth

SPF + DKIM + DMARC

Quick Start — Transactional Email

cURL — Send Transactional Email
# Send a transactional email
curl -X POST https://api.connexbetter.com/v1/email/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": [{ "email": "customer@example.com", "name": "Rahul Sharma" }],
    "from": { "email": "noreply@yourcompany.com", "name": "Your Company" },
    "subject": "Your order #ORD-123456 has been shipped",
    "html": "<h1>Your order is on its way!</h1><p>Track it at <a href=\"{{tracking_url}}\">Track Order</a>.</p>",
    "text": "Your order is on its way! Track at {{tracking_url}}",
    "variables": {
      "tracking_url": "https://yourcompany.com/track/ORD-123456"
    },
    "track_opens": true,
    "track_clicks": true,
    "callback_url": "https://your-server.com/email-events"
  }'

Batch Send — Personalised Bulk Email

cURL — Personalised Batch
# Send personalised bulk emails (batch)
curl -X POST https://api.connexbetter.com/v1/email/send-batch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": { "email": "noreply@yourcompany.com", "name": "Your Company" },
    "subject": "Hi {{first_name}}, your exclusive Diwali offer is here!",
    "template_id": "tmpl_diwali_2025",
    "recipients": [
      { "email": "rahul@example.com", "variables": { "first_name": "Rahul", "discount": "40%" } },
      { "email": "priya@example.com", "variables": { "first_name": "Priya", "discount": "35%" } }
    ],
    "track_opens": true,
    "track_clicks": true,
    "scheduled_at": "2025-10-20T09:00:00+05:30"
  }'

Response Format

200 OK — Success Response
{
  "success": true,
  "messageId": "email_01HXYZ123456",
  "to": "customer@example.com",
  "status": "queued",
  "timestamp": "2025-09-15T10:30:00Z"
}

Code Examples

Python
import requests

# Send order confirmation email
response = requests.post(
    "https://api.connexbetter.com/v1/email/send",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "to": [{"email": "customer@example.com", "name": "Rahul Sharma"}],
        "from": {"email": "orders@yourcompany.com", "name": "Your Company"},
        "subject": "Order Confirmed — #ORD-123456",
        "template_id": "tmpl_order_confirmation",
        "variables": {
            "customer_name": "Rahul Sharma",
            "order_id": "ORD-123456",
            "order_total": "₹2,499",
            "delivery_date": "18 Sep 2025"
        },
        "track_opens": True,
        "track_clicks": True
    }
)

data = response.json()
print(f"Message ID: {data['messageId']}")
print(f"Status: {data['status']}")
Node.js
const axios = require('axios');

// Send password reset email
const response = await axios.post(
  'https://api.connexbetter.com/v1/email/send',
  {
    to: [{ email: 'user@example.com', name: 'Priya Kumar' }],
    from: { email: 'security@yourcompany.com', name: 'Your Company' },
    subject: 'Reset your password',
    html: `<p>Hi Priya,</p>
           <p><a href="${resetUrl}">Click here to reset your password</a>.</p>
           <p>This link expires in 30 minutes.</p>`,
    track_clicks: true
  },
  { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);

console.log('Message ID:', response.data.messageId);

API Endpoints

POST
/v1/email/send

Send a single transactional email

Core
POST
/v1/email/send-batch

Send personalised emails to multiple recipients

Core
POST
/v1/email/campaigns

Create and schedule a bulk email campaign

Campaigns
GET
/v1/email/campaigns/:id

Get campaign status and analytics

Campaigns
GET
/v1/email/status/:messageId

Get delivery status for a message

Status
GET
/v1/email/templates

List saved email templates

Templates
POST
/v1/email/suppressions

Add addresses to suppression list

Compliance

Email Event Webhooks

Webhook Payloads — Open, Click, Bounce
POST https://your-server.com/email-events

// Email opened
{
  "event": "email.opened",
  "messageId": "email_01HXYZ123456",
  "to": "customer@example.com",
  "timestamp": "2025-09-15T10:35:22Z",
  "user_agent": "Gmail",
  "ip": "103.x.x.x"
}

// Link clicked
{
  "event": "email.clicked",
  "messageId": "email_01HXYZ123456",
  "to": "customer@example.com",
  "url": "https://yourcompany.com/track/ORD-123456",
  "timestamp": "2025-09-15T10:36:00Z"
}

// Bounce
{
  "event": "email.bounced",
  "messageId": "email_01HABC",
  "to": "invalid@example.com",
  "bounce_type": "hard",
  "reason": "User unknown",
  "timestamp": "2025-09-15T10:30:05Z"
}
email.sent
email.delivered
email.opened
email.clicked
email.bounced
email.spam
email.unsubscribed
email.failed

Send Email — Request Parameters

ParameterTypeRequiredDescription
toarrayYesArray of recipient objects: [{ email, name }]
fromobjectYesSender object: { email, name }. Must be a verified domain.
subjectstringYesEmail subject line. Supports {{variable}} substitution.
htmlstringConditionalHTML body. Required if template_id not provided.
textstringNoPlain text fallback body. Recommended for deliverability.
template_idstringConditionalID of a saved template. Required if html not provided.
variablesobjectNoKey-value pairs substituted into {{variable}} placeholders.
track_opensbooleanNoEnable open tracking. Default: true.
track_clicksbooleanNoEnable click tracking. Default: true.
scheduled_atstringNoISO 8601 datetime to schedule delivery.
callback_urlstringNoWebhook URL for email events (opened, clicked, bounced).

Frequently Asked Questions

What is the difference between transactional and bulk email?

Transactional emails are triggered by a user action — order confirmations, password resets, invoice receipts, OTPs. They are sent one-to-one and have high deliverability priority. Bulk emails are marketing campaigns sent to a list (newsletters, promotions). ConnexBetter routes each type through optimised sending infrastructure.

How does ConnexBetter ensure high email deliverability?

We configure SPF, DKIM, and DMARC DNS records on your sending domain, warm up dedicated IPs for bulk sending, maintain sender reputation scores, provide real-time bounce handling and suppression lists, and route transactional emails through dedicated high-priority IPs separate from bulk sending.

Can I send HTML emails with custom templates?

Yes. You can send raw HTML or use ConnexBetter's drag-and-drop template editor to create reusable templates. Templates support dynamic variables ({{first_name}}, {{order_id}}) that are substituted per recipient at send time.

How do I track email opens and clicks?

Enable tracking in your API request with 'track_opens': true and 'track_clicks': true. We insert a 1px tracking pixel for open events and rewrite links for click tracking. Events are delivered to your webhook URL and available in the dashboard analytics.

What is the rate limit for the Email API?

Transactional email: up to 1,000 requests/minute. Bulk email sends: up to 1 million emails/hour on Enterprise plans. API requests for campaign creation are separate from the actual sending rate. Contact us for custom throughput.

How do I handle bounces and unsubscribes?

ConnexBetter automatically processes hard bounces (invalid addresses) and adds them to your suppression list. Soft bounces are retried 3 times. Unsubscribe links are automatically appended to bulk emails to comply with CAN-SPAM and GDPR. You can also POST to /v1/email/suppressions to manually add addresses.

Send your first email in minutes

99% deliverability, open/click tracking, and full API access — get started free.