Matomo Machine Learning

I would like to customize a customer journey with machine learning scoring via an external API.
So, i would like to know if someone has the right schema how to get the callback from my API in order to apply the event in my TAG MANAGER.
Thanks,