docs: function(numbers, groupId) {
      var groupId = groupId;
      return new Promise(function(resolve) {
        if (groupId !== undefined) {
          resolve(
            this.getGroup(groupId).then(function(group) {
              if (group !== undefined) {
                throw new Error("Tried to recreate group");
              }
            })
          );
        } else {
          resolve(
            generateNewGroupId().then(function(newGroupId) {
              groupId = newGroupId;
            })
          );
        }
      }).then(function() {
        var me = this.userGetNumber();
        var haveMe = false;
        var finalNumbers = [];
        for (i of numbers) {
          var number = numbers[i];
          if (!helpers.isNumberSane(number))
            throw new Error("Invalid number in group");
          if (number == me) haveMe = true;
          if (finalNumbers.indexOf(number) < 0) finalNumbers.push(number);
        }
  
        if (!haveMe) finalNumbers.push(me);
  
        var groupObject = { numbers: finalNumbers, numberRegistrationIds: {} };
        for (i of finalNumbers)
          groupObject.numberRegistrationIds[finalNumbers[i]] = {};
  
        this.putGroup(groupId, groupObject).then(function() {
          return { id: groupId, numbers: finalNumbers };
        });
      });
    }