Skip to main content

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

    dry-run boolean

    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

    X-Api-Key stringrequired

Body

required

    attachments

    object[]

    Possible values: <= 1000

  • Array [

  • content stringrequired

    the attachment data, encoded in base64

    filename stringrequired

    the name of the attachment file

    type string

    the MIME type of the attachment

  • ]

  • content

    object[]

    required

  • Array [

  • template_type string

    The template type of the content

    Possible values: [mustache]

    type stringrequired

    The mime type of the content you are including in your email

    value stringrequired

    The actual content of the specified mime type that you are including in the message

  • ]

  • from

    object

    required

    email stringrequired
    name string

    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:

    • 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.

    property name* string

    mailfrom

    object

    email stringrequired
    name string

    personalizations

    Personalization[]

    required

    Possible values: <= 1000

  • Array [

  • bcc

    object[]

    Possible values: <= 1000

  • Array [

  • email stringrequired
    name string
  • ]

  • cc

    object[]

    Possible values: <= 1000

  • Array [

  • email stringrequired
    name string
  • ]

  • dkim_domain string
    dkim_private_key string

    Encoded in Base64.

    dkim_selector string
    dynamic_template_data object

    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:

    • 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

    from

    object

    email stringrequired
    name string

    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:

    • 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.

    property name* string

    reply_to

    object

    email stringrequired
    name string
    subject string

    to

    object[]

    required

    Possible values: >= 1, <= 1000

  • Array [

  • email stringrequired
    name string
  • ]

  • ]

  • reply_to

    object

    email stringrequired
    name string
    subject stringrequired

    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

    enable boolean

    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.

    Default value: false

    open_tracking

    object

    enable boolean

    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.

    Default value: false

Responses

Success. Returned if dry-run is present in the query

Schema

    data string[]

    a string representation of a rendered message, one per personalization in the request

Loading...