Which API to use for implementing user creation policy in Jira

Hi,

For some reason, we want to restrict all our project admins from adding new users in the project. But we cannot remove the project admins as they need this permission to create components/releases/versions.
Is there any way using any API (REST/JAVA) that we can implement this policy to run dynamically.
I am looking for something like, whenever an event of adding user occurs, a pop-up message appears that says “adding users not allowed for project admins”?
Any headups will be appreciated. I am looking to know as where to start from.

Regards

Anyone, help please?