How do I programmatically specify which routes are public or authenticated

System Information
  • Strapi Version: 4.12.4
  • Operating System: Windows 11
  • Database: PostgreSQL
  • Node Version: 16.18

Is there a way to programmatically specify which routes are public or authenticated or even any other custom role that is created instead of manually having to check the boxes bellow all the time.