code: @Path("/{groupName}/{'users'}/{cuid}")
      @ApiOperation(value="Delete a workgroup or remove a user from a workgroup",
          notes="If users/{cuid} is present, user is removed from workgroup.", response=StatusMessage.class)
      public JSONObject delete(String path, JSONObject content, Map<String,String> headers)
      throws ServiceException, JSONException {
          String name = getSegment(path, 1);
          String rel = getSegment(path, 2);
  
          UserServices userServices = ServiceLocator.getUserServices();
          try {
              if (rel == null) {
                  Workgroup workgroup = userServices.getWorkgroup(name);
                  if (workgroup == null)
                      throw new ServiceException(ServiceException.NOT_FOUND, "Workgroup not found: " + name);
                  userServices.deleteWorkgroup(name);
              }
              else if (rel.equals("users")) {
                  String cuid = getSegment(path, 3);
                  userServices.removeUserFromWorkgroup(cuid, name);
              }
          }
          catch (DataAccessException ex) {
              throw new ServiceException(HTTP_500_INTERNAL_ERROR, ex.getMessage(), ex);
          }
          return null;
      }
docs: Delete workgroup or remove user from group.