Email Transactional API

Our Email API supports sending Email messages for Business. The API can handle single or large number of transactional messages.

Transactional API is used for sending transactional emails. In transactional emails you have to provide priority value which informs Gateway API whether the request is high priority request or low priority request.

Fact Sheet

FeatureSupportRemark
Priority LevelsYesLow and High priority support
Text MessagesYesThe maximum length of the message must be less than 25 MB including media and must be UTF-8 encoded message
MediaYesFile Name should end with proper extension. Multiple media files are allowed per message and must be base64 encoded. The size of the media files including the message content should not exceed 25MB.
Media: imagesYesMaximum size should be less than 25 MB including other attachments and text content.
Media:
Audio
NoAudio files are not supported as of now.
Media: VideoNoVideo files are not supported as of now.
Media: DocumentsYesMaximum size should be less than 25 MB including other attachments and text content.
HTML contentYesMaximum size of the content should be less than 25MB including other attachments and text content.
Text contentYesMaximum size of the content should be less than 25MB including other attachments and text content.
CCYesMaximum number of CCs including To and BCC should be less than 50.
BCCYesMaximum number of BCCs including To and BCC should be less than 50.
ToYesMaximum number of Tos including To and BCC should be less than 50.

Sending Emails

Email API uses from (fromAddress) and to (toAddresses) email address for sending Emails. The API also requires logical account of the consumer. The API also expects a priority value which can either be Low or High.

Required Header X-CM-PRODUCTTOKEN

POST /v1/transactional?priority={priority}
Content-Type: application/json
X-CM-PRODUCTTOKEN: {your-product-token}

Request Headers

Header NameTypeRequiredDescription
X-CM-PRODUCTTOKENstringYesValid product token GUID
Content-TypestringYesMust be "application/json"

Query Parameters

ParameterTypeRequiredDescription
prioritystringYes"low" or "high"

The example below shows the simplest Email message request.

{
  "fromAddress": "[email protected]",
  "fromName": "Samuel",
  "replyToAddress": "",
  "replyToName": "",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "Robert Vadra"
    }
  ],
  "ccs": [
    {
      "emailAddress": "[email protected]"
    }
  ],
  "bccs": [
    {
      "emailAddress": "[email protected]"
    }
  ],
  "subject": "An example test email",
  "htmlBody": "<p>Just a test email</p><img src=\"cid:cat_image\"/>",
  "textBody": "",
  "attachments": [
    {
      "fileName": "cat.jpeg",
      "data": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAABAAEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iiigD//2Q==",
      "contentType": "image/jpeg",
      "contentId": "cat_image"
    }
  ],
  "customerReference":""
}

Successful Response

{
  "errorCode": 0,
  "details": "Email sent successfully",
  "messageId": "550e8400-e29b-41d4-a716-446655440000"
}

Error Responses

Invalid Priority (400)

{
  "errorCode": 1,
  "details": "Priority must be 'low' or 'high'.",
  "messageId": ""
}

Invalid Product Token (401)

{
  "errorCode": 3,
  "details": "Product token is mandatory.",
  "messageId": ""
}

Invalid Request (400)

{
  "errorCode": 1,
  "details": "From Address is invalid or empty",
  "messageId": ""
}

Email Too Large (403)

{
  "errorCode": 2,
  "details": "Email size exceeds maximum allowed size",
  "messageId": ""
}

Recipients Limit Exceeded (400)

{
  "errorCode": 1,
  "details": "Recipients count exceeds the max allowed limit of 50",
  "messageId": ""
}

Internal Server Error (500)

{
  "errorCode": 4,
  "details": "Internal server error occurred",
  "messageId": ""
}

Request Parameters

Query Parameters

ParameterTypeRequiredDescription
prioritystringYes"low" or "high"

Request Body Fields

FieldTypeRequiredDescription
fromAddressstringYesSender's email address
fromNamestringNoSender's display name
replyToAddressstringNoReply-to email address
replyToNamestringNoReply-to display name
toAddressesarrayYesList of primary recipients
ccsarrayNoList of CC recipients
bccsarrayNoList of BCC recipients
subjectstringYesEmail subject line
htmlBodystringYesHTML email content
textBodystringYesPlain text email content
attachmentsarrayNoList of file attachments
customerReferencestringNoYour reference for tracking

Recipient Object (toAddresses)

FieldTypeRequiredDescription
toAddressstringYesRecipient email address
toNamestringYesRecipient display name

CC/BCC Object

FieldTypeRequiredDescription
emailAddressstringYesRecipient email address

Attachment Object

FieldTypeRequiredDescription
fileNamestringYesName of the file with extension
datastringYesBase64 encoded file content
contentTypestringYesMIME type of the file
contentIdstringNoContent ID for inline images

Priority Levels

PriorityDescriptionUse Cases
highTime-sensitive, critical emailsPassword resets, OTP, urgent alerts
lowStandard transactional emailsOrder confirmations, receipts

Supported File Types

CategoryExtensionsMax Size
Images.jpg, .jpeg, .png25 MB
Documents.pdf, .doc, .docx25 MB
Archives.zip25 MB

Status Codes

Status CodeDescription
200OK: Email sent successfully
400Bad Request: Invalid request data
401Unauthorized: Invalid product token
403Forbidden: Email rejected (size/content)
500Internal Server Error: Server-side error

Error Handling

All error responses follow a consistent format:

