How can I retrieve logged-in user's role with REST API?

Extend or add new new controller

"use strict";

module.exports = {

  async find(ctx, next) {

    const { id } = ctx.params;

    return await strapi.query("plugin::users-permissions.user").findOne({

      where: { id },

      populate: ["role"],

    });

  },

};

If u get 404 dont forget to add new endpoint inte admin → roles