diff --git a/lib/sparkpost.js b/lib/sparkpost.js
index e873def..3f59e1a 100644
--- a/lib/sparkpost.js
+++ b/lib/sparkpost.js
@@ -60,6 +60,7 @@ var SparkPost = function(apiKey, options) {
   this.recipientLists = require('./recipientLists')(this);
   this.relayWebhooks = require('./relayWebhooks')(this);
   this.sendingDomains = require('./sendingDomains')(this);
+  this.subaccounts = require('./subaccounts')(this);
   this.suppressionList = require('./suppressionList')(this);
   this.templates = require('./templates')(this);
   this.transmissions = require('./transmissions')(this);
diff --git a/lib/subaccounts.js b/lib/subaccounts.js
index 888a2a6..85de232 100644
--- a/lib/subaccounts.js
+++ b/lib/subaccounts.js
@@ -11,7 +11,16 @@ var toApiFormat = function(input) {
   model.status = input.status;
 
   model.key_grants = Array.isArray(input.keyGrants) ? input.keyGrants : [input.keyGrants];
-  model.key_valid_ips = Array.isArray(input.keyValidIps) ? input.keyValidIps : [input.keyValidIps];
+
+  // server returns 500 if key_valid_ips is empty array
+  if (input.keyValidIps) {
+    var keyValidIpsIsArray = Array.isArray(input.keyValidIps);
+    if (keyValidIpsIsArray && input.keyValidIps.length > 0) {
+      model.key_valid_ips = input.keyValidIps;
+    } else if (!keyValidIpsIsArray) {
+      model.key_valid_ips = [input.keyValidIps];
+    }
+  }
 
   return model;
 };
diff --git a/test/spec/subaccounts.spec.js b/test/spec/subaccounts.spec.js
index a69f804..d36d873 100644
--- a/test/spec/subaccounts.spec.js
+++ b/test/spec/subaccounts.spec.js
@@ -122,6 +122,61 @@ describe('Subaccounts Library', function () {
         done();
       });
     });
+
+    it('should not set key_valid_ips in request if keyValidIps is missing from options', function(done) {
+      var options = {
+        name: 'test',
+        keyLabel: 'test',
+        keyGrants: []
+      };
+
+      subaccounts.create(options, function(err, data) {
+        expect(client.post.firstCall.args[0].json.key_valid_ips).to.be.undefined;
+        done();
+      })
+    });
+
+    it('should not set key_valid_ips in request if keyValidIps is empty array', function(done) {
+      var options = {
+        name: 'test',
+        keyLabel: 'test',
+        keyGrants: [],
+        keyValidIps: []
+      };
+
+      subaccounts.create(options, function(err, data) {
+        expect(client.post.firstCall.args[0].json.key_valid_ips).to.be.undefined;
+        done();
+      })
+    });
+
+    it('should set key_valid_ips in request if keyValidIps is in options and is a non-empty array', function(done) {
+      var options = {
+        name: 'test',
+        keyLabel: 'test',
+        keyGrants: [],
+        keyValidIps: ['127.0.0.1']
+      };
+
+      subaccounts.create(options, function(err, data) {
+        expect(client.post.firstCall.args[0].json.key_valid_ips).to.eql(['127.0.0.1']);
+        done();
+      })
+    });
+
+    it('should set key_valid_ips in request if keyValidIps is in options and is not an array', function(done) {
+      var options = {
+        name: 'test',
+        keyLabel: 'test',
+        keyGrants: [],
+        keyValidIps: '127.0.0.1'
+      };
+
+      subaccounts.create(options, function(err, data) {
+        expect(client.post.firstCall.args[0].json.key_valid_ips).to.eql(['127.0.0.1']);
+        done();
+      })
+    });
   });
 
   describe('update Method', function() {