Send a message over MailChannels API
POST/send
click-tracking notes:
- if the URL of the 'a' tag is empty within the HTML body or doesn't start with http/https, or has a clicktracking attribute with a value of 'off', it will be ignored.
Request
Query Parameters
When present and set to true, the message will not be sent. Instead, the fully rendered message is returned. This can be useful for testing.
Header Parameters
- application/json
Body
required
Array [
]
Array [
]
-
Reserved headers: The following headers cannot be modified:
- Authentication-Results
- BCC
- CC
- Content-Transfer-Encoding
- Content-Type
- DKIM-Signature
- From
- Message-ID
- Received
- Reply-To
- Subject
- To
-
Header precedence: If a header is defined in both the personalizations object and the root headers, the value from personalizations will be used.
-
Case sensitivity: Headers are treated as case-insensitive. If multiple headers differ only by case, only one will be used, with no guarantee of which one.
Array [
Array [
]
Array [
]
- string
- boolean
- number
- list, whose values are all of permitted types
- map, whose keys must be strings, and whose values are all of permitted types
-
Reserved headers: The following headers cannot be modified:
- Authentication-Results
- BCC
- CC
- Content-Transfer-Encoding
- Content-Type
- DKIM-Signature
- From
- Message-ID
- Received
- Reply-To
- Subject
- To
-
Header precedence: If a header is defined in both the personalizations object and the root headers, the value from personalizations will be used.
-
Case sensitivity: Headers are treated as case-insensitive. If multiple headers differ only by case, only one will be used, with no guarantee of which one.
Array [
]
]
attachments
object[]
Possible values: <= 1000
the attachment data, encoded in base64
the name of the attachment file
the MIME type of the attachment
content
object[]
required
The template type of the content
Possible values: [mustache
]
The mime type of the content you are including in your email
The actual content of the specified mime type that you are including in the message
from
object
required
headers
object
A JSON object containing key-value pairs, where both keys (header names) and values must be strings. These pairs represent custom headers to be substituted. Please note the following restrictions and behavior:
mailfrom
object
personalizations
Personalization[]
required
Possible values: <= 1000
bcc
object[]
Possible values: <= 1000
cc
object[]
Possible values: <= 1000
Encoded in Base64.
A JSON object containing key-value pairs of variables to set for template rendering. Keys must be strings, and values can be one of the following types:
from
object
headers
object
A JSON object containing key-value pairs, where both keys (header names) and values must be strings. These pairs represent custom headers to be substituted. Please note the following restrictions and behavior:
reply_to
object
to
object[]
required
Possible values: >= 1
, <= 1000
reply_to
object
tracking_settings
object
Settings to adjust open and click tracking for the message. Please note that enabling tracking for your messages requires a subscription that supports open and click tracking.
click_tracking
object
Setting to enable or disable click tracking for the message. This feature allows you to track when a recipient clicks a link in your email.
false
open_tracking
object
Setting to enable or disable open tracking for the message. This feature allows you to track when a recipient opens your email. Please note that some email clients may not support open tracking.
false
Responses
- 200
- 202
- 400
- 403
- 413
- 500
- 502
Success. Returned if dry-run is present in the query
- application/json
- Schema
- Example (from schema)
Schema
a string representation of a rendered message, one per personalization in the request
{
"data": [
"string"
]
}
Success
Bad Request
User does not have access to this feature
Payload too large - The total message size should not exceed 20MB. This includes the message itself, headers, and the combined size of any attachments.
Internal Server Error
- application/json
- Schema
- Example (from schema)
Schema
This is an array error objects that provide machine and human readable descriptions of the errors.
{
"errors": [
"string"
]
}
Bad Gateway
- application/json
- Schema
- Example (from schema)
Schema
This is an array error objects that provide machine and human readable descriptions of the errors.
{
"errors": [
"string"
]
}