Hello @Valsaraj Viswanathan , take a look to Protect a resource server/API and Access other resource servers from a resource server and beyond for samples on how to protect your api using @PreAuthorize("hasRole|hasAuthority|etc")
and more.
Let us know if this answer was helpful to you. If so, please remember to accept it so that others in the community with similar questions can more easily find a solution.