POST /messages

Send messages to recipients


template (required)

The template field is required and should be the template slug you wish to send.

to (required)

The to field is required to send a message. It should be a single recipient.

from (optional)

The from field is optional on the API call as long as it is set on either the Template or the Provider.

The order of precedence for the from field on a message is:

  1. from attribute in the API call

  2. If not set in API call it will look in Template defaults

  3. If not set in Template it will look in Provider defaults

  4. If not set in 1-3 it will return an error and fail to send Message

subject (optional)

The subject field is optional on the API call as long as it is set in the Template defaults.

templateVariables (optional)

The templateVariables field accepts a hash/object of variables and text to replace in the template.

For example if you have the text Hello {{user}} in your template and pass { user: "Bob" } as templateVariables then the template will render Hello Bob



The recipient of the message


The from address of the message sent


A preview of the body of the message delivered to the recipient


A unique identifier, for the message sent, issued from the provider.


If an error is present you will get a http status of 500 and the error field will contain the error



curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token test_eYLQRrzxLcLAlmb2H5BXIFSUor3h/tRr" \
-d '{
      "template": "user-welcome",
      "to": "",
      "from": "Northwind App <>",
      "subject": "Welcome to Northwind",
      "templateVariables": {
        "name": "Bob Vance"
    }' \


    "to": "",
    "from": "Northwind App <>",
    "body": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2//EN\"><html ... </html>"

Last updated