@Ankur Bawiskar 

By default the Scripted Rest api end points are taking BasicAuth(username and password). Is there a way to change the Authorization method to OAuth in scripted rest api end point? 

currently it looks like below: