API Overview

Complete guide to AuroraSendCloud's APIs, SMTP services, and integration. Learn authentication, regional endpoints, email/SMS sending, and comprehensive error handling.

AuroraSendCloud API Overview

Get started with AuroraSendCloud's powerful APIs to send emails, manage contacts, track performance, and integrate seamlessly with your applications. This comprehensive guide will help you make your first API call in minutes.

Quick Start Checklist

Before you begin, ensure you have:

  • ✅ An active AuroraSendCloud account (Sign up here)
  • ✅ Your API Key and API User from API Key Management
  • ✅ A supported HTTP client (cURL, Postman, Python, Node.js, etc.)
  • ✅ Your account region (Singapore, US, or CN) for optimal performance

Regional Base URLs & Endpoints

Email APIs & SMTP Servers (Multi-Region)

Choose the base URL and SMTP server that matches your account's region for email services, contact management, templates, and other core services. All REST API requests must use HTTPS, and responses are returned in JSON format.

REST API Endpoints

RegionBase URL
Singaporehttps://api.aurorasendcloud.com/
US (Silicon Valley)https://api-us.aurorasendcloud.com/
CN (Hong Kong SAR)https://api-hk.aurorasendcloud.com/

SMTP Servers

RegionSMTP ServerSupported Ports
Singaporesmtp.aurorasendcloud.com25, 2525, 587
US (Silicon Valley)smtp-us.aurorasendcloud.com25, 2525, 587
CN (Hong Kong SAR)smtp-hk.aurorasendcloud.com25, 2525, 587
⚠️

Important: Your account is tied to a specific region. Using a non-matching base URL or SMTP server will cause authentication failures. Verify your region in account settings.

SMS API (Single Global Endpoint)

The SMS API uses a unified global endpoint regardless of your account region:

  • Base URL: https://api.aurorasendcloud.com/

Authentication

All API and SMTP requests require authentication using these parameters:

  • api_user: Your AuroraSendCloud API username
  • api_key: Your AuroraSendCloud API key
🔐

Security Best Practice: Never expose API credentials in client-side code. Use server-side implementations and rotate keys regularly.

Email Integration Options

AuroraSendCloud offers two methods for sending emails: REST API for advanced features and programmatic control, and SMTP for simple integration with existing email clients and applications.

REST API - Send an Email

curl -X POST "https://api.aurorasendcloud.com/api/mail/send" \
  -d "api_user=YOUR_API_USER" \
  -d "api_key=YOUR_API_KEY" \
  -d "[email protected]" \
  -d "fromName=Your Name" \
  -d "[email protected]" \
  -d "subject=Welcome to AuroraSendCloud" \
  -d "html=<h1>Hello World!</h1><p>Your first email via AuroraSendCloud API</p>"

SMTP Integration

For applications requiring SMTP integration, use our regional SMTP servers with standard authentication. SMTP provides a simple way to integrate email sending into existing applications.

SMTP Configuration

  • Username: Your API username (api_user)
  • Password: Your API key (api_key)
  • Ports: 25, 2525, 587 (standard SMTP ports)
  • Authentication: Required for all connections
  • Security: STARTTLS supported on port 587

SMTP Code Examples

import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

# Configuration - Use regional SMTP server
smtp_server = "smtp.aurorasendcloud.com"  # Singapore
# smtp_server = "smtp-us.aurorasendcloud.com"  # US
# smtp_server = "smtp-hk.aurorasendcloud.com"  # CN
smtp_port = 587  # STARTTLS
username = "YOUR_API_USER"
password = "YOUR_API_KEY"

# Create message
msg = MIMEMultipart()
msg['From'] = "[email protected]"
msg['To'] = "[email protected]"
msg['Subject'] = "Test Email via SMTP"

body = "Hello from AuroraSendCloud SMTP!"
msg.attach(MIMEText(body, 'plain'))

# Send email with STARTTLS
try:
    server = smtplib.SMTP(smtp_server, smtp_port)
    server.starttls()  # Enable security
    server.login(username, password)
    text = msg.as_string()
    server.sendmail("[email protected]", "[email protected]", text)
    server.quit()
    print("Email sent successfully!")
