Send Template Email

Send emails by calling preset templates through template call names, supporting dynamic parameter replacement.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required

Sender email address (e.g., [email protected]). After configuring DMARC, SendCloud uses the current domain as the suffix of "from". Also accepts the display-name form "Name [email protected]". Required; empty returns MAIL_FROM_NOTNULL (40801), invalid format returns MAIL_FROM_INCORRECT (40802)

string

Recipient email addresses (separated by semicolons, e.g., [email protected];[email protected]), or address list addresses when useAddressList=true (e.g., [email protected];[email protected]). Required if not using xsmtpapi or address list; empty returns MAIL_TOS_NOTNULL (40805). Any invalid address returns MAIL_TOS_ERROR (40806); more than 100 addresses returns MAIL_TOS_REACH_MAX (40807). Ignored when xsmtpapi contains a to array

string

SMTP extension. See → X-SMTPAPI for details. Invalid JSON returns MAIL_XSMTPAPI_INCORRECT (40813); unknown keys (e.g. "substitutions" instead of "sub") return MAIL_XSMTPAPI_ERROR (40817); an empty to array returns MAIL_XSMTPAPI_PARSE_TO_NULL (40816); the to array is capped at 100 (40827); an invalid to entry returns MAIL_XSMTPAPI_INVALID_TO (40880). When a to array is present, the peer parameters to/cc/bcc are ignored. Substitutions use the "sub" key with %var% names, each value list matching the to list length. Ignored when useAddressList=true — template variables then come from each member's vars

string
length ≤ 512

Email subject. Optional; defaults to the template subject. If both the request subject and the template subject are empty returns MAIL_TEMPLATE_SUBJECT_NOTNULL (40826); longer than 512 characters returns MAIL_SUBJECT_INCORRECT (40809)

string
required
length ≤ 64

Calling name of the email template. Required; empty returns TEMPLATE_INVOKENAME_NOTEMPTY (40201), malformed or over 64 characters returns TEMPLATE_INVOKENAME_FORMATERROR (40202), a nonexistent template returns MAIL_TEMPLATE_NOTFOUND (40823), an unapproved template returns MAIL_TEMPLATE_NOTVERIFY (40824), a template whose emailType differs from the API_USER's returns MAIL_TEMPLATE_APIUSER_TYPENOTMATCH (40825)

string
length ≤ 255

Content summary. Replaces the template's summary if present; added if not. Longer than 255 bytes returns MAIL_SUMMARY_LENGTH_EXCEED (40878)

string
length ≤ 128

Sender name (shown as "Example customer service [email protected]"). Max 128 characters; malformed returns MAIL_FROMNAME_INCORRECT (40804)

string

CC addresses (separated by semicolons). Any invalid address returns MAIL_CC_INCORRECT (40853); more than 100 addresses returns MAIL_CCS_REACH_MAX (40854). Ignored when xsmtpapi contains a to array or useAddressList=true

string

BCC addresses (separated by semicolons). Any invalid address returns MAIL_BCC_INCORRECT (40856); more than 100 addresses returns MAIL_BCCS_REACH_MAX (40857). Ignored when xsmtpapi contains a to array or useAddressList=true

string

Default reply addresses (separated by semicolons, max 3; exceeding returns MAIL_REPLYTO_SIZE_EXCEED (40879)). Supports plain email or display-name format (e.g., "ASC [email protected]"); invalid address returns MAIL_REPLYTO_INCORRECT (40811). Defaults to "from" if empty or null

string
length ≤ 255

Label for this send. Automatically created if not existing in the account. Max length is 255 characters; out-of-range returns LABEL_NAME_FORMATERROR (40105); a name with no letter or digit returns LABEL_NAME_CHARSET_INVALID (40118)

string

Tags for the request (separated by ";", max 5 tags, each up to 50 characters). More than 5 tags returns GLOBAL_TAGS_MAX (40033); a tag longer than 50 characters or empty returns GLOBAL_TAGS_LENGTH (40034); malformed input returns GLOBAL_TAGS_INCORRECT (40035). Only ";" is a separator; tag names are not otherwise validated

string

Email headers in JSON format (e.g., {"header1": "value1", "header2": "value2"}). Invalid JSON returns MAIL_HEADERS_INCORRECT (40869). Values of any JSON type are accepted

attachments
array of files

Email attachments. Must use multipart/form-data when submitting. Total size over 10MB returns MAIl_ATTACHMENTS_EXCEED_MAXSIZE_TEN (40819); accounts whitelisted via the big_attachment system param may send up to 50MB, over which returns MAIl_ATTACHMENTS_EXCEED_MAXSIZE_FIFTY (408191). Contact customer service for special needs.

string
length ≤ 128

Max 128 characters; overlong returns GLOBAL_REQUESTID_TOOLONG (40031). Duplicate values within 1 hour (3600s) are only processed once and return GLOBAL_DUPLICATE_REQUEST (40000, "Repeat request") with result=false and no emailIdList

string
enum
Defaults to true

Whether to return emailId. Returns a list for multiple recipients

Allowed:
string
enum
Defaults to false

Whether to enable notification

Allowed:
string
enum
Defaults to false

Whether to use address list (e.g., to=[email protected];[email protected]). When true, cc/bcc/xsmtpapi are ignored and to must reference existing address lists: a malformed list address returns MAIL_ADDRESSLIST_ERROR1 (40862), a nonexistent list returns MAIL_ADDRESSLIST_ERROR2 (40863), and more than 5 lists returns MAIL_ADDRESSLIST_REACH_MAX (40864). Requires a paid (VIP) account, otherwise MAIL_ADDRESSLIST_PRIVILEGE (40820). Template variables are substituted from each member's vars. On success the task is created asynchronously and statusCode is 40821 with info.maillistTaskId; poll /api/mail/taskinfo for progress

Allowed:
string

Embedded image ID, which matches the cid value of the src attribute for img tags in email content. For example, for , the value is 123.png. Multiple values are separated by semicolons .If this parameter is used, the email content shall include "<img src='cid:xxxx' /> ".

embeddedImage
array of files

Embedded image, Match embeddedCid in order. Must use multipart/form-data when submitting. Each image must not exceed 10 MB, otherwise, MAIl_ATTACHMENTS_EXCEED_MAXSIZE_TEN (40819) is returned.If this parameter is used, the email content shall include "<img src='cid:xxxx' /> ".

Responses

405

Method not allowed. This endpoint accepts POST and GET (GET is kept for backward compatibility with legacy callers); other HTTP methods are rejected by the framework before reaching business logic.

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json