How to use the Admin API within functions


I’m curious how to use the admin api from within an atlas function. For example:

  1. document gets updated
  2. trigger calls a function on update
  3. detect changes according the ChangeEvent and if it fits a specific patterns, a specific user should be deleted

At the moment from my point of view, to make this possible it’s required to first of all make a request to get a valid accessToken and then make a request to delete the user.

I’m wondering if it’s possible to directly call that api, because indeed the request would be originated to an internal function of that project. So do I have to first of all request an accessToken every single time the function gets executed?


Hello did you find a way to consume Admin API from a function without going through the REST API Endpoint ?
My use case is too enable / disable a Trigger that is trigger every minutes until there is no more stuff to do. Then the function disable the trigger.