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.

            • Get message content

              post

              /messages/content

              Get the full content of a recently sent message.

              body parameters

              • keyrequired
                string

                a valid api key

              • idrequired
                string

                the unique id of the message to get - passed as the "_id" field in webhooks, send calls, or search calls

              Get message content

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

              Success Response

              • HTTP Status 200

                the content of the message

                • ts
                  integer

                  the Unix timestamp from when this message was sent

                • _id
                  string

                  the message's unique id

                • from_email
                  string

                  the email address of the sender

                • from_name
                  string

                  the alias of the sender (if any)

                • subject
                  string

                  the message's subject line

                • to
                  object

                  the message recipient's information

                  Show Properties
                • tags
                  string[]

                  list of tags on this message

                • headers
                  object

                  the key-value pairs of the custom MIME headers for the message's main document

                • text
                  string

                  the text part of the message, if any

                • html
                  string

                  the HTML part of the message, if any

                • attachments
                  object[]

                  an array of any attachments that can be found in the message

                  Show Properties

              Example response

              JSON
              {
                "ts": 0,
                "_id": "string",
                "from_email": "user@example.com",
                "from_name": "string",
                "subject": "string",
                "to": {
                  "email": "user@example.com",
                  "name": "string"
                },
                "tags": [
                  "string"
                ],
                "headers": {},
                "text": "string",
                "html": "string",
                "attachments": [
                  {
                    "name": "string",
                    "type": "string",
                    "content": "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.