I have a requirement where i am trying to create a role using workflow in Non-Employee Risk Management but the workflow giving error REST API Action failure: HTTP Status: 400 - Bad Request i am using the below configuration
Thanks for submitting this question, it has illuminated several things that we will be looking into.
And I have several thing to cover:
It appears that the api/role endpoint is somehow bugged and is throwing 400 error no matter what you include in the JSON body. I’ll be opening my own bug report shortly but I’d recommend you do as well to put pressure on them.
As a way to get unblocked. Please use the api/roles endpoint instead which appears to work as expected. Just make sure you change the JSON body to use {“roles”:[ ]} instead.
You are including the “private” flag which:
Defaults to false anyway
Is ignored by the endpoint, which is why the API Docs do not specify it as a value
You are NOT including “type”. This value is technically optional as it defaults to “NeprofileRole”, but I wanted to mention it in case you were meaning to create a Collaborator role (a common use case and is suggested by the values in your example). If you are intending the new role to govern access to the Collaborator portal than you need to include “type”: “NeaccessRole”