We do this in one or 2 places already, but I have been meaning to take it out, I dont like setting undefined in place of actual params, preferred style is

    var params = {
      auth: .....
    };
    if (opts.keys) { 
      params.data = JSON.stringify({keys: opts.keys});
    }