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.

            • Search messages by date

              post

              /messages/search

              Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use /messages/info.json to get the information for a single message, or webhooks to push activity to your own application for querying.

              body parameters

              • keyrequired
                string

                a valid api key

              • query
                string

                search terms to find matching messages

              • date_from
                string

                start date

              • date_to
                string

                end date

              • tags
                string[]

                an array of tag names to narrow the search to, will return messages that contain ANY of the tags

              • senders
                string[]

                an array of sender addresses to narrow the search to, will return messages sent by ANY of the senders

              • api_keys
                string[]

                an array of API keys to narrow the search to, will return messages sent by ANY of the keys

              • limit
                integer

                the maximum number of results to return, defaults to 100, 1000 is the maximum

              Search messages by date

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

              Success Response

              • HTTP Status 200

                an array of objects for each matching message

                • Array
                  object[]

                  the information for a single matching message

                  Show Properties

              Example response

              JSON
              [
                {
                  "ts": 0,
                  "_id": "string",
                  "sender": "user@example.com",
                  "template": "string",
                  "subject": "string",
                  "email": "user@example.com",
                  "tags": [
                    "string"
                  ],
                  "opens": 0,
                  "opens_detail": [
                    {
                      "ts": 0,
                      "ip": "string",
                      "location": "string",
                      "ua": "string"
                    }
                  ],
                  "clicks": 0,
                  "clicks_detail": [
                    {
                      "ts": 0,
                      "url": "string",
                      "ip": "string",
                      "location": "string",
                      "ua": "string"
                    }
                  ],
                  "state": "sent",
                  "metadata": {}
                }
              ]
            • 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.