{
  "errorCode": 1,
  "details": "Error description",
  "messageId": ""
}

Best Practices

  1. Priority Usage: Use "high" priority only for truly time-sensitive emails
  2. Clear Subject Lines: Make subjects descriptive and actionable
  3. Customer References: Use meaningful reference IDs for tracking and debugging
  4. Content Size: Keep total email size under 25MB including all attachments
  5. Recipient Validation: Ensure all email addresses are properly formatted

Example Use Cases

Order Confirmation (Low Priority)

Standard order confirmation with receipt:

{
  "fromAddress": "[email protected]",
  "fromName": "Shop Orders",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "John Customer"
    }
  ],
  "subject": "Your Order #12345 Has Been Confirmed",
  "htmlBody": "<h1>Order Confirmed</h1><p>Thank you for your purchase. Your order #12345 has been confirmed and will be processed within 1-2 business days.</p>",
  "textBody": "Order Confirmed - Thank you for your purchase. Your order #12345 has been confirmed and will be processed within 1-2 business days.",
  "attachments": [
    {
      "fileName": "order_receipt.pdf",
      "data": "JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PAovVHlwZSAv...",
      "contentType": "application/pdf"
    }
  ],
  "customerReference": "order-12345"
}

Password Reset (High Priority)

Time-sensitive password reset email:

{
  "fromAddress": "[email protected]",
  "fromName": "App Security",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "App User"
    }
  ],
  "subject": "Password Reset Request - Action Required",
  "htmlBody": "<h1>Reset Your Password</h1><p>Click the link below to reset your password:</p><a href=\"https://app.com/reset?token=abc123xyz\" style=\"background: #007bff; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px;\">Reset Password</a><p>This link expires in 24 hours.</p><p>If you didn't request this, please ignore this email.</p>",
  "textBody": "Reset Your Password - Click the link below to reset your password: https://app.com/reset?token=abc123xyz. This link expires in 24 hours. If you didn't request this, please ignore this email.",
  "customerReference": "pwd-reset-abc123xyz"
}

Account Verification (High Priority)

Critical account verification email:

{
  "fromAddress": "[email protected]",
  "fromName": "Platform Verification",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "New User"
    }
  ],
  "subject": "Verify Your Account - Welcome to Platform!",
  "htmlBody": "<h1>Welcome to Platform!</h1><p>Please verify your email address by clicking the button below:</p><a href=\"https://platform.com/verify?code=xyz789\" style=\"background: #28a745; color: white; padding: 12px 24px; text-decoration: none; border-radius: 5px; display: inline-block;\">Verify Email</a><p>This verification link expires in 48 hours.</p>",
  "textBody": "Welcome to Platform! Please verify your email address by visiting: https://platform.com/verify?code=xyz789. This verification link expires in 48 hours.",
  "customerReference": "verification-xyz789"
}

Invoice Delivery (Low Priority)

Business invoice with accounting CC:

{
  "fromAddress": "[email protected]",
  "fromName": "Company Billing",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "Business Client"
    }
  ],
  "ccs": [
    {
      "emailAddress": "[email protected]"
    }
  ],
  "subject": "Invoice #INV-2024-001 - Payment Due in 30 Days",
  "htmlBody": "<h1>Invoice #INV-2024-001</h1><p>Please find your invoice attached. Payment is due within 30 days of the invoice date.</p><p>If you have any questions, please contact our billing department.</p>",
  "textBody": "Invoice #INV-2024-001 - Please find your invoice attached. Payment is due within 30 days of the invoice date. If you have any questions, please contact our billing department.",
  "attachments": [
    {
      "fileName": "invoice_INV-2024-001.pdf",
      "data": "JVBERi0xLjQKJcfsj6eUKCAg...",
      "contentType": "application/pdf"
    }
  ],
  "customerReference": "invoice-INV-2024-001"
}

Two-Factor Authentication (High Priority)

Security code delivery:

{
  "fromAddress": "[email protected]",
  "fromName": "Bank Security",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "Bank Customer"
    }
  ],
  "subject": "Your Security Code - Do Not Share",
  "htmlBody": "<h1>Security Code</h1><p>Your security code is: <strong style=\"font-size: 24px; color: #007bff;\">123456</strong></p><p>This code expires in 10 minutes.</p><p><strong>Never share this code with anyone.</strong></p>",
  "textBody": "Your security code is: 123456. This code expires in 10 minutes. Never share this code with anyone.",
  "customerReference": "2fa-code-123456"
}

Shipping Notification (Low Priority)

Order shipped notification with tracking

{
  "fromAddress": "[email protected]",
  "fromName": "Store Shipping",
  "toAddresses": [
    {
      "toAddress": "[email protected]",
      "toName": "Valued Customer"
    }
  ],
  "subject": "Your Order #12345 Has Shipped!",
  "htmlBody": "<h1>Your Order Has Shipped!</h1><p>Great news! Your order #12345 has been shipped and is on its way.</p><p><strong>Tracking Number:</strong> 1Z999AA1234567890</p><p>You can track your package at: <a href=\"https://tracking.example.com/1Z999AA1234567890\">Track Package</a></p>",
  "textBody": "Your Order Has Shipped! Great news! Your order #12345 has been shipped and is on its way. Tracking Number: 1Z999AA1234567890. You can track your package at: https://tracking.example.com/1Z999AA1234567890",
  "customerReference": "shipment-12345"
}