except Exception as e:
    print(f"Error: {e}")

SMTP vs REST API Comparison

FeatureSMTPREST API
Setup ComplexitySimpleModerate
Advanced FeaturesLimitedFull access
Template SupportBasicAdvanced
Tracking & AnalyticsBasicComprehensive
Bulk SendingGoodOptimized
Real-time StatusBasicDetailed
Integration EffortMinimalModerate

SMS Integration

curl -X POST "https://api.aurorasendcloud.com/smsapi/send" \
  -d "smsUser=YOUR_SMS_USER" \
  -d "smsKey=YOUR_SMS_KEY" \
  -d "templateId=123456" \
  -d "phone=+1234567890" \
  -d "vars={\"code\":\"123456\"}"

API Response Format

All API responses follow a consistent JSON structure:

Success Response

{
  "result": true,
  "statusCode": 200,
  "message": "request was successful",
  "info": {
    "emailIdList": ["email_id_123"]
  }
}

Error Response

{
  "result": false,
  "statusCode": 40005,
  "message": "authentication failed",
  "info": {}
}

Response Fields

  • result: Boolean indicating success (true) or failure (false)
  • statusCode: Numeric status code (see complete reference below)
  • message: Human-readable description of the result
  • info: Contains response data on success, empty object on failure

Complete Status Code Reference

Common Status Codes

Status CodeMeaning
200Request was successful
40005Authentication failed - verify api_user and api_key
40903Email sent successfully
40901Email sending failed
50000Rate limit exceeded - implement retry logic
501Server exception
6001Access permission denied

Parameter Validation Errors (40001-40017)

Status CodeMeaning
40001start parameter cannot be empty
40002Invalid start parameter format
40003limit parameter cannot be empty
40004Invalid limit parameter format
40006Invalid days format - must be integer > 0
40007Invalid startDate format - use yyyy-MM-dd
40008Invalid endDate format - use yyyy-MM-dd
40009labelIdList cannot be empty
40010apiUserList cannot be empty
40011Email address cannot be empty
40012Invalid email address format
40013domainList cannot be empty
40014Label ID cannot be empty
40015Invalid label ID format
40016Invalid apiUserList format
40017Invalid aggregation parameter format

Label Management (40100-40113)

Status CodeMeaning
40100Label created successfully
40101Label creation failed
40102Label ID cannot be empty
40103Invalid label ID
40104Label name cannot be empty
40105Label name must be 1-255 characters
40106Label ID does not exist
40107Label deleted successfully
40108Label deletion failed
40109Label updated successfully
40110Label update failed
40111Query parameter cannot be empty
40112Query must be 1-255 characters
40113Label name already exists

Template Management (40201-40229)

Status CodeMeaning
40201invokeName cannot be empty
40202Invalid invokeName format
40203Template type cannot be empty
40204Invalid template type - must be 0 or 1
40205templateStat cannot be empty
40206Invalid templateStat - must be -1, -2, 1, or 0
40207Template name cannot be empty
40208Invalid template name format
40209Template subject cannot be empty
40210Invalid template subject format
40211Template HTML cannot be empty
40212Invalid template HTML format
40213Template text cannot be empty
40214Invalid template text format
40215Template creation failed
40216Template with invokeName does not exist
40217Template deletion failed
40218Template update failed
40219Maximum 50 templates per user exceeded
40220invokeName already exists
40221isSubmitAudit cannot be empty
40222Invalid isSubmitAudit format
40223Template pending approval - cannot modify
40224Cancel parameter cannot be empty
40225Invalid cancel parameter format
40226Template already pending approval
40227Template already approved
40228Template not approved - cannot withdraw
40229Template not submitted - cannot withdraw

Address List Management (40501-40522)

Status CodeMeaning
40501Address list name cannot be empty
40502Address list name must be 1-48 characters
40503Address list addresses cannot be empty
40504Address list alias must be 1-48 characters
40505Address list alias already exists
40506Address list description cannot be empty
40507Address list description must be 1-250 characters
40508Address list creation failed
40514Address list must have > 0 members
40515Address list cannot exceed 1000 members
40516Failed to add member to address list
40517Address list does not belong to user
40518Invalid member address format
40519Failed to delete member from address list
40522Variables parameter is not valid JSON

