Opensearch how to retrieve custom created roles through api

Hello All,

I am trying to retreive only the custom roles. Any work around to get that? I know we can get all the apis using API GET _plugins/_security/api/roles. However Is there any way i can pass the flag with reserved to false and retreive only custom created roles. I am trying to take backups only for custom roles.

Can you please let me know the solution?


@krameshkumar6 I don’t think it’s possible to retrieve custom roles using documented APIs.
However, the output produced by the REST API is in JSON format.
You could try to use jq tool to extract custom data.