Plugin or web API to provide events on contacts

Your software
My Mautic version is: v4
My PHP version is: 8?
My Database type and version is: MariaDB

Your problem
My problem is: I want to tell mautic when an event has occurred for a given contact

I’m using mailgun (we can’t use SES at the moment).
We have written a script to accept webhooks from mailgun. It gets them and currently we just write to a file to verify we get them.
What we want to know is if there is a way for a plugin to tell mautic that a given event has occurred for an email it sent to a contact? Or easier, via the mautic API…either will do.