The code is a bit hard to share, it’s all abstracted into classes and helpers but I can give you a cURL command that has the same behavior
You will need to fix the URL and add your own token to test the command
curl -X POST https://oie-xxx.oktapreview.com/api/v1/iam/roles -H "Authorization: SSWS tokengoeshere" -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"label\":\"somelabel\"}"
Returns:
{"errorCode":"E0000009","errorSummary":"Internal Server Error","errorLink":"E0000009","errorId":"oaePMaR7nZbQPaFHsqFHu5XiQ","errorCauses":[]}%
EDIT: Man I gotta start reading better.
‘description’ and ‘permissions’ are required parameters. Adding those makes the request work properly. The API probably shouldnt be returning 500’s when invalid parameters are given though