Update webform field using put method (REST API)

Hi all,
I have created a doctype and a web form which depends on the doctype.
I’m authenticating the user via OTP login
after successful login I will allow the user to fill the web form
now on resubmit condition I need to fetch the details of the user based on his phone number and if I try to update the fields data it should get updated within existing docname.
My actual question is on click of save button in webform can I call REST API from python file to update the user details from the webform. Please let me know your view on this

Thank you all