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.

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

                        • Update template

                          post

                          /templates/update

                          Update the code for an existing template. If null is provided for any fields, the values will remain unchanged.

                          body parameters

                          • keyrequired
                            string

                            a valid api key

                          • namerequired
                            string

                            the immutable name of an existing template

                          • from_email
                            string

                            the new default sending address

                          • from_name
                            string

                            the new default from name

                          • subject
                            string

                            the new default subject line

                          • code
                            string

                            the new code for the template

                          • text
                            string

                            the new default text part to be used

                          • publish
                            boolean

                            set to false to update the draft version of the template without publishing

                          • labels
                            string[]

                            an optional array of up to 10 labels to use for filtering templates

                          Update template

                          const mailchimpClient = require("@mailchimp/mailchimp_transactional")(
                            "YOUR_API_KEY"
                          );
                          
                          const run = async () => {
                            const response = await mailchimpClient.templates.update({ name: "name" });
                            console.log(response);
                          };
                          
                          run();
                          
                          

                          Success Response

                          • HTTP Status 200

                            the template that was updated

                            • slug
                              string

                              the immutable unique code name of the template

                            • name
                              string

                              the name of the template

                            • labels
                              string[]

                              the list of labels applied to the template

                            • code
                              string

                              the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version

                            • subject
                              string

                              the subject line of the template, if provided - draft version

                            • from_email
                              string

                              the default sender address for the template, if provided - draft version

                            • from_name
                              string

                              the default sender from name for the template, if provided - draft version

                            • text
                              string

                              the default text part of messages sent with the template, if provided - draft version

                            • publish_name
                              string

                              the same as the template name - kept as a separate field for backwards compatibility

                            • publish_code
                              string

                              the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published

                            • publish_subject
                              string

                              the subject line of the template, if provided

                            • publish_from_email
                              string

                              the default sender address for the template, if provided

                            • publish_from_name
                              string

                              the default sender from name for the template, if provided

                            • publish_text
                              string

                              the default text part of messages sent with the template, if provided

                            • published_at
                              string

                              the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published

                            • created_at
                              string

                              the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format

                            • updated_at
                              string

                              the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format

                            • is_broken_template
                              boolean

                              indicates if the template is malformed or corrupt

                          Example response

                          JSON
                          {
                            "slug": "string",
                            "name": "string",
                            "labels": [
                              "string"
                            ],
                            "code": "string",
                            "subject": "string",
                            "from_email": "string",
                            "from_name": "string",
                            "text": "string",
                            "publish_name": "string",
                            "publish_code": "string",
                            "publish_subject": "string",
                            "publish_from_email": "user@example.com",
                            "publish_from_name": "string",
                            "publish_text": "string",
                            "published_at": "2019-08-24T14:15:22Z",
                            "created_at": "2019-08-24T14:15:22Z",
                            "updated_at": "2019-08-24T14:15:22Z",
                            "is_broken_template": true
                          }
                        • 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.