Create SharePoint Role Definition – SharePoint Stack Exchange


I am developing an application for Sharepoint 2019 and Sharepoint online. I need to create a custom role definition via REST API. the only thing I have found is /_api/web/roledefinitions but only to consult them

I would really appreciate if someone could help me.