See how this controller action was done - https://github.com/Katello/katello/blob/master/app/controllers/api/v2/products_controller.rb#L63