How to allow new custom api endpoint accessable without admin panel?

System Information
  • Strapi Version:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

I am creating api from commands in version 3 and want to give new created api head permission public or authenticated for access. But without use of admin panel manually from backend because i need only api’s not admin panel on server.

i want programatic solution of steps
( from admin panel go to settings >roles>public or authenticated>grant or revoke permission)

I am looking for the same thing, did you get it?