Getting Started

Complete guide to setting up your API documentation dashboard and helping users make their first successful API call.

1Pick a language

2Credentials

3Try it!

Click Try It! to start a request and see the response here!

AuroraSendCloud API Quickstart

Get started with AuroraSendCloud's powerful APIs to send emails, manage contacts, track performance, and integrate seamlessly with your applications. Follow this step-by-step guide to make your first API call in minutes, with clear distinctions between multi-region email APIs and the single-region SMS API.

Prerequisites

Before you begin, ensure you have:

  • An active AuroraSendCloud account (sign up at aurorasendcloud.com)
  • Your API Key and API User (found in your account's API Key Management page)
  • A supported HTTP client (e.g., cURL, Postman, Python's requests library)
  • Confirmation of your account's region (Singapore, US, or Hong Kong) for email API access (not required for SMS API)

1. API Base URLs (By Service Type)

Email & Core APIs (Multi-Region)

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

RegionBase URLCoverage
Singapore (SG)https://api.aurorasendcloud.com/Default region for APAC users
United States (US)https://api-us.aurorasendcloud.com/For North American users and services
Hong Kong (HK)https://api-hk.aurorasendcloud.com/For Greater China and nearby APAC regions

ℹ️

Note: Your account is tied to a specific region during sign-up. Using a non-matching base URL for email/core APIs will cause authentication failures or data inconsistencies. Confirm your region in your account settings.

SMS API (Single Region)

The SMS API uses a unified global base URL (no regional endpoints required):

  • Base URL: https://api.aurorasendcloud.com/
  • All SMS requests must use this URL regardless of your account's region
  • Authentication and response format are consistent with email/core APIs

2. Authentication

Authenticate all API requests (email, SMS, and core services) by including your credentials as request parameters:

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

⚠️

Critical Security Note: Never expose your API credentials in client-side code (e.g., browsers, mobile apps). Restrict access to your API key, rotate it regularly via the API Key Management page, and avoid hardcoding credentials in your source code.

3. Making Your First API Call

Example: Send an Email

```bash curl -X POST "https://api.aurorasendcloud.com/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=Test Email" \ -d "html=

Hello from AuroraSendCloud!

" ``` ```python import requests
url = "https://api.aurorasendcloud.com/mail/send"
data = {
    "api_user": "YOUR_API_USER",
    "api_key": "YOUR_API_KEY",
    "from": "[email protected]",
    "fromName": "Your Name",
    "to": "[email protected]",
    "subject": "Test Email",
    "html": "<h1>Hello from AuroraSendCloud!</h1>"
}

response = requests.post(url, data=data)
print(response.json())
```
```javascript const axios = require('axios');
const data = {
  api_user: 'YOUR_API_USER',
  api_key: 'YOUR_API_KEY',
  from: '[email protected]',
  fromName: 'Your Name',
  to: '[email protected]',
  subject: 'Test Email',
  html: '<h1>Hello from AuroraSendCloud!</h1>'
};

axios.post('https://api.aurorasendcloud.com/mail/send', data)
  .then(response => console.log(response.data))
  .catch(error => console.error(error));
```

Example: Send an SMS

```bash 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\"}" ``` ```python import requests
url = "https://api.aurorasendcloud.com/smsapi/send"
data = {
    "smsUser": "YOUR_SMS_USER",
    "smsKey": "YOUR_SMS_KEY",
    "templateId": "123456",
    "phone": "+1234567890",
    "vars": '{"code":"123456"}'
}

response = requests.post(url, data=data)
print(response.json())
```

4. API Response Format

All API responses (email and SMS) follow a consistent JSON structure:

Success Response (Request Successful)

{
  "result": true,
  "statusCode": 200,
  "message": "request was successful",
  "info": {}
}

Success Response (Data Acquisition)

{
  "statusCode": 200,
  "info": {
    "data": {
      "gmtCreated": "2015-10-19 15:39:27",
      "gmtUpdated": "2015-10-19 15:39:27",
      "labelId": 123,
      "labelName": "test"
    }
  },
  "message": "request was successful",
  "result": true
}

Error Response (Authentication Failed)

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

Response Field Definitions:

  • result: Boolean indicating whether the request succeeded (true) or failed (false)
  • statusCode: Numeric code representing the request status (see complete list below)
  • message: Description of the status code (for debugging and user feedback)
  • info: Contains response data (e.g., SMS/email IDs, retrieved records) on success; empty on failure

5. API Return Codes Reference

Common Status Codes

Status CodeMeaning
200Request was successful
40005Authentication failed (check api_user/api_key)
40903Email sent successfully
40901Email sending failed
50000Interface frequency limited
501Server exception
6001You don't have permission to access

General & Validation Errors (40001-40017)

Status CodeMeaning
40001start cannot be empty
40002Invalid start parameter
40003limit cannot be empty
40004Invalid limit parameter
40006Invalid days format; must be an integer greater than zero
40007Invalid startDate format (e.g., "2013-03-19")
40008Invalid endDate format (e.g., "2013-03-19")
40009labelIdList cannot be empty
40010apiUserList cannot be empty
40011Email cannot be empty
40012Invalid email format
40013domainList cannot be empty
40014Label ID cannot be empty
40015Invalid label ID format
40016Invalid apiUserList format
40017Invalid format of aggregation parameters

Label Management (40100-40113)

Status CodeMeaning
40100Label was successfully created
40101Failed to create label
40102Label ID cannot be empty
40103Invalid label ID
40104Label name cannot be empty
40105Label name should be 1-255 characters
40106The label corresponding to label ID does not exist
40107Label was successfully deleted
40108Failed to delete label
40109Label was successfully updated
40110Failed to update label
40111Query cannot be empty
40112Query should 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; can only be 0 or 1
40205templateStat cannot be empty
40206Invalid templateStat; can only be -1, -2, 1, or 0
40207Name cannot be empty
40208Invalid name format
40209Subject cannot be empty
40210Invalid subject format
40211HTML cannot be empty
40212Invalid HTML format
40213Text cannot be empty
40214Invalid text format
40215Failed to create template
40216The template corresponding to invokeName does not exist
40217Failed to delete template
40218Failed to update template
40219User can have no more than 50 templates
40220invokeName already exists
40221isSubmitAudit cannot be empty
40222Invalid isSubmitAudit format
40223Template is pending approval and cannot be modified
40224Cancel cannot be empty
40225Invalid cancel format
40226Template is pending approval; do not submit again
40227Template has been approved; do not submit again
40228Template not approved; do not withdraw the approval request
40229Template not submitted for approval; unable to withdraw approval request

Email Sending Parameters (40801-40880)

Status CodeMeaning
40801fromAddress cannot be empty
40802Invalid fromAddress format
40803fromName cannot be empty
40804Invalid fromName format
40805Recipient address cannot be empty
40806Illegal addresses in the recipient address list
40807Recipient addresses should be no more than 100
40808Subject cannot be empty
40809Invalid subject format
40810replyto cannot be empty
40811Invalid replyto format
40870HTML and plain cannot both be empty
40871HTML format error
40879replyto cannot be more than 3
40880Invalid email format in field "to" of xsmtpapi

Email Sending Results (40901-40913)

Status CodeMeaning
40901Email sending failed
40902Unknown error when processing email
40903Email sent successfully
40904Quota check failed
40905Quota check passed
40906Quota check temporarily passed
40907No need to match template for corresponding content of the API-USER
40908Email content does not match template
40909Email content matches template
40910Email content temporarily matches template
40911Error occurred when matching email content and template
40912Your account balance is insufficient; please recharge soon
40913Request quota exceeded

Address List Management (40501-40522)

Status CodeMeaning
40501Name cannot be empty
40502Address list name should be 1-48 characters
40503Address cannot be empty
40504Address list alias should be 1-48 characters
40505Address list alias already exists
40506Description cannot be empty
40507Address list description should be 1-250 characters
40508Failed to create address list
40514Number of member addresses should be more than 0
40515Number of member addresses should be no more than 1000
40516Failed to add member
40517Address list does not belong to the user
40518Member address does not conform to the specification
40519Failed to delete member
40522Variables parameter does not adhere to JSON string syntax

Domain & API User Management (41001-41119)

Status CodeMeaning
41001Name cannot be empty
41002Name should be 1-250 characters
41003Name does not conform to domain specification
41008Type does not conform to specification
41012User can create no more than 5 domains
41014Domain does not exist
41015Failed to create domain
41016Failed to modify domain
41109User information does not exist
41111Name does not conform to specification (should be 6-32 characters; only numbers and letters allowed)
41112apiUser should be no more than 10
41119Failed to create apiUser

System & Server Errors (49901-50001)

Status CodeMeaning
49901Invalid URL format
49902Abnormal HTTP request
49903HTTP request failed
49904HTTP request was successful
49905HTTP result parsing error
49906Other errors
50000Interface frequency limited
50001Mail sending failed; 536 frequency limited

6. Best Practices

Always implement proper error handling by checking the `result` field and `statusCode` in responses. Use the comprehensive error codes above to provide meaningful feedback to users. Be aware of rate limits (status codes 50000, 50001). Implement exponential backoff and respect the API's rate limiting to ensure reliable service. Never expose API credentials in client-side code. Use environment variables or secure credential storage solutions in production environments. Use the correct regional endpoint for email APIs to ensure optimal performance and compliance with local regulations.

Ready to start building? Use the code examples above to send your first email or SMS, and refer to the complete error code reference when debugging your integration.

Popular Endpoints
Last 24 Hours
LoadingLoading…