GHE Enable Staff tools code search using the rest API

I have a lot of forked repositories where code search results are not being shown, I learned of the restriction here

While I can probably rely on the stars method to allow the search in the forked repositories to be enabled I also found that a forked-repository admin can go to this page https://[INSTANCE]/stafftools/repositories/[OWNER]/[REPOSITORY]/search and enable code search on the individual forked-repository as well and this works even when the stars criteria is not satisfied.

So I want to ask if there is a way to call an API method to do the same thing (enable code search) and avoid using the mentioned page since I’m trying to achieve this for multiple repositories and have a way to do it for new ones.