Custom Endpoint for User-permission plugin

System Information
  • Strapi Version: 4.9.2
  • Operating System: WSL2
  • Database: Postgres
  • Node Version: v18.12.1
  • NPM Version: 8.19.2
  • Yarn Version:

I want to make API endpoint (authenticated users only) which includes email and address only if the member wishes it to be exposed to other members.

All methods I’ve found on this forum and Stackoverflow are not working for me.

Can anyone help?