Skip to main content

How Emails are Structured for Sending via the /send Endpoint

The /send endpoint accepts a JSON payload representing the email message. The structure defines the envelope and content of the email, including sender, recipient, subject, and body. A field called personalizations optionally allows you to specify unique content for each recipient of an email message.

Basic Structure

Here's a minimal template of the JSON structure:

{
"personalizations": [{}],
"from": {},
"subject": "",
"content": [
{
"type": "",
"value": ""
},
{
"type": "",
"value": ""
}
]
}

Field Types

  • personalizations: Array of objects (recipient-specific data)
  • from: Object (sender information)
  • subject: String
  • content: Array of objects (email body parts)

Each content object contains:

  • type: String (e.g., "text/plain", "text/html")
  • value: String (actual content)

Each EmailAddress object (sender and recipients information) contains:

  • name: String (optional) (display name in raw text, e.g., John Doe, 张三).
  • email: String (e.g., foo@example.com)
info

Always provide the name field as raw, unencoded text to prevent double-encoding issues. Special characters and non-ASCII text will be automatically handled for email compatibility.

info

Detailed definitions of each field can be found in the API Reference Documentation