listening hook on course module or activity or resource added on moodle

I need to trigger a custom action or send an HTTP request to my API whenever a course module, activity, or resource is added in Moodle 4.5 The API will handle indexing for the added module.

Is there a way to add a hook or listen to an existing event for this scenario in Moodle?

Any guidance, examples, or references to the relevant APIs or documentation would be greatly appreciated!

Thanks in advance.