Programmatically disabling and re-enabling triggers

We sometimes need to disable and eventually re-enable triggers in our mongo cloud application, usually after some heavy data processing during which we want all events emitted by the triggers to SQS and AWS event bridge to be completely ignored.

We can do this by pulling the infra, updating the config and pushing back to the cloud (and repeating when we want them enabled), but is there an easier way to do this?

Something like an endpoint we can hit or a function we can call that could e.g. switch the trigger “disabled” flag on-the-fly, every time it’s called or something along those lines?

Thank you!

Hi, we actually have an Admin API for exactly this use case. See here for details on how to make Admin API requests and here for the specifics of the endpoint you are interested in. (MongoDB Atlas App Services Admin API)

Let me know if that works for you.

Best,
Tyler

Thank you very much!
Will give that a try!

That’s exactly what we were looking for!
Thanks!