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.

      • Export activity history

        post

        /exports/activity

        Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data.

        body parameters

        • keyrequired
          string

          a valid api key

        • notify_email
          string

          an optional email address to notify when the export job has finished

        • date_from
          string

          start date as a UTC string in YYYY-MM-DD HH:MM:SS format

        • date_to
          string

          end date as a UTC string in YYYY-MM-DD HH:MM:SS format

        • tags
          string[]

          an array of tag names to narrow the export to; will match messages that contain ANY of the tags

        • senders
          string[]

          an array of senders to narrow the export to

        • states
          string[]

          an array of message states to narrow the export to; messages with ANY of the states will be included

        • api_keys
          string[]

          an array of api keys to narrow the export to; messsagse sent with ANY of the keys will be included

        Export activity history

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

        Success Response

        • HTTP Status 200

          information about the activity export job that was started

          • id
            string

            the unique identifier for this Export. Use this identifier when checking the export job's status

          • created_at
            string

            the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format

          • type
            string

            the type of the export job

          • finished_at
            string

            the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run

          • state
            string

            the export job's state

          • result_url
            string

            the url for the export job's results, if the job is complete

        Example response

        JSON
        {
          "id": "string",
          "created_at": "2019-08-24T14:15:22Z",
          "type": "string",
          "finished_at": "2019-08-24T14:15:22Z",
          "state": "string",
          "result_url": "string"
        }
      • 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.

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