I have API which returns me some responses based on parameters but the important point is when my database has any change then my Appian local variable which has API data also needs to get updated automatically, which means simply a WebSocket type connection with an API
Discussion posts and replies are publicly visible
There is a way, but it comes at the cost of performance.
If you know the tables that will be updated, then you can add a refreshVariable, make it refresh in 30 seconds and query data from the database, compare it with the older data on the interface and if the data is changed, you can fire your integration to get the refreshed data.