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.

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

                              • Add webhook

                                post

                                /webhooks/add

                                Add a new webhook.

                                body parameters

                                • keyrequired
                                  string

                                  a valid api key

                                • urlrequired
                                  string

                                  the URL to POST batches of events

                                • description
                                  string

                                  an optional description of the webhook

                                • events
                                  object[]

                                  an optional list of events that will be posted to the webhook

                                Add webhook

                                const mailchimpClient = require("@mailchimp/mailchimp_transactional")(
                                  "YOUR_API_KEY"
                                );
                                
                                const run = async () => {
                                  const response = await mailchimpClient.webhooks.add({
                                    url: "https://elsie.net",
                                  });
                                  console.log(response);
                                };
                                
                                run();
                                
                                

                                Success Response

                                • HTTP Status 200

                                  the information saved about the new webhook

                                  • id
                                    integer

                                    a unique integer indentifier for the webhook

                                  • url
                                    string

                                    The URL that the event data will be posted to

                                  • description
                                    string

                                    a description of the webhook

                                  • auth_key
                                    string

                                    the key used to requests for this webhook

                                  • events
                                    string[]

                                    The message events that will be posted to the hook

                                  • created_at
                                    string

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

                                  • last_sent_at
                                    string

                                    the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format

                                  • batches_sent
                                    integer

                                    the number of event batches that have ever been sent to this webhook

                                  • events_sent
                                    integer

                                    the total number of events that have ever been sent to this webhook

                                  • last_error
                                    string

                                    if we've ever gotten an error trying to post to this webhook, the last error that we've seen

                                Example response

                                JSON
                                {
                                  "id": 0,
                                  "url": "string",
                                  "description": "string",
                                  "auth_key": "string",
                                  "events": [
                                    "send"
                                  ],
                                  "created_at": "2019-08-24T14:15:22Z",
                                  "last_sent_at": "2019-08-24T14:15:22Z",
                                  "batches_sent": 0,
                                  "events_sent": 0,
                                  "last_error": "string"
                                }
                              • Whitelists

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