title: Bitbucket API adding branch restriction - malformed groups
body: <p>Trying to add branch restriction to a repository, I was successful in adding a rule, however, I cannot get a group added to the rule.</p>
  
  <pre><code>curl -XPOST --user user:password -H "Content-Type: application/json" -d '{"kind": "push", "pattern": "testing*", "groups": {"name": "testleads"}}' $URL/api/2.0/repositories/team/repo/branch-restrictions
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{"error": {"message": "malformed groups"}}
  </code></pre>
  
  <p>I have tried different combinations in the groups using full_slug, slug and also changing the inheritance types.</p>
  
  <pre><code>-d '{"kind": "push", "pattern": "testing*", "groups":["name": "devleads"]}'
  -d '{"kind": "push", "pattern": "testing*", "groups": {"name": "devleads"}}'
  </code></pre>
  
  <p>Has anyone tried this?</p>