const options = {
method: 'POST',
headers: {
'X-Instance-Id': '<x-instance-id>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({to: '1234567890@s.whatsapp.net', text: 'Updated message'})
};
fetch('https://api.wsapi.chat/messages/{messageId}/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));