How to Configure API in LibreNMS?

How to sent message to engineer for any device port down or up or reboot device.

Did you see the docs?

https://docs.librenms.org/#API/

For what you say, I think you want to configure Alerts.