Solution 1 is to:
- open the port on your PostGIS database
- declare the connection in the Data Source Manager of QGIS
- directly consume the PostGIS table within QGIS where you can edit
No need to go through any import/export or something like a REST API.
Main drawback is while you do local edit on QGIS, you may get edit also on Web app.
It can be a "deal breaker" because you may have editing conflicts.
You may want to expose your PostGIS table(s) by using OGC standard WFS-T (WFS with transaction e.g editing capabilities) as QGIS can directly do editing in this case (built-in)
If you really want to make call to a particular REST API, you will need to customize PyQGIS code. Instead of print statements, you would need to replace code to make your http calls to your API. This partial answer supposes you know some Python and you already first made a call to your REST API to get features and then load them using a recipe like https://anitagraser.com/pyqgis-101-introduction-to-qgis-python-programming-for-non-programmers/pyqgis101-creating-editing-a-new-vector-layer/
layer = iface.activeLayer()
# Simple version but you surely will need to use other signals listed at
# https://qgis.org/api/classQgsVectorLayer.html starting with keyword
# "committed" like `committedFeaturesAdded` (second sample)
def committedFeaturesAdded(layerId, addedFeatures):
# To stop listening to signal event when editing. Do not do it when testing but only at the end, to clean event management