Hello,
Unfortunately, there is no way to configure the device that it would send data to a preconfigured server, when triggered by a change of an I/O state.
The Data to server feature on TRB245 works with MODBUS or DNP3 protocol data and can send it in JSON format via MQTT, HTTP(S) and Kinesis protocols, however, it sends data on set periods, not external events.
More details on data to server feature are provided in the wiki link: https://wiki.teltonika-networks.com/view/TRB245_Data_to_Server.
Best regards,
Žygimantas