Email Sending Parameters (40801-40880)

Status CodeMeaning
40801Sender address (from) cannot be empty
40802Invalid sender address format
40803Sender name (fromName) cannot be empty
40804Invalid sender name format
40805Recipient address cannot be empty
40806Invalid recipient addresses in list
40807Maximum 100 recipient addresses per request
40808Email subject cannot be empty
40809Invalid email subject format
40810Reply-to address cannot be empty
40811Invalid reply-to address format
40870Both HTML and plain text cannot be empty
40871Invalid HTML format
40879Maximum 3 reply-to addresses allowed
40880Invalid email format in X-SMTPAPI "to" field

Email Sending Results (40901-40913)

Status CodeMeaning
40901Email sending failed
40902Unknown error processing email
40903Email sent successfully
40904Quota check failed
40905Quota check passed
40906Quota check temporarily passed
40907No template matching required for API_USER
40908Email content does not match template
40909Email content matches template
40910Email content temporarily matches template
40911Error matching email content with template
40912Insufficient account balance - please recharge
40913Request quota exceeded

Domain & API User Management (41001-41119)

Status CodeMeaning
41001Domain name cannot be empty
41002Domain name must be 1-250 characters
41003Invalid domain name format
41008Invalid domain type
41012Maximum 5 domains per user
41014Domain does not exist
41015Domain creation failed
41016Domain modification failed
41109User information does not exist
41111Invalid API user name (6-32 chars, letters/numbers only)
41112Maximum 10 API users per account
41119API user creation failed

System & Server Errors (49901-50001)

Status CodeMeaning
49901Invalid URL format
49902Abnormal HTTP request
49903HTTP request failed
49904HTTP request successful
49905HTTP response parsing error
49906Other system errors
50000Rate limit exceeded
50001Email sending failed - frequency limited

Best Practices

Error Handling

Always check the result field and implement proper error handling based on statusCode. Use the comprehensive status code reference above for specific error responses.

Rate Limiting

Implement exponential backoff for rate limit errors (50000, 50001). Monitor your sending patterns and distribute requests over time.

Security

Never expose API credentials in client-side code. Use environment variables, rotate keys regularly, and implement server-side proxy endpoints for frontend applications.

Regional Optimization

Use the correct regional endpoint for both REST APIs and SMTP servers. This ensures optimal performance, compliance, and reduces latency.

SMTP Port Selection

Use port 587 with STARTTLS for secure connections. Port 25 may be blocked by ISPs, and port 2525 is an alternative for environments where 25 is restricted.

Monitoring & Analytics

Track email delivery rates, open rates, and bounce rates. Use webhooks for real-time event notifications and implement proper logging for debugging.

Account Management & Quotas

Daily Request Quota

Your account has a daily request quota that varies based on account type and reputation:

  • Free users: 50 emails/day after email verification
  • Paid users: Base quota of 3,000 emails/day, automatically adjusted based on reputation

Reputation System

AuroraSendCloud uses a reputation scoring system that affects your daily quota:

  • Positive factors: High delivery rates, open rates, click rates
  • Negative factors: Invalid addresses, spam reports, unsubscribes
  • Critical: Rapid increases in invalid addresses or spam reports can suspend sending

Variables in Email Content

Use variables in your email content for personalization:

Hi %name%,
Welcome to AuroraSendCloud! Your verification code is: %active_code%

Variables can be used in:

  • Email subject lines
  • HTML and plain text content
  • Template content with X-SMTPAPI substitution

Next Steps

Now that you understand the basics:

  1. Set up your domain - Configure SPF, DKIM, and DMARC records
  2. Create templates - Build reusable email templates for common scenarios
  3. Implement webhooks - Get real-time notifications for email events
  4. Monitor performance - Track delivery rates and optimize your sending

Ready to start building? Choose between REST API for advanced features or SMTP for simple integrations - both use the same authentication credentials and regional optimization!