Go to Manage Jenkins -> Configure System
Scroll down to Request Filtering and click on the "ADD" button.
From there, the built in help will guide you through the rest of the process. Rules are based of regular expressions.
Filtered Requests Response
When a user tries to access a blocked API endpoint, the server responds with an error
503 and the message
This kind of request is currently being blocked by an administrator