How to create Roles using API's

I see API’s for groups, but not roles. How do I create roles using API’s?

We don’t have an API for creating or editing user roles. You can only create roles through the web interface, though you can assign web users to an existing role using the web users API.