title: MailChimp API v3.0 batch request responds with "total_operations": 0
body: <p>I'm quite certain I've done something stupid, but I've been staring at this for hours now and I need someone smarter than I am. Below is js code in an aws-lambda function that makes a POST request to the mailchimp batches API. The goal is to create a batch of DELETE operations for multiple members of a list. It first makes a request to a dynamoDb to grab the correct list ID and API key, and that is going off without a hitch. When it makes the API call to MailChimp, the API responds 200 but that there are 0 total_operations. When I make a GET request for the batch to check the status, it tells me that the operation finished with 0 total operations, no errors. What am I missing?</p>
  
  <pre><code>import { success, failure } from "./libs/response-lib";
  import * as dynamoDbLib from "./libs/dynamodb-lib";
  import Mailchimp from "mailchimp-api-v3";
  
  export async function main(event, context, callback) { 
   const parsedUserId = event.requestContext.identity.cognitoIdentityId.split(":")[1];
   const data = JSON.parse(event.body);
  
      const params = {
          TableName: "tr-users",
          Key: { userId: parsedUserId },
          ProjectionExpression: "mc_apiKey, listId"
      };
  
      try {
          //get the user's contact list ID and API key
          await dynamoDbLib.call("get", params)
              .then((result) =&gt; {
  
                  //build operations array
                  var reqData = {};
                  reqData.operations = data.contacts.map(contact =&gt; {
                      var outputObject = {
                          method: "DELETE",
                          path: `lists/${result.Item.listId}/members/${contact}`
                      };
                      return outputObject;
                  });
  
                  //make batch post to mailchimp
                  var mailchimp =  new Mailchimp(result.Item.mc_apiKey);
                  mailchimp.request({
                      method: "post",
                      path: "/batches",
                      data: reqData
                  }).then((response) =&gt; {
                      callback(null, success(response));
                  });
              })
      } catch (e) {
              console.log(e);
              callback(null, failure({ status: false }));
      }
  }
  </code></pre>
  
  <p>Below is the response from the GET request for the batch: </p>
  
  <pre><code>{"id":"0c25e7f089","status":"finished","total_operations":0,"finished_operations":0,"errored_operations":0,"submitted_at":"2018-08-14T01:20:28+00:00","completed_at":"2018-08-14T01:20:34+00:00","response_body_url":"","_links":[{"rel":"parent","href":"https://us18.api.mailchimp.com/3.0/batches","method":"GET","targetSchema":"https://us18.api.mailchimp.com/schema/3.0/Definitions/Batches/CollectionResponse.json","schema":"https://us18.api.mailchimp.com/schema/3.0/CollectionLinks/Batches.json"},{"rel":"self","href":"https://us18.api.mailchimp.com/3.0/batches/0c25e7f089","method":"GET","targetSchema":"https://us18.api.mailchimp.com/schema/3.0/Definitions/Batches/Response.json"},{"rel":"delete","href":"https://us18.api.mailchimp.com/3.0/batches/0c25e7f089","method":"DELETE"}]}
  </code></pre>
  
  <p>Any insight is much appreciated!</p>