How to invoke an external rest api

hello, I need to invoke an external api rest after persisting an object in an entity


you can use entity listeners to handle entity creation events. Read more about them here and here.
Then in the entity listener invoke your external REST API in any way you want. For example, you can use the Apache HttpClient.