Hi,
Can you achieve this using EventListener ? Normally we use webhook for Cloud and EventListener for server add-on.
EventListener
webhook
Reference: https://developer.atlassian.com/confdev/confluence-plugin-guide/confluence-plugin-module-types/event-listener-module/annotation-based-event-listener-example