How to create Category/Group through API

See How to reverse engineer the Discourse API