Skip to main content
POST

Authorizations

X-API-Key
string
header
required

Body

application/json
from
string
required
  • The sender's email. Its domain should be one that has been registered and activated in your account.
  • The sender's email address is required while the sender's name is optional. For example, both support@example.com and Sender<support@example.com> work.
Example:

"SupportTeam<support@example.com>"

to
string
required
  • The intended recipients' email addresses.
  • Supports a comma-separated list of one or more addresses. Max items: 100.
Example:

"to1@example.com,Nick<to2@example.com>"

subject
string
required

The email subject, which contains a short string identifying the topic of the message. Max length: 255.

Maximum string length: 255
content
string
required
  • The email body. Max size: 150 KB.
  • Variables in the form of #var_1# are supported, they should be used together with the variables parameter. Variable keys only support letters, digits, and the underline character (_).
  • You can use the Test Templates provided by YCloud for testing.
Example:

"This is a test message from #nick#."

contentType
enum<string>

The MIME type of the email content (text/html or text/plain). Be aware that We won't count click and open events for the type text/plain.

Available options:
text/html,
text/plain
variables
object[]
  • The variable key-value pairs that will replace the variable placeholders in content for each recipient. Variable keys are those that are wrapped with # as placeholders (e.g., #var_1#) in content. The placeholders will be replaced by variable values when sending the email.
  • The size of the array must be the same as the number of recipients in to. Be aware that cc and bcc addresses are excluded, and they can not receive emails that contain variables.
  • This parameter's size will be calculated together with the parameter content. The whole size must not exceed 150 KB.
cc
string

Recipients who will receive a copy of the email.

Example:

"cc1@example.com,Nick<cc2@example.com>"

bcc
string

Recipients who will receive a blind carbon copy of the email.

Example:

"bcc1@example.com,Nick<bcc2@example.com>"

replyTo
string

If this field exists, then the reply should go to the addresses indicated in that field and not to the address(es) indicated in the from field.

summary
string

This is a summary of your email. Max length: 70.

Maximum string length: 70
Example:

"This is a summary."

externalId
string

A unique (recommended) string to reference the object. This can be an order number or similar, and can be used to reconcile the object with your internal systems.

callbackUrl
string

Delivery report URL. You can provide a URL, and we will push the updated status report to your server in time. e.g., https://httpbin.org/anything?tag=api. Note: We recommend configuring Webhook Endpoints instead.

Example:

"https://httpbin.org/anything?tag=api-email"

Response

200 - application/json

The request is successfully accepted.

id
string
required

Unique ID for the object.

Required string length: 6 - 128
from
object

The sender's email address.

to
object[]

The intended recipients' email addresses.

cc
object[]

Recipients who will receive a copy of the email.

bcc
object[]

Recipients who will receive a blind carbon copy of the email.

replyTo
object[]

If this field exists, then the reply should go to the addresses indicated in that field and not to the address(es) indicated in the from field.

subject
string

The email subject, which contains a short string identifying the topic of the message.

Maximum string length: 255
summary
string

This is a summary of your email. Max length: 70.

Maximum string length: 70
Example:

"This is a summary."

contentType
enum<string>

The MIME type of the email content (text/html or text/plain). Be aware that We won't count click and open events for the type text/plain.

Available options:
text/html,
text/plain
externalId
string

A unique (recommended) string to reference the object. This can be an order number or similar, and can be used to reconcile the object with your internal systems.

callbackUrl
string

Delivery report URL. You can provide a URL, and we will push the updated status report to your server in time. e.g., https://httpbin.org/anything?tag=api. Note: We recommend configuring Webhook Endpoints instead.

Example:

"https://httpbin.org/anything?tag=api-email"

createTime
string<date-time>

The time at which this message was created, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

Example:

"2022-06-01T12:00:00.000Z"

totalRecipients
integer<int32>

Total recipients of this message, including to, cc and bcc.

Example:

3

totalPrice
number<double>

Total price of this message.

Example:

0.0085

currency
string

Price currency. ISO 4217 currency code.

Example:

"USD"