This post is a duplicate to this post :  [How to find the id of the last added feature using pyQGIS?][1] 

The answer is the exact same one. Very sorry!

  [1]: https://gis.stackexchange.com/questions/102376/how-to-find-the-id-of-the-last-added-feature-using-pyqgis