Mailchimp Developer LogoMailchimp Developer Wordmark

Transactional API

  • Allowlists

    Add, list, or delete from your Rejection Allowlist.

    • Exports

      Start an export, or get information on export jobs in progress.

      • IPs

        Request and manage Dedicated IPs for your account, and set up reverse DNS.

        • Inbound

          Manage your inbound domains and routes.

          • Messages

            Send, schedule, or get information on your emails.

            • Send using message template

              post

              /messages/send-template

              Send a new transactional message through the Transactional API using a template.

              body parameters

              • keyrequired
                string

                a valid api key

              • template_namerequired
                string

                the immutable slug of a template that exists in the user's account. Make sure you don't use the template name as this one might change.

              • template_contentrequired
                object[]

                an array of template content to send. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

                Show Properties
              • messagerequired
                object

                the other information on the message to send - same as /messages/send, but without the html content

                Show Properties
              • async
                boolean

                enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.

              • ip_pool
                string

                the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.

              • send_at
                string

                when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately; for future dates, you're limited to one year from the date of scheduling.

              Send using message template

              const mailchimpClient = require("@mailchimp/mailchimp_transactional")(
                "YOUR_API_KEY"
              );
              
              const run = async () => {
                const response = await mailchimpClient.messages.sendTemplate({
                  template_name: "template_name",
                  template_content: [{}],
                  message: {},
                });
                console.log(response);
              };
              
              run();
              
              

              Success Response

              • HTTP Status 200

                an array of objects for each recipient containing the key "email" with the email address, and details of the message status for that recipient

                • Array
                  object[]

                  the sending results for a single recipient

                  Show Properties

              Example response

              JSON
              [
                {
                  "email": "user@example.com",
                  "status": "sent",
                  "reject_reason": "hard-bounce",
                  "queued_reason": "attachments",
                  "_id": "string"
                }
              ]
            • Metadata

              Manage your custom metadata fields in your account.

              • Rejects

                Add, list, or delete from your Rejection Denylist.

                • Senders

                  Manage or get information about your sending domains.

                  • Subaccounts

                    Manage your subaccounts, including the abilitiy to pause and resume sending.

                    • Tags

                      List, delete, or get information on your Tags and their sending statistics.

                      • Templates

                        Manage the Templates in your account.

                        • URLs

                          Manage your tracking domains. Some of these endpoints may be deprecated.

                          • Users

                            Get information about your account, or ping Transactional.

                            • Webhooks

                              Manage the webhooks in your account.

                              • Whitelists

                                Add, list, or delete from your Rejection Allowlist. These endpoints are being replaced with a series of functionally identical endpoints called /allowlists.