get permission_ids for role creation over rest api

Hello, I would like to create roles along with permission assignments via the REST API. However, I’m wondering how I can best dynamically fetch the permission_ids along with their names. According to the documentation, there isn’t a REST endpoint for this.

Thanks!