public JObject PostRule([FromBody] JObject body, string accessKey = null) { if (!AccessKeyHelper.CanAdminRules(accessKey)) { Response.StatusCode = StatusCodes.Status401Unauthorized; return(null); } var ruleObj = new Rule(body); RulesRepository.Add(ruleObj); return(ruleObj.ToJObject()); //var id = body["id"]?.ToString(); //return RulesRepository.Get(id).ToJObject(); }