System APIs may not be used:

Attempting to add a permission to a role and I’m getting this error:
“System APIs may not be used:”

Why am I not allowed to use the system api for this when I can use it for everything else?

Hi @scott.david.walker,

Welcome to the Community!

Are you using the Management API’s POST/api/v2/roles/{id}/permissions endpoint to add permissions to the role?

Would you mind sharing what your request looks like (removing any sensitive info) so that I can recreate the error? Thank you!

Hi Stephanie,
Thanks for responding.

I am using that api. The body of my message is:

{

“permissions”: [
{
“resource_server_identifier”: “my api identifier”,
“permission_name”: “Aperm”
}
]
}

and the error message:

{
"statusCode": 400,
"error": "Bad Request",
"message": "System APIs may not be used: My Api Identifier",
"errorCode": "operation_not_supported"

}

Thanks

Scott

1 Like

Thank you for the additional info, @scott.david.walker. For the API Identifier, are you using the identifier for a custom API or the Management API (https://your-domain/api/v2)? You can only assign permissions to a role that belongs to a custom API because the Management API is not intended for direct use in the context of an end user.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.